Skip to content

Commit

Permalink
[#53620] add feature flag for buit-in apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Kharonus committed Sep 13, 2024
1 parent 820c4ab commit c40f870
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
36 changes: 19 additions & 17 deletions app/components/oauth/applications/index_component.html.erb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/feature_decisions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@
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."

0 comments on commit c40f870

Please sign in to comment.