فهرست منبع

Redirect users without an active subscription to the subscription page instead of the error page (#34637)

* Redirect freemium users from billing portal routes to subscription page with banner

* Handle null management link and unknown service in subscription redirects

* Move deleted-subscription invoices link inside `getCustomerManagementLink` instead

GitOrigin-RevId: 7122f69e9b8bda6238111f76c15a35135ce5f0ac
Rebeka Dekany 1 ماه پیش
والد
کامیت
51fc266bc2
1فایلهای تغییر یافته به همراه12 افزوده شده و 1 حذف شده
  1. 12 1
      services/web/frontend/js/features/subscription/components/dashboard/redirect-alerts.tsx

+ 12 - 1
services/web/frontend/js/features/subscription/components/dashboard/redirect-alerts.tsx

@@ -1,5 +1,6 @@
 import { Trans, useTranslation } from 'react-i18next'
 import OLNotification from '@/shared/components/ol/ol-notification'
+import OLButton from '@/shared/components/ol/ol-button'
 
 function RedirectAlerts() {
   const queryParams = new URLSearchParams(window.location.search)
@@ -11,6 +12,7 @@ function RedirectAlerts() {
   }
 
   let warning
+  let action
   if (redirectReason === 'writefull-entitled') {
     warning = t('good_news_you_are_already_receiving_this_add_on_via_writefull')
   } else if (redirectReason === 'double-buy') {
@@ -27,10 +29,19 @@ function RedirectAlerts() {
     )
   } else if (redirectReason === 'subscription-paused') {
     warning = t('no_add_on_purchase_while_paused')
+  } else if (redirectReason === 'no-active-subscription') {
+    warning = t('your_subscription_has_expired')
+    action = (
+      <OLButton href="/user/subscription/payment/invoices" variant="secondary">
+        {t('view_your_invoices')}
+      </OLButton>
+    )
   } else {
     return null
   }
 
-  return <OLNotification type="warning" content={<>{warning}</>} />
+  return (
+    <OLNotification type="warning" content={<>{warning}</>} action={action} />
+  )
 }
 export default RedirectAlerts