Skip to content

Unify storage related banners width

Ammar Alakkad requested to merge aalakkad/fix-storage-banners-width into master

What does this MR do and why?

It unifies the width and the padding of the storage related banners when the user layout is fixed.

Screenshots or screen recordings

(I had to zoom out so the window fit all the banners)

Before After
Screenshot_2023-12-13_at_15.40.20 Screenshot_2023-12-13_at_15.33.30

How to set up and validate locally

  • Set your layout to fixed in user preferences
  • Apply the patch provided below
  • Navigate to a group's usage quotas page
git patch
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 40eb1ef140a2..15760a641318 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/free_user_cap/base_alert_component.rb b/ee/app/components/namespaces/free_user_cap/base_alert_component.rb
index 3d2d50b27d9b..72a7b863646a 100644
--- a/ee/app/components/namespaces/free_user_cap/base_alert_component.rb
+++ b/ee/app/components/namespaces/free_user_cap/base_alert_component.rb
@@ -19,6 +19,7 @@ def initialize(namespace:, user:, content_class:)
       attr_reader :namespace, :user, :content_class
 
       def render?
+        return true
         return false unless ::Namespaces::FreeUserCap.owner_access?(user: user, namespace: namespace)
         return false if dismissed?
 
diff --git a/ee/app/components/namespaces/free_user_cap/non_owner_enforcement_alert_component.rb b/ee/app/components/namespaces/free_user_cap/non_owner_enforcement_alert_component.rb
index 61772b00d369..47a4e46de4e4 100644
--- a/ee/app/components/namespaces/free_user_cap/non_owner_enforcement_alert_component.rb
+++ b/ee/app/components/namespaces/free_user_cap/non_owner_enforcement_alert_component.rb
@@ -6,6 +6,7 @@ class NonOwnerEnforcementAlertComponent < EnforcementAlertComponent
       private
 
       def render?
+        return true
         return false unless ::Namespaces::FreeUserCap.non_owner_access?(user: user, namespace: namespace)
 
         breached_cap_limit?
diff --git a/ee/app/components/namespaces/storage/limit_alert_component.rb b/ee/app/components/namespaces/storage/limit_alert_component.rb
index a5a9f6655f16..3fb1d7fc3dd1 100644
--- a/ee/app/components/namespaces/storage/limit_alert_component.rb
+++ b/ee/app/components/namespaces/storage/limit_alert_component.rb
@@ -22,6 +22,7 @@ def initialize(context:, user:)
       attr_reader :context, :root_namespace, :user, :root_storage_size
 
       def render?
+        return true
         return false unless ::Gitlab::Saas.feature_available?(:namespaces_storage_limit)
         return false unless user.present?
         return false unless user_has_access?
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 308b4f126d75..b868ef251424 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)
diff --git a/ee/app/helpers/ee/namespace_user_cap_reached_alert_helper.rb b/ee/app/helpers/ee/namespace_user_cap_reached_alert_helper.rb
index 29c980f2ede7..09e88d9713ed 100644
--- a/ee/app/helpers/ee/namespace_user_cap_reached_alert_helper.rb
+++ b/ee/app/helpers/ee/namespace_user_cap_reached_alert_helper.rb
@@ -3,6 +3,7 @@
 module EE
   module NamespaceUserCapReachedAlertHelper
     def display_namespace_user_cap_reached_alert?(namespace)
+      return true
       # On pages that are not under a namespace like the group creation page,
       # we only receive a non-persisted Namespace record as default.
       return false unless namespace&.persisted?
diff --git a/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml b/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml
index 8477715b8e01..dbf6c6c548f0 100644
--- a/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml
+++ b/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml
@@ -1,4 +1,4 @@
-- return unless show_new_user_signups_cap_reached?
+-# - return unless show_new_user_signups_cap_reached?
 
 - user_cap_help_url = help_page_path('administration/settings/sign_up_restrictions')
 - help_link_start = '<a class="gl-link" href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: user_cap_help_url }

MR acceptance checklist

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

Edited by Ammar Alakkad

Merge request reports