Skip to content

Refactor the pre-enforcement storage banner logic to `ViewComponent`

Sheldon Led requested to merge led/367382-refactor-banner-view-component into master

What does this MR do and why?

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/367382

This refactors the pre-enforcement storage banner logic to ViewComponent, a better approach instead of relying on helpers

Screenshots or screen recordings

There are no UI changes, so putting just the banner for reference

User accessing their own namespace preenforcement_banner_user_namespace
User as a project maintainer on other user's namespace preenforcement_banner_project_user_namespace
Subgroup preenforcement_banner_subgroup
Project preenforcement_banner_project
Root Group preenforcement_banner_root_namespace

How to set up and validate locally

  1. Make sure to enable these:
    1. ::Gitlab::CurrentSettings.update(enforce_namespace_storage_limit: true)
    2. ::Gitlab::CurrentSettings.update(automatic_purchased_storage_allocation: true)
    3. ::Gitlab::CurrentSettings.update(check_namespace_plan: true)
    4. ::Feature.enable(:namespace_storage_limit_show_preenforcement_banner)
    5. Make sure you're simulating SaaS
  2. Go to any free group, project, subgroup, or personal namespace
  3. The banner should be showing as before

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 Sheldon Led

Merge request reports