pull/7115/head
parent
a2d66aef07
commit
f96721558a
@ -0,0 +1,41 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module BimSeeder |
||||
module BasicData |
||||
class BimActivitySeeder < ::BasicData::ActivitySeeder |
||||
def data |
||||
[ |
||||
{ name: I18n.t(:default_activity_management), position: 1, is_default: true }, |
||||
{ name: I18n.t(:default_activity_specification), position: 2, is_default: false }, |
||||
{ name: I18n.t(:default_activity_other), position: 3, is_default: false } |
||||
] |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,96 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module BimSeeder |
||||
module BasicData |
||||
class BimStatusSeeder < ::BasicData::StatusSeeder |
||||
def data |
||||
color_names = [ |
||||
'teal-1', # new |
||||
'indigo-1', # in specification |
||||
'teal-3', # specified |
||||
'red-6', # confirmed |
||||
'yellow-2', # tbs |
||||
'lime-2', # scheduled |
||||
'cyan-3', # in progress |
||||
'cyan-3', # in development |
||||
'teal-6', # developed |
||||
'teal-7', # in testing |
||||
'teal-9', # tested |
||||
'red-9', # test_failed |
||||
'gray-3', # closed |
||||
'orange-3', # on hold |
||||
'red-3', # rejected |
||||
] |
||||
|
||||
# When selecting for an array of values, implicit order is applied |
||||
# so we need to restore values by their name. |
||||
colors_by_name = Color.where(name: color_names).index_by(&:name) |
||||
colors = color_names.collect { |name| colors_by_name[name].id } |
||||
|
||||
if OpenProject::Configuration['edition'] == 'bim' |
||||
[ |
||||
{ name: I18n.t(:default_status_new), color_id: colors[0], is_closed: false, is_default: true, position: 1 }, |
||||
{ name: I18n.t(:default_status_in_specification), color_id: colors[1], is_closed: false, is_default: false, position: 2 }, |
||||
{ name: I18n.t(:default_status_specified), color_id: colors[2], is_closed: false, is_default: false, position: 3 }, |
||||
{ name: I18n.t(:default_status_confirmed), color_id: colors[3], is_closed: false, is_default: false, position: 4 }, |
||||
{ name: I18n.t(:default_status_to_be_scheduled), color_id: colors[4], is_closed: false, is_default: false, position: 5 }, |
||||
{ name: I18n.t(:default_status_scheduled), color_id: colors[5], is_closed: false, is_default: false, position: 6 }, |
||||
{ name: I18n.t(:default_status_in_progress), color_id: colors[6], is_closed: false, is_default: false, position: 7 }, |
||||
{ name: I18n.t(:default_status_in_development), color_id: colors[7], is_closed: false, is_default: false, position: 8 }, |
||||
{ name: I18n.t(:default_status_developed), color_id: colors[8], is_closed: false, is_default: false, position: 9 }, |
||||
{ name: I18n.t(:default_status_in_testing), color_id: colors[9], is_closed: false, is_default: false, position: 10 }, |
||||
{ name: I18n.t(:default_status_tested), color_id: colors[10], is_closed: false, is_default: false, position: 11 }, |
||||
{ name: I18n.t(:default_status_test_failed), color_id: colors[11], is_closed: false, is_default: false, position: 12 }, |
||||
{ name: I18n.t(:default_status_closed), color_id: colors[12], is_closed: true, is_default: false, position: 13 }, |
||||
{ name: I18n.t(:default_status_on_hold), color_id: colors[13], is_closed: false, is_default: false, position: 14 }, |
||||
{ name: I18n.t(:default_status_rejected), color_id: colors[14], is_closed: true, is_default: false, position: 15 } |
||||
] |
||||
else |
||||
[ |
||||
{ name: I18n.t(:default_status_new), color_id: colors[0], is_closed: false, is_default: true, position: 1 }, |
||||
{ name: I18n.t(:default_status_in_specification), color_id: colors[1], is_closed: false, is_default: false, position: 2 }, |
||||
{ name: I18n.t(:default_status_specified), color_id: colors[2], is_closed: false, is_default: false, position: 3 }, |
||||
{ name: I18n.t(:default_status_confirmed), color_id: colors[3], is_closed: false, is_default: false, position: 4 }, |
||||
{ name: I18n.t(:default_status_to_be_scheduled), color_id: colors[4], is_closed: false, is_default: false, position: 5 }, |
||||
{ name: I18n.t(:default_status_scheduled), color_id: colors[5], is_closed: false, is_default: false, position: 6 }, |
||||
{ name: I18n.t(:default_status_in_progress), color_id: colors[6], is_closed: false, is_default: false, position: 7 }, |
||||
{ name: I18n.t(:default_status_in_development), color_id: colors[7], is_closed: false, is_default: false, position: 8 }, |
||||
{ name: I18n.t(:default_status_developed), color_id: colors[8], is_closed: false, is_default: false, position: 9 }, |
||||
{ name: I18n.t(:default_status_in_testing), color_id: colors[9], is_closed: false, is_default: false, position: 10 }, |
||||
{ name: I18n.t(:default_status_tested), color_id: colors[10], is_closed: false, is_default: false, position: 11 }, |
||||
{ name: I18n.t(:default_status_test_failed), color_id: colors[11], is_closed: false, is_default: false, position: 12 }, |
||||
{ name: I18n.t(:default_status_closed), color_id: colors[12], is_closed: true, is_default: false, position: 13 }, |
||||
{ name: I18n.t(:default_status_on_hold), color_id: colors[13], is_closed: false, is_default: false, position: 14 }, |
||||
{ name: I18n.t(:default_status_rejected), color_id: colors[14], is_closed: true, is_default: false, position: 15 } |
||||
] |
||||
end |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,44 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module BimSeeder |
||||
module BasicData |
||||
class BimTypeSeeder < ::BasicData::TypeSeeder |
||||
def type_table |
||||
{ # position is_default color_id is_in_roadmap is_milestone |
||||
task: [1, true, :default_color_blue, true, false, :default_type_task], |
||||
milestone: [2, true, :default_color_green_light, false, true, :default_type_milestone], |
||||
phase: [3, true, :default_color_blue_dark, false, false, :default_type_phase], |
||||
building_model: [4, true, :default_color_blue, true, false, 'seeders.bim.default_type_building_model'], |
||||
defect: [5, true, :default_color_red, true, false, 'seeders.bim.default_type_defect'], |
||||
approval: [6, true, :default_color_grey_dark, true, false, 'seeders.bim.default_type_approval'] |
||||
} |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,71 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module BimSeeder |
||||
module BasicData |
||||
class BimWorkflowSeeder < ::BasicData::WorkflowSeeder |
||||
def workflows |
||||
types = Type.all |
||||
types = types.map { |t| { t.name => t.id } }.reduce({}, :merge) |
||||
|
||||
new = Status.find_by(name: I18n.t(:default_status_new)) |
||||
in_specification = Status.find_by(name: I18n.t(:default_status_in_specification)) |
||||
specified = Status.find_by(name: I18n.t(:default_status_specified)) |
||||
confirmed = Status.find_by(name: I18n.t(:default_status_confirmed)) |
||||
to_be_scheduled = Status.find_by(name: I18n.t(:default_status_to_be_scheduled)) |
||||
scheduled = Status.find_by(name: I18n.t(:default_status_scheduled)) |
||||
in_progress = Status.find_by(name: I18n.t(:default_status_in_progress)) |
||||
in_development = Status.find_by(name: I18n.t(:default_status_in_development)) |
||||
developed = Status.find_by(name: I18n.t(:default_status_developed)) |
||||
in_testing = Status.find_by(name: I18n.t(:default_status_in_testing)) |
||||
tested = Status.find_by(name: I18n.t(:default_status_tested)) |
||||
test_failed = Status.find_by(name: I18n.t(:default_status_test_failed)) |
||||
closed = Status.find_by(name: I18n.t(:default_status_closed)) |
||||
on_hold = Status.find_by(name: I18n.t(:default_status_on_hold)) |
||||
rejected = Status.find_by(name: I18n.t(:default_status_rejected)) |
||||
|
||||
{ |
||||
types[I18n.t(:default_type_task)] => [new, in_progress, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_milestone)] => [new, to_be_scheduled, scheduled, in_progress, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_phase)] => [new, to_be_scheduled, scheduled, in_progress, on_hold, rejected, closed], |
||||
types[I18n.t('seeders.bim.default_type_building_model')] => [new, in_specification, specified, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed], |
||||
types[I18n.t('seeders.bim.default_type_defect')] => [new, in_specification, specified, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed], |
||||
types[I18n.t('seeders.bim.default_type_approval')] => [new, in_specification, specified, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed], |
||||
} |
||||
end |
||||
|
||||
def type_seeder_class |
||||
::BimSeeder::BasicData::BimTypeSeeder |
||||
end |
||||
|
||||
def status_seeder_class |
||||
::BimSeeder::BasicData::BimStatusSeeder |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,44 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module BimSeeder |
||||
class BimBasicDataSeeder < ::BasicDataSeeder |
||||
def data_seeder_classes |
||||
[ |
||||
::BasicData::BuiltinRolesSeeder, |
||||
::BasicData::RoleSeeder, |
||||
::BimSeeder::BasicData::BimActivitySeeder, |
||||
::BasicData::ColorSeeder, |
||||
::BasicData::ColorSchemeSeeder, |
||||
::BimSeeder::BasicData::BimWorkflowSeeder, |
||||
::BasicData::PrioritySeeder, |
||||
::BasicData::SettingSeeder |
||||
] |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,44 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module StandardSeeder |
||||
module BasicData |
||||
class StandardActivitySeeder < ::BasicData::ActivitySeeder |
||||
def data |
||||
[ |
||||
{ name: I18n.t(:default_activity_management), position: 1, is_default: true }, |
||||
{ name: I18n.t(:default_activity_specification), position: 2, is_default: false }, |
||||
{ name: I18n.t(:default_activity_development), position: 3, is_default: false }, |
||||
{ name: I18n.t(:default_activity_testing), position: 4, is_default: false }, |
||||
{ name: I18n.t(:default_activity_support), position: 5, is_default: false }, |
||||
{ name: I18n.t(:default_activity_other), position: 6, is_default: false } |
||||
] |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,76 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module StandardSeeder |
||||
module BasicData |
||||
class StandardStatusSeeder < ::BasicData::StatusSeeder |
||||
def data |
||||
color_names = [ |
||||
'teal-1', # new |
||||
'indigo-1', # in specification |
||||
'teal-3', # specified |
||||
'red-6', # confirmed |
||||
'yellow-2', # tbs |
||||
'lime-2', # scheduled |
||||
'cyan-3', # in progress |
||||
'cyan-3', # in development |
||||
'teal-6', # developed |
||||
'teal-7', # in testing |
||||
'teal-9', # tested |
||||
'red-9', # test_failed |
||||
'gray-3', # closed |
||||
'orange-3', # on hold |
||||
'red-3', # rejected |
||||
] |
||||
|
||||
# When selecting for an array of values, implicit order is applied |
||||
# so we need to restore values by their name. |
||||
colors_by_name = Color.where(name: color_names).index_by(&:name) |
||||
colors = color_names.collect { |name| colors_by_name[name].id } |
||||
|
||||
[ |
||||
{ name: I18n.t(:default_status_new), color_id: colors[0], is_closed: false, is_default: true, position: 1 }, |
||||
{ name: I18n.t(:default_status_in_specification), color_id: colors[1], is_closed: false, is_default: false, position: 2 }, |
||||
{ name: I18n.t(:default_status_specified), color_id: colors[2], is_closed: false, is_default: false, position: 3 }, |
||||
{ name: I18n.t(:default_status_confirmed), color_id: colors[3], is_closed: false, is_default: false, position: 4 }, |
||||
{ name: I18n.t(:default_status_to_be_scheduled), color_id: colors[4], is_closed: false, is_default: false, position: 5 }, |
||||
{ name: I18n.t(:default_status_scheduled), color_id: colors[5], is_closed: false, is_default: false, position: 6 }, |
||||
{ name: I18n.t(:default_status_in_progress), color_id: colors[6], is_closed: false, is_default: false, position: 7 }, |
||||
{ name: I18n.t(:default_status_in_development), color_id: colors[7], is_closed: false, is_default: false, position: 8 }, |
||||
{ name: I18n.t(:default_status_developed), color_id: colors[8], is_closed: false, is_default: false, position: 9 }, |
||||
{ name: I18n.t(:default_status_in_testing), color_id: colors[9], is_closed: false, is_default: false, position: 10 }, |
||||
{ name: I18n.t(:default_status_tested), color_id: colors[10], is_closed: false, is_default: false, position: 11 }, |
||||
{ name: I18n.t(:default_status_test_failed), color_id: colors[11], is_closed: false, is_default: false, position: 12 }, |
||||
{ name: I18n.t(:default_status_closed), color_id: colors[12], is_closed: true, is_default: false, position: 13 }, |
||||
{ name: I18n.t(:default_status_on_hold), color_id: colors[13], is_closed: false, is_default: false, position: 14 }, |
||||
{ name: I18n.t(:default_status_rejected), color_id: colors[14], is_closed: true, is_default: false, position: 15 } |
||||
] |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,45 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module StandardSeeder |
||||
module BasicData |
||||
class StandardTypeSeeder < ::BasicData::TypeSeeder |
||||
def type_table |
||||
{ # position is_default color_id is_in_roadmap is_milestone |
||||
task: [1, true, :default_color_blue, true, false, :default_type_task], |
||||
milestone: [2, true, :default_color_green_light, false, true, :default_type_milestone], |
||||
phase: [3, true, :default_color_blue_dark, false, false, :default_type_phase], |
||||
feature: [4, true, :default_color_blue, true, false, :default_type_feature], |
||||
epic: [5, true, :default_color_orange, true, false, :default_type_epic], |
||||
user_story: [6, true, :default_color_grey_dark, true, false, :default_type_user_story], |
||||
bug: [7, true, :default_color_red, true, false, :default_type_bug] |
||||
} |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,72 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module StandardSeeder |
||||
module BasicData |
||||
class StandardWorkflowSeeder < ::BasicData::WorkflowSeeder |
||||
def workflows |
||||
types = Type.all |
||||
types = types.map { |t| { t.name => t.id } }.reduce({}, :merge) |
||||
|
||||
new = Status.find_by(name: I18n.t(:default_status_new)) |
||||
in_specification = Status.find_by(name: I18n.t(:default_status_in_specification)) |
||||
specified = Status.find_by(name: I18n.t(:default_status_specified)) |
||||
confirmed = Status.find_by(name: I18n.t(:default_status_confirmed)) |
||||
to_be_scheduled = Status.find_by(name: I18n.t(:default_status_to_be_scheduled)) |
||||
scheduled = Status.find_by(name: I18n.t(:default_status_scheduled)) |
||||
in_progress = Status.find_by(name: I18n.t(:default_status_in_progress)) |
||||
in_development = Status.find_by(name: I18n.t(:default_status_in_development)) |
||||
developed = Status.find_by(name: I18n.t(:default_status_developed)) |
||||
in_testing = Status.find_by(name: I18n.t(:default_status_in_testing)) |
||||
tested = Status.find_by(name: I18n.t(:default_status_tested)) |
||||
test_failed = Status.find_by(name: I18n.t(:default_status_test_failed)) |
||||
closed = Status.find_by(name: I18n.t(:default_status_closed)) |
||||
on_hold = Status.find_by(name: I18n.t(:default_status_on_hold)) |
||||
rejected = Status.find_by(name: I18n.t(:default_status_rejected)) |
||||
|
||||
{ |
||||
types[I18n.t(:default_type_task)] => [new, in_progress, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_milestone)] => [new, to_be_scheduled, scheduled, in_progress, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_phase)] => [new, to_be_scheduled, scheduled, in_progress, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_feature)] => [new, in_specification, specified, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_epic)] => [new, in_specification, specified, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_user_story)] => [new, in_specification, specified, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed], |
||||
types[I18n.t(:default_type_bug)] => [new, confirmed, in_development, developed, in_testing, tested, test_failed, on_hold, rejected, closed] |
||||
} |
||||
end |
||||
|
||||
def type_seeder_class |
||||
::StandardSeeder::BasicData::StandardTypeSeeder |
||||
end |
||||
|
||||
def status_seeder_class |
||||
::StandardSeeder::BasicData::StandardStatusSeeder |
||||
end |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,44 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See docs/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
module StandardSeeder |
||||
class StandardBasicDataSeeder < ::BasicDataSeeder |
||||
def data_seeder_classes |
||||
[ |
||||
::BasicData::BuiltinRolesSeeder, |
||||
::BasicData::RoleSeeder, |
||||
::StandardSeeder::BasicData::StandardActivitySeeder, |
||||
::BasicData::ColorSeeder, |
||||
::BasicData::ColorSchemeSeeder, |
||||
::StandardSeeder::BasicData::StandardWorkflowSeeder, |
||||
::BasicData::PrioritySeeder, |
||||
::BasicData::SettingSeeder |
||||
] |
||||
end |
||||
end |
||||
end |
@ -1,23 +1,25 @@ |
||||
module BasicData |
||||
module Backlogs |
||||
module TypeSeeder |
||||
def coded_visibility_table |
||||
super.merge backlogs_visibility_table |
||||
end |
||||
module StandardSeeder |
||||
module BasicData |
||||
module Backlogs |
||||
module TypeSeeder |
||||
def coded_visibility_table |
||||
super.merge backlogs_visibility_table |
||||
end |
||||
|
||||
## |
||||
# Relies on type names in the core TypeSeeder being (in this order) |
||||
# task, milestone, phase, feature, epic, user_story, bug |
||||
# and 0 to 2 being mapped to |
||||
# hidden, default, visible |
||||
def backlogs_visibility_table |
||||
{ |
||||
story_points: [0, 0, 0, 1, 2, 2, 1], |
||||
remaining_time: [1, 0, 0, 1, 1, 1, 1] |
||||
} |
||||
## |
||||
# Relies on type names in the core TypeSeeder being (in this order) |
||||
# task, milestone, phase, feature, epic, user_story, bug |
||||
# and 0 to 2 being mapped to |
||||
# hidden, default, visible |
||||
def backlogs_visibility_table |
||||
{ |
||||
story_points: [0, 0, 0, 1, 2, 2, 1], |
||||
remaining_time: [1, 0, 0, 1, 1, 1, 1] |
||||
} |
||||
end |
||||
end |
||||
end |
||||
|
||||
BasicData::TypeSeeder.prepend BasicData::Backlogs::TypeSeeder |
||||
StandardSeeder::BasicData::StandardTypeSeeder.prepend StandardSeeder::BasicData::Backlogs::TypeSeeder |
||||
end |
||||
end |
||||
end |
||||
|
Loading…
Reference in new issue