From f5440c8a7e131bf2815e689089174383a1a7fb2c Mon Sep 17 00:00:00 2001 From: Peter Hegman Date: Tue, 30 Sep 2025 19:32:43 -0700 Subject: [PATCH] POC for protocells unsupported features --- app/controllers/application_controller.rb | 13 +++++++++++++ ...zations_protocells_unsupported_feature.html.haml | 2 ++ ...anization_protocells_unsupported_controllers.yml | 1 + 3 files changed, 16 insertions(+) create mode 100644 app/views/organizations/organizations_protocells_unsupported_feature.html.haml create mode 100644 config/organization_protocells_unsupported_controllers.yml diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5ee985045a29d6..035ecac0b5e9ee 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -29,6 +29,7 @@ class ApplicationController < BaseActionController include StrongPaginationParams include Gitlab::HttpRouter::RuleContext include Gitlab::HttpRouter::RuleMetrics + include ::Organizations::OrganizationHelper around_action :set_current_ip_address @@ -48,6 +49,7 @@ class ApplicationController < BaseActionController before_action only: :show do push_frontend_feature_flag(:duo_side_rail, current_user) end + before_action :check_organization_protocells_features # Make sure the `auth_user` is memoized so it can be logged, we do this after # all other before filters that could have set the user. @@ -550,6 +552,17 @@ def organization_params :controller, :namespace_id, :group_id, :id, :organization_path ) end + + def organization_protocells_unsupported_controllers + YAML.load_file(Rails.root.join("config/organization_protocells_unsupported_controllers.yml")) + end + strong_memoize_attr :organization_protocells_unsupported_controllers + + def check_organization_protocells_features + if ui_for_organizations_enabled? && organization_protocells_unsupported_controllers.include?(controller_name) + render 'organizations/organizations_protocells_unsupported_feature' + end + end end ApplicationController.prepend_mod diff --git a/app/views/organizations/organizations_protocells_unsupported_feature.html.haml b/app/views/organizations/organizations_protocells_unsupported_feature.html.haml new file mode 100644 index 00000000000000..cc2548a9b285d0 --- /dev/null +++ b/app/views/organizations/organizations_protocells_unsupported_feature.html.haml @@ -0,0 +1,2 @@ +%h1 + Feature not supported \ No newline at end of file diff --git a/config/organization_protocells_unsupported_controllers.yml b/config/organization_protocells_unsupported_controllers.yml new file mode 100644 index 00000000000000..43e89eff4449ed --- /dev/null +++ b/config/organization_protocells_unsupported_controllers.yml @@ -0,0 +1 @@ +- snippets \ No newline at end of file -- GitLab