Skip to content

Show namespace limit for product analytics usage

Elwyn Benson requested to merge 430039-show-product-analytics-usage-limits into master

What does this MR do and why?

Shows the new namespace limits for product analytics on the usage quota page.

This is hidden behind the same feature flag which the backend uses: :product_analytics_billing.

When the flag is enabled, an overview of the limit and current months usage is shown.

I took this as a good time to extract the monthly usage chart out of the group usage component into a new focused component. This allows the main group usage component to deal (mostly) with data fetching and error states.

Also a minor UX change, I moved the introductionary paragraph of text up above the new limits progress bar, rather than it being nested down in Monthly Usage.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image (feature flag disabled - unchanged)
image (loading state)
image (error state, unchanged)
image (no events)
image (with events)
image (usage add-on not purchased, limit of 0)

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Onboard a project with product analytics at Project -> Analytics Dashboards
  3. From the projects root group, view usage quota at Group -> Settings -> Usage Quota -> Product analytics (use Maintainer or above user)
  4. Verify the new limits / overview does not display
  5. echo "Feature.enable(:product_analytics_billing)" | gdk rails c
  6. Verify the new limits / overview displays, with 0 limit
  7. Purchase a product analytics usage add-on - see instructions on backend MR
  8. Verify limits / overview reflects correct percent used

Related to #430039

Edited by Elwyn Benson

Merge request reports