From bcda04ee86e27deeaddf954cfcf328e5437f8e28 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Mon, 15 May 2023 07:38:53 -0700 Subject: [PATCH] [AC-358] SelfHosted update subscription page (#5101) * [AC-358] Add selfHostSubscriptionExpiration property to organization-subscription.response.ts * [AC-358] Update selfHost org subscription template - Replace "Subscription" with "SubscriptionExpiration" - Add question mark help link - Add helper text for grace period - Add support for graceful fallback in case of missing grace period in subscription response * Update libs/common/src/billing/models/response/organization-subscription.response.ts Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> * [AC-358] Remove unnecessary hypen Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> * [AC-358] Introduce SelfHostedOrganizationSubscription view - Encapsulate expiration/grace period logic in the new view object. - Remove API response getters from the angular component - Replace the API response object with the new view * [AC-358] Clarify name for new expiration without grace period field * [AC-358] Update constructor parameter name * [AC-358] Simplify new selfhost subscription view - Make expiration date properties public - Remove obsolete expiration date getters - Update the component to use new properties - Add helper to component for determining if the subscription should be rendered as expired (red text) * [AC-358] Rename isExpired to isExpiredAndOutsideGracePeriod to be more explicit --------- Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> --- ...ation-subscription-selfhost.component.html | 42 +++++++++---- ...ization-subscription-selfhost.component.ts | 24 +++++--- apps/web/src/locales/en/messages.json | 12 ++++ .../organization-subscription.response.ts | 2 + ...f-hosted-organization-subscription.view.ts | 61 +++++++++++++++++++ 5 files changed, 122 insertions(+), 19 deletions(-) create mode 100644 libs/common/src/billing/models/view/self-hosted-organization-subscription.view.ts diff --git a/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html b/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html index 08fb12e76eb..03771c5896f 100644 --- a/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html +++ b/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html @@ -22,25 +22,45 @@ [providerName]="userOrg.providerName" > - +
{{ "billingPlan" | i18n }}
-
{{ sub.plan.name }}
-
{{ "expiration" | i18n }}
-
- {{ sub.expiration | date : "mediumDate" }} - - - {{ "licenseIsExpired" | i18n }} - -
-
{{ "neverExpires" | i18n }}
+
{{ subscription.planName }}
{{ "lastLicenseSync" | i18n }}
{{ lastLicenseSync != null ? (lastLicenseSync | date : "medium") : ("never" | i18n) }}
+
+ {{ + "subscriptionExpiration" | i18n + }} + + + {{ "licensePaidFeaturesHelp" | i18n }} + +
+
+ {{ + (subscription.hasSeparateGracePeriod + ? subscription.expirationWithoutGracePeriod + : subscription.expirationWithGracePeriod + ) | date : "mediumDate" + }} +
+ {{ + "selfHostGracePeriodHelp" + | i18n : (subscription.expirationWithGracePeriod | date : "mediumDate") + }} +
+
+
{{ "neverExpires" | i18n }}