Skip to content

Commit

Permalink
Merge pull request #17390 from opf/feature/59864-remove-feature-flag-…
Browse files Browse the repository at this point in the history
…custom_field_of_type_hierarchy

[#59864] remove feature flag
  • Loading branch information
Kharonus authored Dec 9, 2024
2 parents 6416d89 + 9fc0885 commit 7f84758
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
5 changes: 0 additions & 5 deletions app/helpers/custom_fields_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,9 @@ def format_value(value, custom_field)

# Return an array of custom field formats which can be used in select_tag
def custom_field_formats_for_select(custom_field)
hierarchy_if_deactivated = lambda do |format|
format.name == "hierarchy" && !OpenProject::FeatureDecisions.custom_field_of_type_hierarchy_active?
end

OpenProject::CustomFieldFormat.all_for_field(custom_field)
.sort_by(&:order)
.reject { |format| format.label.nil? }
.reject(&hierarchy_if_deactivated)
.map do |custom_field_format|
[label_for_custom_field_format(custom_field_format.name), custom_field_format.name]
end
Expand Down
3 changes: 0 additions & 3 deletions config/initializers/feature_decisions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
description: "Allows to generate a PDF document from a work package description. " \
"See #45896 for details."

OpenProject::FeatureDecisions.add :custom_field_of_type_hierarchy,
description: "Allows the use of the custom field type 'Hierarchy'."

# TODO: Remove once the feature flag primerized_work_package_activities is removed altogether
OpenProject::FeatureDecisions.define_singleton_method(:primerized_work_package_activities_active?) do
Rails.env.production? ||
Expand Down
3 changes: 1 addition & 2 deletions spec/features/custom_fields/hierarchy_custom_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
allow(EnterpriseToken).to receive(:allows_to?).and_return(true)
end

it "lets you create, update and delete a custom field of type hierarchy",
with_flag: { custom_field_of_type_hierarchy: true } do
it "lets you create, update and delete a custom field of type hierarchy" do
login_as admin

# region CustomField creation
Expand Down

0 comments on commit 7f84758

Please sign in to comment.