Update storage banner to include offer details
What does this MR do and why?
It updates the enforcement banner for free namespaces to include an offer details, as described in #420779.
The appended text is show to owners only.
Screenshots or screen recordings
What | Before | After |
---|---|---|
Combined banner | ![]() |
![]() |
Pre-enforcement banner | ![]() |
![]() |
How to set up and validate locally
To test combined banner changes
Apply this patch (e.g. copy then run pbpaste | git apply -
)
diff --git a/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb b/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb
index ac030b4c9fd9..0c88e359ac4a 100644
--- a/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb
+++ b/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb
@@ -6,6 +6,7 @@ class OwnerAlertComponent < BaseAlertComponent
private
def render?
+ return true
return false unless Ability.allowed?(user, :owner_access, root_namespace)
super
- Go to a group where you have owner role
- Observe the banner at the top of the page
To test pre-enforcement banners
Checkout any old patches git checkout -- .
, then apply this patch (e.g. copy then run pbpaste | git apply -
)
diff --git a/ee/app/models/namespaces/storage/enforcement.rb b/ee/app/models/namespaces/storage/enforcement.rb
index 59217346bf4f..f5db502fc0b1 100644
--- a/ee/app/models/namespaces/storage/enforcement.rb
+++ b/ee/app/models/namespaces/storage/enforcement.rb
@@ -15,6 +15,7 @@ def enforce_limit?(namespace)
end
def show_pre_enforcement_alert?(namespace)
+ return true
root_namespace = namespace.root_ancestor
return false unless in_pre_enforcement_phase?(root_namespace)
There are four types of banners:
- for a group (
/groups/h5bp/-/usage_quotas#storage-quota-tab
) - a subgroup (
/gitlab-org/subgroup
) - a project (
/gitlab-org/subgroup/test
) - and a user namespace (
/-/profile/usage_quotas#storage-quota-tab
)
- Visit relevant page
- Observe the banner at the top of the page
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #420779
Edited by Kos Palchyk