diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rb index 6190e720fa..0e30ba17b7 100644 --- a/app/models/permitted_params.rb +++ b/app/models/permitted_params.rb @@ -590,7 +590,6 @@ class PermittedParams type: [ :name, :is_in_roadmap, - :in_aggregation, :is_milestone, :is_default, :color_id, diff --git a/app/models/type.rb b/app/models/type.rb index f5cdca1807..29432c8ad5 100644 --- a/app/models/type.rb +++ b/app/models/type.rb @@ -62,7 +62,7 @@ class ::Type < ActiveRecord::Base maximum: 255, unless: lambda { |e| e.name.blank? } - validates_inclusion_of :in_aggregation, :is_default, :is_milestone, in: [true, false] + validates_inclusion_of :is_default, :is_milestone, in: [true, false] default_scope { order('position ASC') } diff --git a/app/seeders/basic_data/type_seeder.rb b/app/seeders/basic_data/type_seeder.rb index 1b48dc531f..7b2e6d2b5b 100644 --- a/app/seeders/basic_data/type_seeder.rb +++ b/app/seeders/basic_data/type_seeder.rb @@ -50,7 +50,7 @@ module BasicData # @return [Array] List of attributes for each type. def data colors = PlanningElementTypeColor.all - colors = colors.map { |c| { c.name => c.id } }.reduce({}, :merge) + colors = colors.map { |c| { c.name => c.id } }.reduce({}, :merge) type_table.map do |name, values| { @@ -59,25 +59,24 @@ module BasicData is_default: values[1], color_id: colors[I18n.t(values[2])], is_in_roadmap: values[3], - in_aggregation: values[4], - is_milestone: values[5] + is_milestone: values[4] } end end def type_names - [:task, :milestone, :phase, :feature, :epic, :user_story, :bug] + %i[task milestone phase feature epic user_story bug] end def type_table - { # position is_default color_id is_in_roadmap in_aggregation is_milestone - task: [1, true, :default_color_blue, true, false, false], - milestone: [2, true, :default_color_green_light, false, true, true], - phase: [3, true, :default_color_blue_dark, false, true, false], - feature: [4, true, :default_color_blue, true, false, false], - epic: [5, true, :default_color_orange, true, true, false], - user_story: [6, true, :default_color_grey_dark, true, false, false], - bug: [7, true, :default_color_red, true, false, false] + { # position is_default color_id is_in_roadmap is_milestone + task: [1, true, :default_color_blue, true, false], + milestone: [2, true, :default_color_green_light, false, true], + phase: [3, true, :default_color_blue_dark, false, false], + feature: [4, true, :default_color_blue, true, false], + epic: [5, true, :default_color_orange, true, false], + user_story: [6, true, :default_color_grey_dark, true, false], + bug: [7, true, :default_color_red, true, false] } end end diff --git a/app/seeders/basic_data/workflow_seeder.rb b/app/seeders/basic_data/workflow_seeder.rb index 7067efc45a..4d0384d291 100644 --- a/app/seeders/basic_data/workflow_seeder.rb +++ b/app/seeders/basic_data/workflow_seeder.rb @@ -51,7 +51,6 @@ module BasicData color_id: green_color, is_default: true, is_in_roadmap: true, - in_aggregation: true, is_milestone: false) # Adds the standard type to all existing projects diff --git a/app/views/projects/form/_types.html.erb b/app/views/projects/form/_types.html.erb index 66707c1139..be851b1856 100644 --- a/app/views/projects/form/_types.html.erb +++ b/app/views/projects/form/_types.html.erb @@ -71,15 +71,6 @@ See docs/COPYRIGHT.rdoc for more details. - -
-
- - <%= Type.human_attribute_name(:in_aggregation) %> - -
-
-
@@ -118,9 +109,6 @@ See docs/COPYRIGHT.rdoc for more details. <%= icon_for_type(type) %> <%=h type.name %> - - <%= checked_image(type.in_aggregation) %> - <%= checked_image(type.is_in_roadmap) %> diff --git a/app/views/types/form/_settings.html.erb b/app/views/types/form/_settings.html.erb index 1f9b256e84..cc1239b68a 100644 --- a/app/views/types/form/_settings.html.erb +++ b/app/views/types/form/_settings.html.erb @@ -33,7 +33,6 @@ See docs/COPYRIGHT.rdoc for more details.
<%= f.text_field :name, required: true, disabled: @type.is_standard?, container_class: '-middle' %>
<%= f.check_box :is_in_roadmap %>
<%= f.select :color_id, options_for_colors(@type), container_class: '-slim' %>
-
<%= f.check_box :in_aggregation %>
<%= f.check_box :is_default, label: t(:label_type_default_new_projects) %>
<%= f.check_box :is_milestone %>
diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb index 658ba42b5c..cfa3638fff 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -87,16 +87,6 @@ See docs/COPYRIGHT.rdoc for more details.
- -
-
- - <%= Type.human_attribute_name(:in_aggregation) %> - -
-
-
@@ -140,9 +130,6 @@ See docs/COPYRIGHT.rdoc for more details. <%= checked_image(type.is_default) %> - - <%= checked_image(type.in_aggregation) %> - <%= checked_image(type.is_milestone) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 613e8dec91..a30e6e03d7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -371,7 +371,6 @@ en: type: "Type" type: is_in_roadmap: "In roadmap" - in_aggregation: "In aggregation" is_milestone: "Is milestone" color: "Color" user: @@ -2370,7 +2369,6 @@ en: show: "Status: %{comment}" planning_element_update: "Update: %{title}" - work_packages_are_displayed_in_aggregations: "Work packages are displayed in aggregations" project_type_could_not_be_saved: "Project type could not be saved" type_could_not_be_saved: "Type could not be saved" reporting_could_not_be_saved: "Reporting could not be saved" diff --git a/db/migrate/20180717102331_remove_in_aggregation_from_type.rb b/db/migrate/20180717102331_remove_in_aggregation_from_type.rb new file mode 100644 index 0000000000..12c7e0de93 --- /dev/null +++ b/db/migrate/20180717102331_remove_in_aggregation_from_type.rb @@ -0,0 +1,5 @@ +class RemoveInAggregationFromType < ActiveRecord::Migration[5.1] + def change + remove_column :types, :in_aggregation, :boolean, default: true, null: false + end +end diff --git a/features/step_definitions/general_steps.rb b/features/step_definitions/general_steps.rb index 3766e86c96..541b77721a 100644 --- a/features/step_definitions/general_steps.rb +++ b/features/step_definitions/general_steps.rb @@ -198,7 +198,6 @@ Given /^there are the following types:$/ do |table| type.is_in_roadmap = t['is_in_roadmap'] ? t['is_in_roadmap'] : true type.is_milestone = t['is_milestone'] ? t['is_milestone'] : true type.is_default = t['is_default'] ? t['is_default'] : false - type.in_aggregation = t['in_aggregation'] ? t['in_aggregation'] : true type.is_standard = t['is_standard'] ? t['is_standard'] : false type.save! end diff --git a/spec/models/permitted_params_spec.rb b/spec/models/permitted_params_spec.rb index b77aff9d1f..3d2754a9e9 100644 --- a/spec/models/permitted_params_spec.rb +++ b/spec/models/permitted_params_spec.rb @@ -105,7 +105,6 @@ describe PermittedParams, type: :model do { name: 'blubs', is_in_roadmap: 'true', - in_aggregation: 'true', is_milestone: 'true', color_id: '1', project_ids: %w(2 3 4),