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

[#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.erb
index 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 do
flex_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")
+ end
end
- 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")
+ end
end
end
- 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:)) }
+ end
end
end
end
diff --git a/config/initializers/feature_decisions.rb b/config/initializers/feature_decisions.rb
index 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.rb
index 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 do
expect(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 } do
before do
OAuthApplicationsSeeder.new.seed_data!
end