Skip to content

feat(usage): show when an organisation is over its plan limit - #8432

Draft
talissoncosta wants to merge 8 commits into
mainfrom
feat/usage-over-limit-8187
Draft

feat(usage): show when an organisation is over its plan limit#8432
talissoncosta wants to merge 8 commits into
mainfrom
feat/usage-over-limit-8187

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Changes

Part of #8187.

A restricted organisation can now open the usage page. It was blocked from every route except the organisations list, so the page that explains the restriction was the one page it could not reach.

An organisation over its limit gets a banner and a line under the meter saying how far over it is. The date it crossed comes from usage the page already loads, so nothing new is fetched.

Charges are only mentioned to plans that can actually be billed for an overage. Whether those are charged or covered by the grace period is #8264.

The last commits restructure the page. Worth reading separately from the feature.

Not here: the restricted state itself, and telling a free organisation it has seven days before flags stop. Both need fields the API does not return yet (#8256), so a free organisation over its limit sees the banner but not what happens next.

How did you test this code?

npm run test:unit -- --testPathPatterns="web/components/pages/usage"

Storybook, Pages/Usage Dashboard/Page: PaidOverTheLimit and EnterpriseOverTheLimit show the banner with and without the charge line.

For the route, set block_access_to_admin on an organisation and check the usage page loads while every other route still shows the blocked screen.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Sep 2, 2026 1:01pm UTC
flagsmith-frontend-staging Ready Ready Preview Sep 2, 2026 1:01pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Sep 2, 2026 1:01pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

A restricted organisation is sent to the blocked screen on every route
except the organisations list, so the one page that would explain the
restriction is the one page it cannot open.

block_access_to_admin is enforced only here. No permission, middleware
or view in the API acts on it, so the page loads its data as usual once
the route is allowed. Every other route still blocks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds the banner and the line under the meter. The day the limit was
passed is worked out from the daily rows the page already holds, so
nothing new is fetched.

Restriction only ever applies to a free plan, so a paid organisation
over its limit keeps serving flags and the page reports the overage
alone. Whether that overage is charged or covered by the grace period
is #8264, which needs the API to say so, so the wording hedges until
then.

The global quota banner is hidden on this route. It says the same
thing without the figures, so on this page it would only repeat what
the page already shows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
UsageDashboard took fifteen props, most of them forwarded one level
down, and three ReactNode slots so the page could inject the parts
that hold its state. It now owns what it actually renders: the
heading, the loading state and the error state. The page composes the
rest.

The explore section keeps its own component. It has a heading, its own
loading state and two filters, and both the page and the stories need
it, so it stays in one place rather than being spelled out twice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
UsageDashboard no longer knows what the dashboard is made of, so the
name promised something it does not do. UsagePageLayout says what it
renders: a title, and the two states where there is nothing to lay out.

The two filters move out of the page into UsageFilters, taking the
one rule in UsageDashboardPage.scss with them, which leaves that
stylesheet empty.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Overages are billed against a Chargebee billing term, so an
organisation on a rolling window can never be charged for one. The
banner was telling every paid organisation over its limit that charges
may apply, which for an invoiced enterprise account is a worry we
invented.

The rest of the banner is unchanged: they still see that they passed
the limit, when, and by how much.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Sep 1, 2026
@talissoncosta talissoncosta changed the title feat(usage): show when an organisation is over its plan limit feat(usage): show a paid organisation that it is over its plan limit Sep 2, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Hiding it was a judgement call, not something the feature needed. The
two banners now stack on this page, which is the trade.

Only one caller is left for the route check, so it collapses into a
list of the paths a blocked organisation keeps.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The layout was exported from the barrel only so the story harness could
reach it. Stories import it from its folder like the other components,
so the module goes back to exporting the page alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@talissoncosta talissoncosta changed the title feat(usage): show a paid organisation that it is over its plan limit feat(usage): show when an organisation is over its plan limit Sep 2, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant