Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

remove duration from form configuration

ulfertsf6ff373947bd
diff --git a/app/models/type/attributes.rb b/app/models/type/attributes.rb
index 6156efb9707..4387cd7175a 100644
--- a/app/models/type/attributes.rb
+++ b/app/models/type/attributes.rb
@@ -32,13 +32,15 @@ module Type::Attributes
EXCLUDED = %w[_type
_dependencies
attribute_groups
- links parent_id
+ links
+ parent_id
parent
description
schedule_manually
derived_start_date
derived_due_date
- derived_estimated_time].freeze
+ derived_estimated_time
+ duration].freeze
included do
# Allow plugins to define constraints
diff --git a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb
index ff36ecf4216..a7994a6077d 100644
--- a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb
+++ b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb
@@ -123,12 +123,6 @@ module API
writable: false,
show_if: ->(*) { !represented.milestone? && OpenProject::FeatureDecisions.work_packages_duration_field_active? }
- # TODO: Remove this, once the duration feature is complete
- # This enables hiding the duration field on the form_configuration
- ::Type.add_constraint :duration, ->(*) {
- OpenProject::FeatureDecisions.work_packages_duration_field_active?
- }
-
schema :schedule_manually,
type: 'Boolean',
required: false,
diff --git a/spec/models/type_spec.rb b/spec/models/type_spec.rb
index 45fb9fca9da..25957d87724 100644
--- a/spec/models/type_spec.rb
+++ b/spec/models/type_spec.rb
@@ -119,8 +119,8 @@ describe ::Type, type: :model do
.and_return(true)
end
- it 'returns the duration field' do
- expect(subject).to have_key("duration")
+ it 'does not return the duration field' do
+ expect(subject).not_to have_key("duration")
end
context 'when the feature flag is off' do