Merge pull request #6433 from opf/feature/remove_in_aggregation

remove in_aggregation from type

[ci skip]
pull/6435/head
Oliver Günther 6 years ago committed by GitHub
commit ffff5cd258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/models/permitted_params.rb
  2. 2
      app/models/type.rb
  3. 23
      app/seeders/basic_data/type_seeder.rb
  4. 1
      app/seeders/basic_data/workflow_seeder.rb
  5. 12
      app/views/projects/form/_types.html.erb
  6. 1
      app/views/types/form/_settings.html.erb
  7. 13
      app/views/types/index.html.erb
  8. 2
      config/locales/en.yml
  9. 5
      db/migrate/20180717102331_remove_in_aggregation_from_type.rb
  10. 1
      features/step_definitions/general_steps.rb
  11. 1
      spec/models/permitted_params_spec.rb

@ -590,7 +590,6 @@ class PermittedParams
type: [
:name,
:is_in_roadmap,
:in_aggregation,
:is_milestone,
:is_default,
:color_id,

@ -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') }

@ -50,7 +50,7 @@ module BasicData
# @return [Array<Hash>] 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

@ -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

@ -71,15 +71,6 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
</div>
</th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= Type.human_attribute_name(:in_aggregation) %>
</span>
</div>
</div>
</th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
@ -118,9 +109,6 @@ See docs/COPYRIGHT.rdoc for more details.
<%= icon_for_type(type) %>
<%=h type.name %>
</td>
<td class='center'>
<%= checked_image(type.in_aggregation) %>
</td>
<td class='center'>
<%= checked_image(type.is_in_roadmap) %>
</td>

@ -33,7 +33,6 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="form--field -wide-label"><%= f.text_field :name, required: true, disabled: @type.is_standard?, container_class: '-middle' %></div>
<div class="form--field -wide-label"><%= f.check_box :is_in_roadmap %></div>
<div class="form--field -wide-label"><%= f.select :color_id, options_for_colors(@type), container_class: '-slim' %></div>
<div class="form--field -wide-label"><%= f.check_box :in_aggregation %></div>
<div class="form--field -wide-label"><%= f.check_box :is_default, label: t(:label_type_default_new_projects) %></div>
<div class="form--field -wide-label"><%= f.check_box :is_milestone %></div>

@ -87,16 +87,6 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
</div>
</th>
<th title="<%=
t('timelines.work_packages_are_displayed_in_aggregations') %>">
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= Type.human_attribute_name(:in_aggregation) %>
</span>
</div>
</div>
</th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
@ -140,9 +130,6 @@ See docs/COPYRIGHT.rdoc for more details.
<td class="timelines-pet-is_default">
<%= checked_image(type.is_default) %>
</td>
<td class="timelines-pet-in_aggregation">
<%= checked_image(type.in_aggregation) %>
</td>
<td class="timelines-pet-is_milestone">
<%= checked_image(type.is_milestone) %>
</td>

@ -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"

@ -0,0 +1,5 @@
class RemoveInAggregationFromType < ActiveRecord::Migration[5.1]
def change
remove_column :types, :in_aggregation, :boolean, default: true, null: false
end
end

@ -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

@ -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),

Loading…
Cancel
Save