diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 891a1328657..ebc420b7c9c 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -2955,6 +2955,9 @@ "memberCta": "Ok, got it", "memberRunTooltip": "Contact your workspace owner to resubscribe", "runLabel": "Run", + "salesManagedDescription": "You can't run workflows or add new members. Contact your Comfy account manager to restore access.", + "salesManagedSpendable": "Spendable once your plan is restored.", + "salesManagedEnded": "Plan credits ended with your subscription.", "badge": "Inactive" }, "paymentRecovery": { diff --git a/src/platform/cloud/subscription/components/CreditsTile.test.ts b/src/platform/cloud/subscription/components/CreditsTile.test.ts index baa07527c34..1177281d4da 100644 --- a/src/platform/cloud/subscription/components/CreditsTile.test.ts +++ b/src/platform/cloud/subscription/components/CreditsTile.test.ts @@ -143,6 +143,10 @@ const i18n = createI18n({ additionalCreditsInUse: 'In use', usedAfterMonthly: 'Used after monthly runs out', reactivateToUseCredits: 'Reactivate your plan to use these credits', + inactive: { + salesManagedSpendable: 'Spendable once your plan is restored.', + salesManagedEnded: 'Plan credits ended with your subscription.' + }, monthlyCreditsUsedUpTitle: 'Monthly credits are used up. Refills {date}', monthlyCreditsUsedUpTitleNoDate: 'Monthly credits are used up', @@ -413,11 +417,13 @@ describe('CreditsTile', () => { expect(screen.queryByText('Add credits')).toBeNull() }) - it('keeps Add credits and the real balance on an inactive sales-managed plan', () => { + it('gives an inactive sales-managed plan the ended treatment with restore copy', () => { activeProSubscription() - // A sales-managed plan has no self-serve reactivation to sell, so the - // reactivate-to-use-credits treatment must not apply. - state.canTopUp = true + // cloud#8001 withholds top-up once a sales-managed subscription is + // terminal, so the tile no longer keeps a live Add credits here. The note + // names restoration rather than reactivation: there is no Reactivate for + // a sales-managed plan, only the account manager. + state.canTopUp = false state.tier = 'ENTERPRISE' state.subscription = { tier: 'ENTERPRISE', @@ -426,10 +432,34 @@ describe('CreditsTile', () => { } const { container } = renderTile({ inactivePlan: true }) + expect(container.textContent).toContain( + 'Spendable once your plan is restored.' + ) expect(container.textContent).not.toContain( 'Reactivate your plan to use these credits' ) - expect(screen.getByText('Add credits')).toBeInTheDocument() + expect(screen.queryByText('Add credits')).toBeNull() + }) + + it('states what happened when an inactive sales-managed plan retained nothing', () => { + activeProSubscription() + state.canTopUp = false + state.tier = 'ENTERPRISE' + state.subscription = { + tier: 'ENTERPRISE', + duration: 'MONTHLY', + renewalDate: '2026-02-20T12:00:00Z' + } + state.balance = { + amountMicros: 0, + cloudCreditBalanceMicros: 0, + prepaidBalanceMicros: 0 + } + const { container } = renderTile({ inactivePlan: true }) + + expect(container.textContent).toContain( + 'Plan credits ended with your subscription.' + ) }) it('does not borrow a catalog monthly pool for an Enterprise plan', () => { diff --git a/src/platform/cloud/subscription/components/CreditsTile.vue b/src/platform/cloud/subscription/components/CreditsTile.vue index 95b4efc0338..74357c1cd6e 100644 --- a/src/platform/cloud/subscription/components/CreditsTile.vue +++ b/src/platform/cloud/subscription/components/CreditsTile.vue @@ -181,7 +181,15 @@ - {{ $t('subscription.reactivateToUseCredits') }} + {{ + $t( + isSalesManagedPlan + ? prepaidCreditsValue > 0 + ? 'subscription.inactive.salesManagedSpendable' + : 'subscription.inactive.salesManagedEnded' + : 'subscription.reactivateToUseCredits' + ) + }} @@ -296,8 +304,9 @@ const creditPoolTotalCredits = computed(() => { // credit pool above: can_top_up is a rollout-defaulted capability that also // fails open for owners on an unreadable snapshot, which would drop a lapsed // self-serve team out of this state during a capabilities outage. -const showsInactivePlanState = computed( - () => inactivePlan === true && !isSalesManagedTier(subscription.value?.tier) +const showsInactivePlanState = computed(() => inactivePlan === true) +const isSalesManagedPlan = computed(() => + isSalesManagedTier(subscription.value?.tier) ) const usage = computed(() => diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts index d08c4e24b43..604aa1df46a 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts @@ -518,6 +518,11 @@ describe('SubscriptionPanelContentWorkspace', () => { expect( screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() + expect( + screen.getByText( + "You can't run workflows or add new members. Contact your Comfy account manager to restore access." + ) + ).toBeInTheDocument() }) it('marks an ended Personal plan inactive when it cannot self-serve', () => { diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue index 25cc18b56b8..549811d5db2 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue @@ -237,6 +237,12 @@
{{ planDateDisplay }}
+

+ {{ $t('subscription.inactive.salesManagedDescription') }} +