From 632222f1cf41cad87a05596c13192118c20c3716 Mon Sep 17 00:00:00 2001 From: Dante Date: Thu, 29 Oct 2026 00:47:46 +0000 Subject: [PATCH] FRONT-3626 fix(billing): Enterprise billed-by-contract plan row and white Complete verification (#22180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why FRONT-3626 "Moved before the flag" items 3 and 5. Alex checked the Billing tab live on testcloud, and these read as broken rather than unpolished, so they go into 1.59 before `unified_billing_settings` turns on in production. ## Root cause 3. `useBillingPlanRow` hides the plan name for Enterprise, and `derivePlanRow` had no state for a sales-managed plan, so an active Enterprise row rendered "Your plan" with no line. 5. The "Verify your payment" banner reused the generic checkout banner shell: a grey action and a Dismiss button. ## How 3. A new `salesManaged` plan row state is chosen from the served `plan_kind === 'sales_managed'` when the subscription is `active` and not `paused`. It is not chosen from the tier. It renders: - title "Enterprise", or the served plan name when there is one; - "Billed by contract. Renews {date}.", or "Billed by contract." when no renewal date is served; - the existing Contact sales ↗ action. Ending, ended and paused Enterprise rows are unchanged. 5. The verify banner's action reads "Complete verification" and uses the white (`inverted`) variant. It has no Dismiss. Payment received keeps its Dismiss. Out of scope, left for the Polish round: the verify banner icon (Figma uses a grey `circle-alert`) and `external-link` → `arrow-up-right` on Contact sales. ## AS IS / TO BE | AS IS | TO BE | | --- | --- | | _screenshot pending_ | _screenshot pending_ | ## Plan position | Item | PR | Status | | --- | --- | --- | | Paused plan row + refill line | #22171 | open | | Before-the-flag 1, 5, 7 | #22176 | open | | Before-the-flag 2, 3 | #22177 | open | | Before-the-flag 4, 6 | #22175 | open | | Moved before the flag 1, 2, 4 (handoff card, plan cell meter, Available until) | sibling PR | in progress | | **Moved before the flag 3, 5 (Enterprise row, Complete verification)** | **this PR** | **open** | ```mermaid graph LR T["FRONT-3626 moved before the flag"] --> D["Items 1, 2, 4"] T --> E["This PR: items 3, 5"] style E fill:#f9d71c,stroke:#333 ``` Touches `planRow.ts` next to #22171's paused state; whichever lands second merges main and is re-verified. --- src/locales/en/main.json | 7 ++- .../BillingPlanCheckoutBanner.test.ts | 51 ++++++++++++----- .../billingTab/BillingPlanCheckoutBanner.vue | 9 ++- .../components/billingTab/BillingPlanRow.vue | 12 ++++ .../components/billingTab/BillingTab.test.ts | 46 +++++++++++++++ .../components/billingTab/planRow.test.ts | 56 ++++++++++++++++++- .../billing/components/billingTab/planRow.ts | 29 ++++++++++ .../billingTab/useBillingPlanRow.ts | 5 +- 8 files changed, 195 insertions(+), 20 deletions(-) diff --git a/src/locales/en/main.json b/src/locales/en/main.json index ce76e807b93..ef48c4ebf5d 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -3683,6 +3683,11 @@ "body": "Your plan will renew on {date}. You can cancel again anytime.", "title": "Resume your {plan} plan?" }, + "salesManaged": { + "line": "Billed by contract.", + "renews": "Billed by contract. Renews {date}.", + "title": "Enterprise" + }, "scheduledChange": "Changes to {plan} on {date}.", "stayConfirm": { "body": "Your plan won't change to {plan} on {date}. You can schedule a change again anytime.", @@ -3758,7 +3763,7 @@ "title": "Payment received" }, "verifyPayment": { - "action": "Verify your payment", + "action": "Complete verification", "body": "Your bank requires additional verification to complete this payment.", "title": "Verify your payment" } diff --git a/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.test.ts b/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.test.ts index 2e9629af55b..ad7001c72df 100644 --- a/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.test.ts +++ b/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.test.ts @@ -24,7 +24,7 @@ function renderBanner(banner: PlanCheckoutBanner) { } describe('BillingPlanCheckoutBanner', () => { - it('links the bank check when the operation serves an action url', () => { + it('links the bank check from a white Complete verification action with no Dismiss', () => { renderBanner({ kind: 'verifyPayment', opId: 'op-1', @@ -35,24 +35,45 @@ describe('BillingPlanCheckoutBanner', () => { expect(screen.getByRole('status')).toHaveTextContent( 'Your bank requires additional verification to complete this payment.' ) + const action = screen.getByRole('link', { name: 'Complete verification' }) + expect(action).toHaveAttribute('href', 'https://pay.example/verify') + expect(action).toHaveAttribute('data-variant', 'inverted') expect( - screen.getByRole('link', { name: 'Verify your payment' }) - ).toHaveAttribute('href', 'https://pay.example/verify') + screen.queryByRole('button', { name: 'Dismiss' }) + ).not.toBeInTheDocument() }) - it('uses the 12px banner shell with md buttons', () => { - renderBanner({ - kind: 'verifyPayment', - opId: 'op-1', - actionUrl: 'https://pay.example/verify' - }) + it.for<{ + case: string + banner: PlanCheckoutBanner + role: 'link' | 'button' + name: string + }>([ + { + case: 'the verify action', + banner: { + kind: 'verifyPayment', + opId: 'op-1', + actionUrl: 'https://pay.example/verify' + }, + role: 'link', + name: 'Complete verification' + }, + { + case: 'Dismiss', + banner: { kind: 'paymentReceived', opId: 'op-1' }, + role: 'button', + name: 'Dismiss' + } + ])( + 'uses the 12px banner shell with an md $case', + ({ banner, role, name }) => { + renderBanner(banner) - expect(screen.getByRole('status')).toHaveClass('rounded-xl', 'p-3') - expect(screen.getByRole('button', { name: 'Dismiss' })).toHaveClass('h-8') - expect( - screen.getByRole('link', { name: 'Verify your payment' }) - ).toHaveClass('h-8') - }) + expect(screen.getByRole('status')).toHaveClass('rounded-xl', 'p-3') + expect(screen.getByRole(role, { name })).toHaveClass('h-8') + } + ) it('shows verify payment with no link when the operation omits action_url', () => { renderBanner({ kind: 'verifyPayment', opId: 'op-1', actionUrl: null }) diff --git a/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.vue b/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.vue index 25605f9aa21..777709d913a 100644 --- a/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.vue +++ b/src/platform/billing/components/billingTab/BillingPlanCheckoutBanner.vue @@ -23,7 +23,12 @@

{{ copy?.body }}

-