Add filter on type Task for seeded Kanban board

pull/8714/head
Wieland Lindenthal 4 years ago
parent fa07b49922
commit 48f7121cb4
  1. 15
      app/seeders/demo_data/work_package_board_seeder.rb
  2. 2
      config/locales/en.seeders.standard.yml

@ -67,6 +67,8 @@ module DemoData
board.name = project_data_for(key, 'boards.kanban.name')
board.options = { 'type' => 'action', 'attribute' => 'status', 'highlightingMode' => 'priority' }
set_board_filters(board)
board.widgets = seed_kanban_board_queries.each_with_index.map do |query, i|
Grids::Widget.new start_row: 1, end_row: 2,
start_column: i + 1, end_column: i + 2,
@ -83,6 +85,19 @@ module DemoData
Setting.boards_demo_data_available = 'true'
end
def set_board_filters(board)
if project_data_for(key, 'boards.kanban.filters').present?
filters_conf = project_data_for(key, 'boards.kanban.filters')
board.options[:filters] = []
filters_conf.each do |filter|
if filter[:type]
type = Type.find_by(name: translate_with_base_url(filter[:type]))
board.options[:filters] << { type: { operator: '=', values: [type.id.to_s] } }
end
end
end
end
def seed_kanban_board_queries
admin = User.admin.first

@ -108,6 +108,8 @@ en:
boards:
kanban:
name: 'Kanban board'
filters:
- type: default_type_task
basic:
name: 'Basic board'
parent_child:

Loading…
Cancel
Save