feat(usage): show when an organisation is over its plan limit - #8432
Draft
talissoncosta wants to merge 8 commits into
Draft
feat(usage): show when an organisation is over its plan limit#8432talissoncosta wants to merge 8 commits into
talissoncosta wants to merge 8 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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>
talissoncosta
force-pushed
the
feat/usage-over-limit-8187
branch
from
September 1, 2026 18:59
fb8ef44 to
c5f44a2
Compare
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>
talissoncosta
force-pushed
the
feat/usage-over-limit-8187
branch
from
September 1, 2026 19:05
c5f44a2 to
fc3734e
Compare
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:PaidOverTheLimitandEnterpriseOverTheLimitshow the banner with and without the charge line.For the route, set
block_access_to_adminon an organisation and check the usage page loads while every other route still shows the blocked screen.