-
Notifications
You must be signed in to change notification settings - Fork 490
feat: show subscription tier below name on cloud #7356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,23 @@ const mockSubscriptionTier = ref< | |
| 'STANDARD' | 'CREATOR' | 'PRO' | 'FOUNDERS_EDITION' | null | ||
| >('CREATOR') | ||
|
|
||
| const TIER_TO_NAME: Record<string, string> = { | ||
| STANDARD: 'Standard', | ||
| CREATOR: 'Creator', | ||
| PRO: 'Pro', | ||
| FOUNDERS_EDITION: "Founder's Edition" | ||
| } | ||
|
Comment on lines
+16
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Tier→name mapping and mocked The If you want to tighten things a bit, you could narrow the key type (e.g., to the literal union used for Also applies to: 30-32 🤖 Prompt for AI Agents |
||
|
|
||
| // Mock composables - using computed to match composable return types | ||
| const mockSubscriptionData = { | ||
| isActiveSubscription: computed(() => mockIsActiveSubscription.value), | ||
| isCancelled: computed(() => mockIsCancelled.value), | ||
| formattedRenewalDate: computed(() => '2024-12-31'), | ||
| formattedEndDate: computed(() => '2024-12-31'), | ||
| subscriptionTier: computed(() => mockSubscriptionTier.value), | ||
| subscriptionTierName: computed(() => | ||
| mockSubscriptionTier.value ? TIER_TO_NAME[mockSubscriptionTier.value] : '' | ||
| ), | ||
| handleInvoiceHistory: vi.fn() | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Typed tier→i18n mapping and
subscriptionTierNamecomputed are well‑structuredDeriving
SubscriptionTierfromcomponents['schemas']['SubscriptionTier']and using it as the key forTIER_TO_I18N_KEYkeeps the mapping strongly typed against the backend schema. ThesubscriptionTierNamecomputed cleanly handles the “no tier yet” case by returning an empty string and uses the i18n key space consistently, with a safe'standard'fallback if a future tier slipped through unmapped.One thing to watch is that a very similar
TIER_TO_I18N_KEYmapping still exists inSubscriptionPanel.vuefor price/benefit lookups, so tier key→i18n mapping logic now lives in two places. Not a blocker, but it may be worth centralizing (e.g., via a small shared helper or exported mapping) to avoid divergence if tiers change later.Also applies to: 85-90, 244-245
🤖 Prompt for AI Agents