Move storage alert to page level
What does this MR do and why?
It updates the storage alert to be at page-level per Pajama's guidelines.
The MR does not include a changelog because the changes are behind a disabled feature flag/settings.
Screenshots or screen recordings
before | after (fluid layout) | after (fixed layout) |
---|---|---|
How to set up and validate locally
Ensure storage alert is showing for a namespace, if not, follow the steps inside 👈
The following steps are borrowed from !92642 (merged), thanks Sheldon!
- First step is to enable the FF that toggles the type of enforcement from
repository
tonamespace
storage:Feature.enable(:namespace_storage_limit)
- This will make the repository-level storage banners (mentioned above) to stop showing
- Next we need to enable other feature flags that control other parts of this feature
Feature.enable(:namespace_storage_limit_bypass_date_check)
Feature.enable(:enforce_storage_limit_for_paid)
Feature.enable(:enforce_storage_limit_for_free)
- Let's add a limit to the free plan (
10
here means10 megabytes
):Plan.default.actual_limits.update!(storage_size_limit: 10)
Plan.free.actual_limits.update!(storage_size_limit: 10)
- If you're using the same group for all examples, let's remove the additional purchased storage:
n = Group.find(<your group id here>)
n.update(additional_purchased_storage_size: 0)
- Add namespace storage statistics
n = Group.find(<your group id here>)
n.root_storage_statistics&.destroy!
s = Namespace::RootStorageStatistics.new(
namespace: n,
build_artifacts_size: 0,
wiki_size: 0,
repository_size: 0,
packages_size: 0,
lfs_objects_size: 7864320
)
s.storage_size = s.repository_size + s.lfs_objects_size + s.wiki_size + s.build_artifacts_size + s.packages_size
s.save!
Note: some changes might take a bit, make sure to restart GDK.
- Navigate to a namespace with the storage alert visible
- If your current user layout preference is set to
fixed
, the alert should be displayed within the page container - If your current user layout preference is set to
fluid
, the alert should be displayed with full width
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 #363159
Edited by Ammar Alakkad