Skip to content

Fix pre-enforcement banner width on fixed layout

Ammar Alakkad requested to merge 371335-fix-pre-enforcement-banner-width into master

What does this MR do and why?

The banner width is smaller than intended on fixed layout. This MR will adjust its width to be aligned with other banners.

Screenshots or screen recordings

Before After
Screenshot_2023-12-06_at_17.45.26 Screenshot_2023-12-06_at_17.41.09

How to set up and validate locally

  • Make sure you have the layout set to fixes in user preferences
  • Visit a group's usage quotas page
  • Apply the patch below to show 2 banners (pre-enforcement - the one being update in this MR, and storage banner - for reference)
  • Checkout the branch and refresh the page to observe the changes
Apply the following patch

e.g. copy then pbpaste | git apply -

diff --git a/ee/app/components/namespaces/combined_storage_users/base_alert_component.rb b/ee/app/components/namespaces/combined_storage_users/base_alert_component.rb
index 801803655f4b..d59d4d79afea 100644
--- a/ee/app/components/namespaces/combined_storage_users/base_alert_component.rb
+++ b/ee/app/components/namespaces/combined_storage_users/base_alert_component.rb
@@ -20,6 +20,7 @@ def initialize(root_namespace:, user:, content_class:)
       attr_reader :root_namespace, :user, :content_class
 
       def render?
+        return true
         return false unless over_both_limits?(root_namespace)
 
         !dismissed?
diff --git a/ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb b/ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb
index 06786af559a5..8554427c9aba 100644
--- a/ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb
+++ b/ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb
@@ -16,6 +16,7 @@ def initialize(context:, user:)
       end
 
       def render?
+        return true
         return false unless user_allowed?
         return false if qualifies_for_combined_alert?
         return false unless over_storage_limit?(root_namespace)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #371335

Edited by Ammar Alakkad

Merge request reports