Skip to content

Use statistics cards in storage usage quota

Ammar Alakkad requested to merge aalakkad/use-statistics-cards-in-storage into master

What does this MR do and why?

It re-introduce !79525 (merged) after being reverted, adjusting the behavior when storage limit isn't set and keeping the change behind a feature flag.

It uses the StatisticsCard component added in !80261 (merged) in usage_quota storage app (group's usage quota > storage).

Screenshots

no purchase with purchase
within limit Screen_Shot_2022-04-22_at_19.06.34 Screen_Shot_2022-04-22_at_19.06.44
excess storage Screen_Shot_2022-04-22_at_19.07.12 Screen_Shot_2022-04-22_at_19.07.25

How to set up and validate locally

Enable feature flag

In rails console run to use the new design:

Feature.enable(:update_storage_usage_design)

Add dummy storage data

  1. create a new group
  2. create a project inside the new group (choose a template or keep the README.md file to use storage)
  3. from rails console run:
  • n = Group.find_by(name: "GROUP_NAME_HERE")
  • to add purchased storage run: n.additional_purchased_storage_size = 1 followed by n.save!
  • to add storage limit run: n.additional_purchased_storage_size = 1 followed by n.save!
  1. to add more storage to a project:
  • p = Project.find_by(name: "PROJECT_NAME_HERE")
  • p.statistics.update!(repository_size: 3145600)

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 #350646 (closed)

Edited by Ammar Alakkad

Merge request reports