Skip to content

fix(dashboard): show organization status strip and billing state - #5370

Merged
Rui-V-Almeida merged 6 commits into
mainfrom
rui/subscription-warnings
Nov 20, 2026
Merged

Rui-V-Almeida merged 6 commits into
mainfrom
rui/subscription-warnings

Conversation

@Rui-V-Almeida

@Rui-V-Almeida Rui-V-Almeida commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • No breaking changes
  • Tests pass
  • New features have new tests
  • Documentation is updated (if applicable)
  • Title of the PR is in the correct format

🤖 Generated with Claude Code

Goal

Organizations that are over their usage limit, cancelled, disabled or locked used to show a large red banner inside the page content of organization and project pages only. The banner had no clear next step, cancelled organizations still looked like they were on an active plan, and the billing page showed a plan price, an $N/A estimate and raw backend errors for subscriptions with no upcoming invoice. This branch adds a thin status strip across the top of the whole dashboard with a link to the next step (billing, upgrade options or a support ticket), keeps sending members of disabled or locked organizations to the billing page, labels cancelled organizations as Cancelled in the plan badge, and makes the billing page (plan, estimate and billing details) reflect the organization status.

Type: Bug fix

Changes

  • Status strip: OrgStatusStrip renders in AppLayout above the header, so it spans the full app width on every page with a current organization. It reads useCurrentOrg() and switches on org.status. AllowanceExceeded links admins to /orgs/<slug>/billing?openUpgradeModal=true (non admins get no link). Cancelled links to SUPPORT_TICKET_URL in a new tab. Disabled and Locked link to the billing page, except when the router pathname already is /orgs/[orgSlug]/billing. The strip is a labelled section with an inner role="status" element.
  • Redirect split out: The old OrgStatus component (banner plus redirect) is deleted. Its redirect lives on as OrgStatusRedirect, which renders nothing and is mounted inside OrganizationScope and ProjectScope. The effect now depends on pathname, status and slug, skips the billing page, and runs again on every navigation, so a disabled or locked organization is sent back to billing whenever a member leaves it.
  • Cancelled plan badge: OrganizationPlanBadge takes an optional status and shows a destructive Cancelled label instead of the plan name. Its callers (header label, combobox, mobile navigation sheet, transfer project form) pass the status. getOrganizations.gql now selects status (with regenerated types), and the local dashboard organization defaults to Ok.
  • Billing page for cancelled subscriptions: SubscriptionPlan replaces the plan name and price with a destructive alert linking to support, hides the Upgrade button and keeps the upgrade dialog closed. BillingEstimate hides the billing cycle and spending notifications. Estimate shows No upcoming invoice with an explanation instead of $N/A. BillingDetails renders nothing when a cancelled organization has no invoice or the invoice query fails.
  • Billing details errors: For other statuses, a failed next invoice query shows a generic message with a support link and a Try again button instead of the raw backend message. Retry calls refetch with notifyOnNetworkStatusChange, and a refetch keeps the alert on screen instead of the full spinner. A null invoice shows No upcoming invoice details are available. BillingDetails now owns its leading separator, so it adds none when it renders nothing. The support URL is shared through the new SUPPORT_TICKET_URL constant.
  • Tests: New tests cover the plan badge, SubscriptionPlan, BillingEstimate and OrgStatusRedirect per status. BillingDetails tests cover the friendly error, retry and null invoice. The scope layout tests assert the strip sits above the header outside <main>, the support link, the billing redirect and the hidden billing link on the billing page.

Key files

  • dashboard/src/features/orgs/components/OrgStatus/ (+221/-96): status strip, redirect, its tests and exports.
  • dashboard/src/components/layout/AppLayout/AppLayout.tsx (+6/-3): mounts the strip above the header.
  • dashboard/src/features/orgs/guards/{OrganizationScope,ProjectScope}/ (+91/-26): mount the redirect; layout and strip tests.
  • dashboard/src/components/layout/Header/ and TransferProjectForm.tsx (+62/-6): Cancelled badge and its callers.
  • dashboard/src/features/orgs/components/billing/ (+443/-95): plan, estimate and billing details per status, with tests.
  • getOrganizations.gql, generated graphql.ts, local-dashboard/index.ts, utils/constants/common/common.ts (+14/-2): status field, local default and support URL.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Deployment Info - dashboard

@Rui-V-Almeida Rui-V-Almeida changed the title fix(dashboard): subscription warnings fix(dashboard): show organization status strip and billing state Nov 13, 2026
@Rui-V-Almeida Rui-V-Almeida self-assigned this Nov 13, 2026
@PVUL

PVUL commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Can you add a screenshot of the changes?

@Rui-V-Almeida

Copy link
Copy Markdown
Member Author

Can you add a screenshot of the changes?
Sure, here it is:

screencapture-localhost-3000-orgs-pukhhsjkjjdsoxtxlecr-billing-2026-11-16-15_14_02 screencapture-localhost-3000-orgs-pukhhsjkjjdsoxtxlecr-projects-2026-11-16-15_13_52

@Rui-V-Almeida Rui-V-Almeida reopened this Nov 16, 2026
@PVUL
PVUL self-requested a review November 19, 2026 12:22
@Rui-V-Almeida
Rui-V-Almeida marked this pull request as draft November 19, 2026 16:18
@Rui-V-Almeida
Rui-V-Almeida marked this pull request as ready for review November 19, 2026 17:29
@Rui-V-Almeida
Rui-V-Almeida requested a review from PVUL November 19, 2026 18:02
@robertkasza
robertkasza self-requested a review November 20, 2026 08:44
@Rui-V-Almeida
Rui-V-Almeida merged commit 39adfae into main Nov 20, 2026
10 checks passed
@Rui-V-Almeida
Rui-V-Almeida deleted the rui/subscription-warnings branch November 20, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants