Skip to content

fix(dashboard): welcome the tenant by its name on the overview - #1437

Open
marcelo-maciel wants to merge 1 commit into
fullstackhero:mainfrom
marcelo-maciel:fix/overview-welcome-tenant-name
Open

marcelo-maciel wants to merge 1 commit into
fullstackhero:mainfrom
marcelo-maciel:fix/overview-welcome-tenant-name

Conversation

@marcelo-maciel

Copy link
Copy Markdown
Contributor

Fixes #1436

What changes

The dashboard overview labelled the tenant with user?.tenant, the JWT tenant claim, which is the identifier. A tenant with no subscription saw "Welcome to qpb2edshbj" on the first-run card instead of its name, and the header caption ({date} · {tenant}) showed the same identifier.

The label now reads status.data?.name from the GET /api/v1/tenants/me/status query the page already runs for the "Valid for" card. That query shares its key with the AppShell expiry banner, so it is normally warm when the overview mounts. While the status is loading or failed, the label falls back to the identifier as before, then to "your tenant". No backend change and no new request.

Both uses read the same tenantLabel variable, so the caption is fixed with the greeting. The identifier is still shown in the top bar's profile menu and in the impersonation banner; those are left as they are.

Tests

New Playwright spec in tests/overview/overview.spec.ts: no subscription (first-run card), status mock names tenant acme "Acme Corp"; asserts the heading is "Welcome to Acme Corp" and that no "Welcome to acme" heading exists.

  • With the fix reverted: npx playwright test tests/overview/overview.spec.ts → 1 failed (the new spec, heading rendered "Welcome to acme"), 11 passed.
  • With the fix: 12 passed.
  • npx tsc -b --noEmit → exit 0; npm run lint → 0 errors (12 pre-existing warnings, none in the touched files).
  • Full dashboard suite: 159 passed, 5 failed on a 5 s expect timeout while a lazy route compiled for the first time on a cold Vite server (catalog, audits, impersonation-ended); those three specs re-run alone: 18 passed.

Rebase note

The dashboard i18n PR #1384 rewrites overview.tsx into translation keys. Whichever of the two merges second needs a one-line rebase on the tenantLabel line.

The first-run heading and the header caption used the JWT tenant claim, which is the identifier. Read the name from the tenant status query the page already runs, falling back to the identifier while it is unavailable.

Fixes fullstackhero#1436
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-14T21:30:42.855359Z 74e3663 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

Dashboard overview welcomes the tenant by its identifier instead of its name

1 participant