diff --git a/browser_tests/tests/dialogs/creditsTile.spec.ts b/browser_tests/tests/dialogs/creditsTile.spec.ts index b292a93beb7..3b0be96a440 100644 --- a/browser_tests/tests/dialogs/creditsTile.spec.ts +++ b/browser_tests/tests/dialogs/creditsTile.spec.ts @@ -291,8 +291,12 @@ test.describe('Credits tile (Plan & Credits)', { tag: '@cloud' }, () => { await mockCloudBoot(page, true, endedPersonalBillingStatus) const content = await openPlanAndCredits(page) - await expect(content.getByText('Your subscription has ended')).toBeVisible() - await content.getByRole('button', { name: 'Billing & invoices' }).click() + const billingPortal = content.getByRole('button', { + name: 'Billing & invoices' + }) + await expect(billingPortal).toBeVisible() + await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) + await billingPortal.click() await expect .poll(() => page.locator('html').getAttribute('data-opened-url')) diff --git a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts index c8a8402021a..49f2d82301b 100644 --- a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts +++ b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts @@ -185,10 +185,13 @@ test.describe('Enterprise workspace billing', { tag: '@cloud' }, () => { ) const content = await workspace.openPlanAndCreditsSettings() - await expect(content.getByText('Your subscription has ended')).toBeVisible() await expect( content.getByRole('heading', { name: 'Enterprise' }) ).toBeVisible() + await expect(content.getByTestId('plan-status-badge')).toHaveText( + 'Inactive' + ) + await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) await expect( content.getByRole('button', { name: 'Add credits' }) ).toBeVisible() diff --git a/src/locales/ar/main.json b/src/locales/ar/main.json index eae27284c6c..9f4e9d05936 100644 --- a/src/locales/ar/main.json +++ b/src/locales/ar/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "لن يتم خصم أي رسوم أخرى منك. ستبقى ميزاتك نشطة حتى {date}.", "descriptionWithoutDate": "لن يتم خصم أي رسوم أخرى. ستبقى ميزاتك نشطة حتى نهاية فترة الفوترة.", - "endedDescription": "لم يعد اشتراكك نشطًا.", - "endedTitle": "انتهى اشتراكك", "title": "تم إلغاء اشتراكك" }, "changePlan": "تغيير الخطة", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (ذاكرة 96GB VRAM)", "haveQuestions": "هل لديك أسئلة أو ترغب في معرفة المزيد عن المؤسسات؟", "inactive": { + "badge": "غير نشط", "memberCta": "حسنًا، فهمت", "memberDescription": "اطلب من مالك مساحة العمل إعادة تفعيل الاشتراك لتشغيل سير العمل.", "memberRunTooltip": "تواصل مع مالك مساحة العمل لإعادة الاشتراك", diff --git a/src/locales/de/main.json b/src/locales/de/main.json index a869cf2695b..eb40aad61ac 100644 --- a/src/locales/de/main.json +++ b/src/locales/de/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "Ihnen werden keine weiteren Kosten berechnet. Ihre Funktionen bleiben bis {date} aktiv.", "descriptionWithoutDate": "Ihnen werden keine weiteren Kosten berechnet. Ihre Funktionen bleiben bis zum Ende Ihres Abrechnungszeitraums aktiv.", - "endedDescription": "Ihr Abonnement ist nicht mehr aktiv.", - "endedTitle": "Ihr Abonnement ist beendet", "title": "Ihr Abonnement wurde gekündigt" }, "changePlan": "Plan ändern", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Haben Sie Fragen oder interessieren Sie sich für Enterprise?", "inactive": { + "badge": "Inaktiv", "memberCta": "OK, verstanden", "memberDescription": "Bitten Sie den Workspace-Inhaber, das Abonnement des Workspace zu reaktivieren, um Workflows auszuführen.", "memberRunTooltip": "Wenden Sie sich an den Workspace-Inhaber, um das Abonnement erneut abzuschließen", diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 3a2a8ea9889..3cd74ecaa94 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -2834,9 +2834,7 @@ "canceledCard": { "title": "Your subscription has been canceled", "description": "You won't be charged again. Your features remain active until {date}.", - "descriptionWithoutDate": "You won't be charged again. Your features remain active until the end of your billing period.", - "endedTitle": "Your subscription has ended", - "endedDescription": "Your subscription is no longer active." + "descriptionWithoutDate": "You won't be charged again. Your features remain active until the end of your billing period." }, "cancelSuccess": "Subscription cancelled successfully", "cancelDialog": { @@ -2975,7 +2973,8 @@ "memberDescription": "Ask your workspace owner to reactivate the workspace's subscription to run workflows.", "memberCta": "Ok, got it", "memberRunTooltip": "Contact your workspace owner to resubscribe", - "runLabel": "Run" + "runLabel": "Run", + "badge": "Inactive" }, "paymentRecovery": { "title": "Subscription paused", diff --git a/src/locales/es/main.json b/src/locales/es/main.json index 7a84a490d98..b957a31b10d 100644 --- a/src/locales/es/main.json +++ b/src/locales/es/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "No se te cobrará de nuevo. Tus funciones seguirán activas hasta {date}.", "descriptionWithoutDate": "No se te volverá a cobrar. Tus funciones seguirán activas hasta el final de tu periodo de facturación.", - "endedDescription": "Tu suscripción ya no está activa.", - "endedTitle": "Tu suscripción ha finalizado", "title": "Tu suscripción ha sido cancelada" }, "changePlan": "Cambiar plan", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "¿Tienes preguntas o buscas soluciones empresariales?", "inactive": { + "badge": "Inactiva", "memberCta": "Ok, entendido", "memberDescription": "Pide al propietario del espacio de trabajo que reactive la suscripción para ejecutar flujos de trabajo.", "memberRunTooltip": "Contacta al propietario del espacio de trabajo para volver a suscribirte", diff --git a/src/locales/fa/main.json b/src/locales/fa/main.json index 1420644b354..24a74a50dca 100644 --- a/src/locales/fa/main.json +++ b/src/locales/fa/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "دیگر هزینه‌ای از شما دریافت نمی‌شود. امکانات شما تا تاریخ {date} فعال خواهد بود.", "descriptionWithoutDate": "دیگر هزینه‌ای از شما دریافت نمی‌شود. امکانات شما تا پایان دوره صورتحساب فعال خواهد بود.", - "endedDescription": "اشتراک شما دیگر فعال نیست.", - "endedTitle": "اشتراک شما به پایان رسیده است", "title": "اشتراک شما لغو شده است" }, "changePlan": "تغییر پلن", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (۹۶ گیگابایت VRAM)", "haveQuestions": "سوالی دارید یا به دنبال راهکار سازمانی هستید؟", "inactive": { + "badge": "غیرفعال", "memberCta": "باشه، متوجه شدم", "memberDescription": "از مالک فضای کاری خود بخواهید تا اشتراک را برای اجرای workflowها فعال کند.", "memberRunTooltip": "برای تمدید اشتراک با مالک فضای کاری تماس بگیرید", diff --git a/src/locales/fr/main.json b/src/locales/fr/main.json index ac20513c160..51c97191a0a 100644 --- a/src/locales/fr/main.json +++ b/src/locales/fr/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "Vous ne serez plus facturé. Vos fonctionnalités restent actives jusqu'au {date}.", "descriptionWithoutDate": "Vous ne serez plus facturé. Vos fonctionnalités restent actives jusqu’à la fin de votre période de facturation.", - "endedDescription": "Votre abonnement n’est plus actif.", - "endedTitle": "Votre abonnement a pris fin", "title": "Votre abonnement a été annulé" }, "changePlan": "Changer d’abonnement", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Des questions ou besoin d'une offre entreprise ?", "inactive": { + "badge": "Inactif", "memberCta": "Ok, compris", "memberDescription": "Demandez au propriétaire de l’espace de travail de réactiver l’abonnement pour exécuter des workflows.", "memberRunTooltip": "Contactez le propriétaire de votre espace de travail pour réactiver l’abonnement", diff --git a/src/locales/he/main.json b/src/locales/he/main.json index 1bdeff86ca8..543765da36d 100644 --- a/src/locales/he/main.json +++ b/src/locales/he/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "לא תחויב שוב. התכונות שלך יישארו פעילות עד {date}.", "descriptionWithoutDate": "לא תחויבו שוב. הפיצ'רים שלכם יישארו פעילים עד לסיום תקופת החיוב.", - "endedDescription": "המנוי שלכם אינו פעיל יותר.", - "endedTitle": "המנוי שלכם הסתיים", "title": "המנוי שלך בוטל" }, "changePlan": "שנה תוכנית", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "יש לך שאלות או מתעניין במסלול ארגוני (enterprise)?", "inactive": { + "badge": "לא פעיל", "memberCta": "הבנתי", "memberDescription": "פנה לבעלים של מרחב העבודה כדי להפעיל מחדש את המנוי ולהריץ תהליכי עבודה.", "memberRunTooltip": "פנה לבעלים של מרחב העבודה כדי לחדש מנוי", diff --git a/src/locales/it/main.json b/src/locales/it/main.json index a9407b5a00a..97cf431d19f 100644 --- a/src/locales/it/main.json +++ b/src/locales/it/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "Non ti verrà più addebitato nulla. Le tue funzionalità rimarranno attive fino al {date}.", "descriptionWithoutDate": "Non ti verrà più addebitato nulla. Le tue funzionalità rimarranno attive fino alla fine del periodo di fatturazione.", - "endedDescription": "Il tuo abbonamento non è più attivo.", - "endedTitle": "Il tuo abbonamento è terminato", "title": "Il tuo abbonamento è stato annullato" }, "changePlan": "Cambia piano", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Hai domande o sei interessato all'enterprise?", "inactive": { + "badge": "Inattivo", "memberCta": "Ok, capito", "memberDescription": "Chiedi al proprietario del workspace di riattivare l'abbonamento per eseguire workflow.", "memberRunTooltip": "Contatta il proprietario del workspace per riabbonarsi", diff --git a/src/locales/ja/main.json b/src/locales/ja/main.json index f26e1b3cc50..cc3a9271cb5 100644 --- a/src/locales/ja/main.json +++ b/src/locales/ja/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "今後請求されることはありません。{date}まで機能は有効です。", "descriptionWithoutDate": "今後請求は発生しません。機能は請求期間の終了まで有効です。", - "endedDescription": "サブスクリプションは無効になりました。", - "endedTitle": "サブスクリプションが終了しました", "title": "サブスクリプションはキャンセルされました" }, "changePlan": "プランを変更", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro(96GB VRAM)", "haveQuestions": "ご質問やエンタープライズについてのお問い合わせはこちら", "inactive": { + "badge": "無効", "memberCta": "了解しました", "memberDescription": "ワークスペースのオーナーに連絡して、サブスクリプションを再有効化してワークフローを実行してください。", "memberRunTooltip": "ワークスペースのオーナーに再購読を依頼してください", diff --git a/src/locales/ko/main.json b/src/locales/ko/main.json index cd064cda546..3bf90404ad0 100644 --- a/src/locales/ko/main.json +++ b/src/locales/ko/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "더 이상 결제되지 않습니다. {date}까지 기능을 계속 사용할 수 있습니다.", "descriptionWithoutDate": "더 이상 결제되지 않습니다. 현재 결제 주기까지 기능이 계속 활성화됩니다.", - "endedDescription": "구독이 더 이상 활성화되어 있지 않습니다.", - "endedTitle": "구독이 종료되었습니다", "title": "구독이 취소되었습니다" }, "changePlan": "요금제 변경", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "질문이 있거나 엔터프라이즈가 궁금하신가요?", "inactive": { + "badge": "비활성", "memberCta": "확인", "memberDescription": "워크스페이스 소유자에게 구독을 다시 활성화하여 워크플로우를 실행할 수 있도록 요청하세요.", "memberRunTooltip": "워크스페이스 소유자에게 재구독을 문의하세요", diff --git a/src/locales/pt-BR/main.json b/src/locales/pt-BR/main.json index f946078972e..72000ff99e6 100644 --- a/src/locales/pt-BR/main.json +++ b/src/locales/pt-BR/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "Você não será mais cobrado. Seus recursos permanecem ativos até {date}.", "descriptionWithoutDate": "Você não será cobrado novamente. Seus recursos permanecem ativos até o final do seu período de cobrança.", - "endedDescription": "Sua assinatura não está mais ativa.", - "endedTitle": "Sua assinatura foi encerrada", "title": "Sua assinatura foi cancelada" }, "changePlan": "Alterar plano", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Tem dúvidas ou interesse em soluções empresariais?", "inactive": { + "badge": "Inativo", "memberCta": "Ok, entendi", "memberDescription": "Peça ao proprietário do workspace para reativar a assinatura e executar fluxos de trabalho.", "memberRunTooltip": "Entre em contato com o proprietário do workspace para reativar a assinatura", diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index b07fbffe862..ff9570086df 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "С вас больше не будет взиматься плата. Ваши функции останутся активными до {date}.", "descriptionWithoutDate": "С вас больше не будет взиматься плата. Ваши функции останутся активными до конца расчетного периода.", - "endedDescription": "Ваша подписка больше не активна.", - "endedTitle": "Ваша подписка завершена", "title": "Ваша подписка отменена" }, "changePlan": "Сменить тариф", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96ГБ VRAM)", "haveQuestions": "Есть вопросы или интересует корпоративное решение?", "inactive": { + "badge": "Неактивно", "memberCta": "Ок, понятно", "memberDescription": "Попросите владельца рабочего пространства возобновить подписку, чтобы запускать рабочие процессы.", "memberRunTooltip": "Свяжитесь с владельцем рабочего пространства для повторной подписки", diff --git a/src/locales/tr/main.json b/src/locales/tr/main.json index ac106c16c9e..9baacd5297b 100644 --- a/src/locales/tr/main.json +++ b/src/locales/tr/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "Tekrar ücretlendirilmeyeceksiniz. Özellikleriniz {date} tarihine kadar aktif kalacak.", "descriptionWithoutDate": "Tekrar ücretlendirilmeyeceksiniz. Özellikleriniz fatura dönemi sonuna kadar aktif kalacak.", - "endedDescription": "Aboneliğiniz artık aktif değil.", - "endedTitle": "Aboneliğiniz sona erdi", "title": "Aboneliğiniz iptal edildi" }, "changePlan": "Planı değiştir", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Sorularınız mı var veya kurumsal çözüm mü arıyorsunuz?", "inactive": { + "badge": "Pasif", "memberCta": "Tamam, anladım", "memberDescription": "Çalışma alanı sahibinizden iş akışlarını çalıştırmak için aboneliği yeniden etkinleştirmesini isteyin.", "memberRunTooltip": "Yeniden abone olmak için çalışma alanı sahibinizle iletişime geçin", diff --git a/src/locales/zh-TW/main.json b/src/locales/zh-TW/main.json index 8034e219d3c..edb6284b548 100644 --- a/src/locales/zh-TW/main.json +++ b/src/locales/zh-TW/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "您將不會再次被收費。您的功能將持續至 {date}。", "descriptionWithoutDate": "您將不會再次被收費。您的功能會持續啟用至本期帳單結束。", - "endedDescription": "您的訂閱已不再有效。", - "endedTitle": "您的訂閱已結束", "title": "您的訂閱已取消" }, "changePlan": "更改方案", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro(96GB VRAM)", "haveQuestions": "有疑問或想了解企業方案?", "inactive": { + "badge": "已停用", "memberCta": "好的,知道了", "memberDescription": "請聯絡您的工作區擁有者以重新啟用訂閱,才能執行工作流程。", "memberRunTooltip": "請聯絡您的工作區擁有者重新訂閱", diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index 5375b435b13..bcc96d71d96 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -4265,8 +4265,6 @@ "canceledCard": { "description": "您将不再被扣费。您的功能将在 {date} 前保持激活。", "descriptionWithoutDate": "您将不会再次被扣费。您的功能将在本计费周期结束前保持激活状态。", - "endedDescription": "您的订阅已不再激活。", - "endedTitle": "您的订阅已结束", "title": "您的订阅已被取消" }, "changePlan": "更改套餐", @@ -4321,6 +4319,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "对企业级有疑问?", "inactive": { + "badge": "已失效", "memberCta": "好的,知道了", "memberDescription": "请联系您的工作区所有者,重新激活订阅以运行工作流。", "memberRunTooltip": "请联系您的工作区所有者重新订阅", diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts index ddd2a432c13..f54377e04c5 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts @@ -308,6 +308,11 @@ const SubscriptionFooterLinksStub = { '
' } +const StatusBadgeStub = { + props: ['label', 'severity'], + template: '{{ label }}' +} + const DropdownMenuStub = { props: ['entries'], template: @@ -325,7 +330,7 @@ function renderComponent({ stubFooter = true } = {}) { ...(stubFooter ? { SubscriptionFooterLinks: SubscriptionFooterLinksStub } : {}), - StatusBadge: true, + StatusBadge: StatusBadgeStub, DropdownMenu: DropdownMenuStub } } @@ -499,6 +504,50 @@ describe('SubscriptionPanelContentWorkspace', () => { ).not.toBeInTheDocument() }) + it('marks an ended Enterprise plan inactive without the state card', () => { + useEnterprisePlan() + mockSubscriptionStatus.value = 'ended' + mockIsActiveSubscription.value = false + renderComponent() + + expect(screen.getByTestId('plan-status-badge')).toHaveTextContent( + 'Inactive' + ) + expect(screen.getByTestId('plan-status-badge')).toHaveAttribute( + 'data-severity', + 'secondary' + ) + expect( + screen.queryByTestId('subscription-state-card') + ).not.toBeInTheDocument() + }) + + it('marks an ended Personal plan inactive when it cannot self-serve', () => { + mockIsInPersonalWorkspace.value = true + mockIsActiveSubscription.value = false + mockSubscriptionStatus.value = 'ended' + mockBillingStatus.value = 'inactive' + mockCanSubscribeSelfServe.value = false + renderComponent() + + expect(screen.getByTestId('plan-status-badge')).toHaveTextContent( + 'Inactive' + ) + expect( + screen.queryByTestId('subscription-state-card') + ).not.toBeInTheDocument() + }) + + it('keeps the cancelled badge while an Enterprise plan still runs', () => { + useEnterprisePlan() + mockSubscriptionStatus.value = 'canceled' + renderComponent() + + expect(screen.getByText('Canceled')).toBeInTheDocument() + expect(screen.queryByText('Inactive')).not.toBeInTheDocument() + expect(screen.getByTestId('subscription-state-card')).toBeInTheDocument() + }) + it('renders an unrecognized tier as Current plan without catalog content', () => { mockHasTeamPlan.value = false mockSubscriptionTier.value = runtimeTier('GALACTIC') @@ -708,7 +757,9 @@ describe('SubscriptionPanelContentWorkspace', () => { mockBillingStatus.value = 'inactive' renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() + expect( + screen.queryByTestId('subscription-state-card') + ).not.toBeInTheDocument() expect(screen.getByRole('heading', { name: 'Free' })).toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'Billing & invoices' })) expect(mockManageSubscription).toHaveBeenCalledOnce() @@ -750,7 +801,7 @@ describe('SubscriptionPanelContentWorkspace', () => { expect(screen.getByRole('heading', { name: 'Team' })).toBeInTheDocument() expect( - screen.queryByText('Your subscription has ended') + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect( screen.queryByRole('button', { name: 'Subscribe' }) @@ -796,19 +847,15 @@ describe('SubscriptionPanelContentWorkspace', () => { expect(mockShowSubscriptionDialog).not.toHaveBeenCalled() }) - it('shows ended copy for an inactive ended subscription without a date', () => { + it('drops the state card for an inactive ended subscription without a date', () => { mockSubscriptionStatus.value = 'ended' mockIsActiveSubscription.value = false mockIsInPersonalWorkspace.value = true mockEndDate.value = null renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() - expect( - screen.getByText('Your subscription is no longer active.') - ).toBeInTheDocument() expect( - screen.queryByText(/features remain active/i) + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect(screen.queryByText(/^Ends on/i)).not.toBeInTheDocument() expect( @@ -840,7 +887,9 @@ describe('SubscriptionPanelContentWorkspace', () => { const user = userEvent.setup() renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() + expect( + screen.queryByTestId('subscription-state-card') + ).not.toBeInTheDocument() expect( screen.getByRole('heading', { name: 'Inactive team subscription' }) ).toBeInTheDocument() @@ -903,7 +952,9 @@ describe('SubscriptionPanelContentWorkspace', () => { mockSubscriptionStatus.value = 'ended' renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() + expect( + screen.queryByTestId('subscription-state-card') + ).not.toBeInTheDocument() expect(screen.queryByText(/^Renews on/i)).not.toBeInTheDocument() }) diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue index b376d071d41..df743b97e7e 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue @@ -55,6 +55,7 @@
{ }) const showSubscriptionStateCard = computed( - () => isSubscriptionCancelled.value || isSubscriptionEnded.value + () => isSubscriptionCancelled.value && !isSubscriptionEnded.value ) const subscriptionStateCardTitle = computed(() => - isSubscriptionEnded.value - ? t('subscription.canceledCard.endedTitle') - : t('subscription.canceledCard.title') + t('subscription.canceledCard.title') ) -const subscriptionStateCardDescription = computed(() => { - if (isSubscriptionEnded.value) { - return t('subscription.canceledCard.endedDescription') - } - if (!formattedEndDate.value) { - return t('subscription.canceledCard.descriptionWithoutDate') - } - return t('subscription.canceledCard.description', { - date: formattedEndDate.value - }) +const subscriptionStateCardDescription = computed(() => + formattedEndDate.value + ? t('subscription.canceledCard.description', { + date: formattedEndDate.value + }) + : t('subscription.canceledCard.descriptionWithoutDate') +) + +const planStatusBadge = computed(() => { + if (isSubscriptionEnded.value) + return { + label: t('subscription.inactive.badge'), + severity: 'secondary' as const + } + if (isSubscriptionCancelled.value) + return { label: t('subscription.canceled'), severity: 'warn' as const } + return null }) const planDateDisplay = computed(() => {