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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#53620] add feature flag for buit-in apps
Eric Schubertcf4c7c37fd0f
diff --git a/app/components/oauth/applications/index_component.html.erb b/app/components/oauth/applications/index_component.html.erbindex 856ff7b0b13..e5f0d0b4bee 100644--- a/app/components/oauth/applications/index_component.html.erb+++ b/app/components/oauth/applications/index_component.html.erb@@ -1,28 +1,30 @@<%=component_wrapper doflex_layout do |index_container|- index_container.with_row do- render(border_box_container(mb: 4, data: {- 'test-selector': "op-admin-oauth--built-in-applications"- })) do |component|- component.with_header(font_weight: :bold) do- render(Primer::Beta::Text.new) do- t("oauth.header.builtin_applications")+ if OpenProject::FeatureDecisions.built_in_oauth_applications_active?+ index_container.with_row do+ render(border_box_container(mb: 4, data: {+ 'test-selector': "op-admin-oauth--built-in-applications"+ })) do |component|+ component.with_header(font_weight: :bold) do+ render(Primer::Beta::Text.new) do+ t("oauth.header.builtin_applications")+ endend- end- if @built_in_applications.empty?- component.with_row do- render(Primer::Beta::Text.new(data: {- 'test-selector': "op-admin-oauth--built-in-applications-placeholder"- })) do- t("oauth.empty_application_lists")+ if @built_in_applications.empty?+ component.with_row do+ render(Primer::Beta::Text.new(data: {+ 'test-selector': "op-admin-oauth--built-in-applications-placeholder"+ })) do+ t("oauth.empty_application_lists")+ endendend- end- @built_in_applications.each do |application|- component.with_row { render(OAuth::Applications::ApplicationRowComponent.new(application:)) }+ @built_in_applications.each do |application|+ component.with_row { render(OAuth::Applications::ApplicationRowComponent.new(application:)) }+ endendendenddiff --git a/config/initializers/feature_decisions.rb b/config/initializers/feature_decisions.rbindex dea98a89d88..7531b794408 100644--- a/config/initializers/feature_decisions.rb+++ b/config/initializers/feature_decisions.rb@@ -50,3 +50,6 @@ OpenProject::FeatureDecisions.add :meeting_updated_notification,OpenProject::FeatureDecisions.add :enable_custom_field_for_multiple_projects,description: "Allow a custom field to be enabled for multiple projects at once. " \"See work package #56909 for more details."++OpenProject::FeatureDecisions.add :built_in_oauth_applications,+ description: "Allows the display and use of built-in OAuth applications."diff --git a/spec/features/admin/oauth/oauth_applications_management_spec.rb b/spec/features/admin/oauth/oauth_applications_management_spec.rbindex faaab28a488..fd7c4bbbb1c 100644--- a/spec/features/admin/oauth/oauth_applications_management_spec.rb+++ b/spec/features/admin/oauth/oauth_applications_management_spec.rb@@ -93,7 +93,7 @@ RSpec.describe "OAuth applications management", :js, :with_cuprite doexpect(page).to have_test_selector("op-admin-oauth--applications-placeholder")end- context "with a seeded application" do+ context "with a seeded application", with_flag: { built_in_oauth_applications: true } dobefore doOAuthApplicationsSeeder.new.seed_data!end