From 4815d146e6af3d403cd6953a1949fc5014e5801b Mon Sep 17 00:00:00 2001 From: Daniil Bratukhin Date: Wed, 17 Jan 2024 14:50:00 -0300 Subject: [PATCH] fix: improve summary for subscriptions starting soon Closes #148 --- .../AdminSubscriptionCard.test.ts | 26 ++++++++++++ .../AdminSubscriptionCard.ts | 17 ++++++-- .../SubscriptionCard/SubscriptionCard.test.ts | 20 +++++++++ .../SubscriptionCard/SubscriptionCard.ts | 33 +++++++++------ .../SubscriptionForm/SubscriptionForm.test.ts | 30 +++++++++++-- .../SubscriptionForm/SubscriptionForm.ts | 12 ++++-- .../SubscriptionsTable.test.ts | 13 ++++-- .../SubscriptionsTable/SubscriptionsTable.ts | 42 +++++++++---------- .../schemas/admin-subscription-card.json | 2 + src/static/schemas/cart-form.json | 10 +++++ src/static/schemas/customer-portal.json | 10 +++++ src/static/schemas/customer.json | 4 ++ src/static/schemas/item-form.json | 10 +++++ src/static/schemas/shipment-card.json | 10 +++++ src/static/schemas/subscription-card.json | 2 + src/static/schemas/subscription-form.json | 2 + src/static/schemas/subscriptions-table.json | 2 + src/static/schemas/transaction.json | 20 +++++++++ .../admin-subscription-card/en.json | 1 + src/static/translations/cart-form/en.json | 2 + .../translations/customer-portal/en.json | 2 + src/static/translations/customer/en.json | 2 + src/static/translations/item-form/en.json | 2 + src/static/translations/shipment-card/en.json | 2 + .../translations/subscription-card/en.json | 1 + .../translations/subscription-form/en.json | 1 + .../translations/subscriptions-table/en.json | 1 + src/static/translations/transaction/en.json | 4 ++ 28 files changed, 233 insertions(+), 50 deletions(-) diff --git a/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.test.ts b/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.test.ts index fa4936356..155c1da9f 100644 --- a/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.test.ts +++ b/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.test.ts @@ -621,6 +621,32 @@ describe('AdminSubscriptionCard', () => { expect(price).to.have.attribute('infer', ''); }); + it('renders a special status in line 2 for subscriptions that start soon', async () => { + const router = createRouter(); + const href = 'https://demo.api/hapi/subscriptions/0'; + const data = await getTestData>(href, router); + + const element = await fixture(html` + router.handleEvent(evt)} + > + + `); + + data.first_failed_transaction_date = null; + data.start_date = new Date(Date.now() + 3600000).toISOString(); + data.is_active = true; + data.end_date = null; + element.data = data; + + await waitUntil(() => element.isBodyReady, '', { timeout: 5000 }); + const price = await getByKey(element, 'subscription_will_be_active'); + + expect(price).to.exist; + expect(price).to.have.attribute('infer', ''); + }); + it('renders customer email in line 3 from embedded fx:transaction_template', async () => { type Subscription = Resource; diff --git a/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.ts b/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.ts index 2ce560955..313bf24e7 100644 --- a/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.ts +++ b/src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.ts @@ -280,9 +280,15 @@ export class AdminSubscriptionCard extends Base { } private get __statusOptions() { - const d = this.data; - const date = d?.first_failed_transaction_date ?? d?.end_date ?? d?.next_transaction_date; - if (date) return { date }; + const data = this.data; + + if (data === null) return; + if (data.first_failed_transaction_date) return { date: data.first_failed_transaction_date }; + if (data.end_date) return { date: data.end_date }; + if (data.is_active === false) return {}; + if (new Date(data.start_date) > new Date()) return { date: data.start_date }; + + return { date: data.next_transaction_date }; } private get __currencyCode() { @@ -329,7 +335,10 @@ export class AdminSubscriptionCard extends Base { return hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled'; } - return `subscription_${data.is_active ? 'active' : 'inactive'}`; + if (data.is_active === false) return 'subscription_inactive'; + if (new Date(data.start_date) > new Date()) return 'subscription_will_be_active'; + + return 'subscription_active'; } private get __priceKey() { diff --git a/src/elements/public/SubscriptionCard/SubscriptionCard.test.ts b/src/elements/public/SubscriptionCard/SubscriptionCard.test.ts index 47b1fa5c2..6996c5e43 100644 --- a/src/elements/public/SubscriptionCard/SubscriptionCard.test.ts +++ b/src/elements/public/SubscriptionCard/SubscriptionCard.test.ts @@ -116,6 +116,26 @@ describe('SubscriptionCard', () => { expect(control).to.have.attribute('ns', 'subscription-card'); }); + it('once loaded, renders a special status for subscriptions that start soon', async () => { + const href = './hapi/subscriptions/0?zoom=last_transaction,transaction_template:items'; + const data = await getTestData(href); + + data.first_failed_transaction_date = null; + data.start_date = new Date(Date.now() + 3600000).toISOString(); + data.end_date = null; + + const layout = html``; + const element = await fixture(layout); + const control = await getByTestId(element, 'status'); + const options = { date: data.start_date }; + + expect(control).to.have.property('localName', 'foxy-i18n'); + expect(control).to.have.attribute('options', JSON.stringify(options)); + expect(control).to.have.attribute('lang', 'es'); + expect(control).to.have.attribute('key', 'subscription_will_be_active'); + expect(control).to.have.attribute('ns', 'subscription-card'); + }); + it('once loaded, renders a special status for inactive subscriptions', async () => { const href = './hapi/subscriptions/0?zoom=last_transaction,transaction_template:items'; const data = await getTestData(href); diff --git a/src/elements/public/SubscriptionCard/SubscriptionCard.ts b/src/elements/public/SubscriptionCard/SubscriptionCard.ts index 2f0d77c38..6e781a63b 100644 --- a/src/elements/public/SubscriptionCard/SubscriptionCard.ts +++ b/src/elements/public/SubscriptionCard/SubscriptionCard.ts @@ -120,7 +120,7 @@ export class SubscriptionCard extends Base { } private __getSummaryOptions() { - if (!this.in({ idle: 'snapshot' })) return {}; + if (this.data === null) return {}; const items = this.data._embedded['fx:transaction_template']._embedded['fx:items']; return { @@ -131,17 +131,19 @@ export class SubscriptionCard extends Base { } private __getStatusOptions() { - if (!this.in({ idle: 'snapshot' })) return {}; - return { - date: - this.data.first_failed_transaction_date ?? - this.data.end_date ?? - this.data.next_transaction_date, - }; + const data = this.data; + + if (data === null) return {}; + if (data.first_failed_transaction_date) return { date: data.first_failed_transaction_date }; + if (data.end_date) return { date: data.end_date }; + if (data.is_active === false) return {}; + if (new Date(data.start_date) > new Date()) return { date: data.start_date }; + + return { date: data.next_transaction_date }; } private __getPriceOptions() { - if (!this.in({ idle: 'snapshot' })) return {}; + if (this.data === null) return {}; const transaction = this.data._embedded['fx:last_transaction']; const amount = `${transaction.total_order} ${transaction.currency_code}`; @@ -149,13 +151,18 @@ export class SubscriptionCard extends Base { } private __getStatusKey() { - if (this.data?.first_failed_transaction_date) return 'subscription_failed'; + const data = this.data; - if (this.data?.end_date) { - const hasEnded = new Date(this.data.end_date).getTime() > Date.now(); + if (data === null) return; + if (data.first_failed_transaction_date) return 'subscription_failed'; + if (data.end_date) { + const hasEnded = new Date(data.end_date).getTime() > Date.now(); return hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled'; } - return `subscription_${this.data?.is_active ? 'active' : 'inactive'}`; + if (data.is_active === false) return 'subscription_inactive'; + if (new Date(data.start_date) > new Date()) return 'subscription_will_be_active'; + + return 'subscription_active'; } } diff --git a/src/elements/public/SubscriptionForm/SubscriptionForm.test.ts b/src/elements/public/SubscriptionForm/SubscriptionForm.test.ts index 475546066..58607c8aa 100644 --- a/src/elements/public/SubscriptionForm/SubscriptionForm.test.ts +++ b/src/elements/public/SubscriptionForm/SubscriptionForm.test.ts @@ -493,6 +493,28 @@ describe('SubscriptionForm', () => { expect(control).to.have.attribute('ns', 'subscription-form'); }); + it('once loaded, renders a special status for active subscriptions in subtitle', async () => { + const href = './hapi/subscriptions/0?zoom=last_transaction,transaction_template:items'; + const data = await getTestData(href); + + data.first_failed_transaction_date = null; + data.start_date = new Date(Date.now() + 3600000).toISOString(); + data.end_date = null; + + const element = await fixture
(html` + + `); + + const control = await getByTestId(element, 'header-subtitle'); + const options = { date: data.start_date }; + + expect(control).to.have.property('localName', 'foxy-i18n'); + expect(control).to.have.attribute('options', JSON.stringify(options)); + expect(control).to.have.attribute('lang', 'es'); + expect(control).to.have.attribute('key', 'subscription_will_be_active'); + expect(control).to.have.attribute('ns', 'subscription-form'); + }); + it('once loaded, renders a special status for inactive subscriptions in subtitle', async () => { const href = './hapi/subscriptions/0?zoom=last_transaction,transaction_template:items'; const data = await getTestData(href); @@ -1995,13 +2017,13 @@ describe('SubscriptionForm', () => { expect(control).to.have.attribute('disabledcontrols', ''); element.setAttribute('disabled', ''); - await element.updateComplete; + await element.requestUpdate(); expect(control).to.have.attribute('disabledcontrols', 'not=*'); element.removeAttribute('disabled'); element.setAttribute('disabledcontrols', 'end-date:form:submit'); - await element.updateComplete; + await element.requestUpdate(); expect(control).to.have.attribute('disabledcontrols', 'submit'); }); @@ -2014,13 +2036,13 @@ describe('SubscriptionForm', () => { expect(control).to.have.attribute('readonlycontrols', ''); element.setAttribute('readonly', ''); - await element.updateComplete; + await element.requestUpdate(); expect(control).to.have.attribute('readonlycontrols', 'not=*'); element.removeAttribute('readonly'); element.setAttribute('readonlycontrols', 'end-date:form:end-date'); - await element.updateComplete; + await element.requestUpdate(); expect(control).to.have.attribute('readonlycontrols', 'end-date'); }); diff --git a/src/elements/public/SubscriptionForm/SubscriptionForm.ts b/src/elements/public/SubscriptionForm/SubscriptionForm.ts index aa86c82db..d1c7d251f 100644 --- a/src/elements/public/SubscriptionForm/SubscriptionForm.ts +++ b/src/elements/public/SubscriptionForm/SubscriptionForm.ts @@ -147,11 +147,17 @@ export class SubscriptionForm extends Base { key = 'subscription_failed'; } else if (data.end_date) { date = data.end_date; - const hasEnded = new Date(date).getTime() > Date.now(); + const hasEnded = new Date(data.end_date).getTime() > Date.now(); key = hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled'; + } else if (!data.is_active) { + date = ''; + key = 'subscription_inactive'; + } else if (new Date(data.start_date) > new Date()) { + date = data.start_date; + key = 'subscription_will_be_active'; } else { - date = data.next_transaction_date ?? new Date().toISOString(); - key = `subscription_${data.is_active ? 'active' : 'inactive'}`; + date = data.next_transaction_date; + key = 'subscription_active'; } const text = html` diff --git a/src/elements/public/SubscriptionsTable/SubscriptionsTable.test.ts b/src/elements/public/SubscriptionsTable/SubscriptionsTable.test.ts index 0bab503f4..1209e1a53 100644 --- a/src/elements/public/SubscriptionsTable/SubscriptionsTable.test.ts +++ b/src/elements/public/SubscriptionsTable/SubscriptionsTable.test.ts @@ -77,13 +77,18 @@ describe('SubscriptionsTable', () => { date = subscription.first_failed_transaction_date; key = 'subscription_failed'; } else if (subscription.end_date) { - const dateAsObject = new Date(subscription.end_date); - const hasEnded = dateAsObject.getTime() > Date.now(); - key = hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled'; date = subscription.end_date; + const hasEnded = new Date(subscription.end_date).getTime() > Date.now(); + key = hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled'; + } else if (!subscription.is_active) { + date = ''; + key = 'subscription_inactive'; + } else if (new Date(subscription.start_date) > new Date()) { + date = subscription.start_date; + key = 'subscription_will_be_active'; } else { date = subscription.next_transaction_date; - key = `subscription_${subscription.is_active ? 'active' : 'inactive'}`; + key = 'subscription_active'; } expect(statusRef).to.have.deep.property('options', { date }); diff --git a/src/elements/public/SubscriptionsTable/SubscriptionsTable.ts b/src/elements/public/SubscriptionsTable/SubscriptionsTable.ts index e77d81e33..22a8f53a6 100644 --- a/src/elements/public/SubscriptionsTable/SubscriptionsTable.ts +++ b/src/elements/public/SubscriptionsTable/SubscriptionsTable.ts @@ -49,40 +49,38 @@ export class SubscriptionsTable extends TranslatableMixin(Table, 'subscriptions- static statusColumn: Column = { hideBelow: 'sm', - cell: ctx => { - let color: string; + cell: ({ ns, lang, data, html }) => { + let color = 'bg-contrast-5 text-secondary'; let date: string; let key: string; - if (ctx.data.first_failed_transaction_date) { - date = ctx.data.first_failed_transaction_date; - key = 'subscription_failed'; + if (data.first_failed_transaction_date) { color = 'bg-error-10 text-error'; - } else if (ctx.data.end_date) { - date = ctx.data.end_date; - const dateAsObject = new Date(date); - const hasEnded = dateAsObject.getTime() > Date.now(); + date = data.first_failed_transaction_date; + key = 'subscription_failed'; + } else if (data.end_date) { + date = data.end_date; + const hasEnded = new Date(data.end_date).getTime() > Date.now(); key = hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled'; - color = hasEnded ? 'bg-success-10 text-success' : 'bg-contrast-5 text-tertiary'; + } else if (!data.is_active) { + date = ''; + key = 'subscription_inactive'; + } else if (new Date(data.start_date) > new Date()) { + date = data.start_date; + key = 'subscription_will_be_active'; } else { - date = ctx.data.next_transaction_date; - - if (ctx.data.is_active) { - key = 'subscription_active'; - color = 'bg-success-10 text-success'; - } else { - key = 'subscription_inactive'; - color = 'bg-contrast-5 text-tertiary'; - } + color = 'bg-success-10 text-success'; + date = data.next_transaction_date; + key = 'subscription_active'; } - return ctx.html` + return html` diff --git a/src/static/schemas/admin-subscription-card.json b/src/static/schemas/admin-subscription-card.json index f6dc232f4..97d6b62af 100644 --- a/src/static/schemas/admin-subscription-card.json +++ b/src/static/schemas/admin-subscription-card.json @@ -23,6 +23,7 @@ "subscription_failed": { "type": "string", "default": "Payment failed on {{date, date}}" }, "subscription_inactive": { "type": "string", "default": "Inactive" }, "subscription_will_be_cancelled": { "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { "type": "string", "default": "Starts on {{date, date}}" }, "summary": { "type": "string", "default": "{{ firstItem.name }}" }, "summary_plural": { "type": "string", @@ -57,6 +58,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "summary", "summary_plural", "summary_approximate", diff --git a/src/static/schemas/cart-form.json b/src/static/schemas/cart-form.json index 9dde667bc..75b63c692 100644 --- a/src/static/schemas/cart-form.json +++ b/src/static/schemas/cart-form.json @@ -259,6 +259,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "undo_cancel": { "type": "string", "default": "Review" }, @@ -392,6 +396,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", @@ -444,6 +449,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" @@ -477,6 +486,7 @@ "subscription_inactive", "subscription_plural", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "weekly", diff --git a/src/static/schemas/customer-portal.json b/src/static/schemas/customer-portal.json index 6e64404cf..5313ac9ef 100644 --- a/src/static/schemas/customer-portal.json +++ b/src/static/schemas/customer-portal.json @@ -1563,6 +1563,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" }, "twice_a_month": { "type": "string", "default": "twice a month" }, "weekly": { "type": "string", "default": "/ week" }, @@ -1593,6 +1597,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "weekly", @@ -1651,6 +1656,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "update_billing": { "type": "string", "default": "Update billing" }, @@ -1849,6 +1858,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "update_billing", diff --git a/src/static/schemas/customer.json b/src/static/schemas/customer.json index 4a32125b2..c8901bf26 100644 --- a/src/static/schemas/customer.json +++ b/src/static/schemas/customer.json @@ -1656,6 +1656,7 @@ "subscription_failed": { "type": "string", "default": "Payment failed on {{date, date}}" }, "subscription_inactive": { "type": "string", "default": "Inactive" }, "subscription_will_be_cancelled": { "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { "type": "string", "default": "Starts on {{date, date}}" }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "undo_cancel": { "type": "string", "default": "Review" }, @@ -1784,6 +1785,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", @@ -1827,6 +1829,7 @@ "subscription_failed": { "type": "string", "default": "Payment failed on {{date, date}}" }, "subscription_inactive": { "type": "string", "default": "Inactive" }, "subscription_will_be_cancelled": { "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { "type": "string", "default": "Starts on {{date, date}}" }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "update": { "type": "string", "default": "Update" }, @@ -1857,6 +1860,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "update", diff --git a/src/static/schemas/item-form.json b/src/static/schemas/item-form.json index 6da5839fb..a886005fd 100644 --- a/src/static/schemas/item-form.json +++ b/src/static/schemas/item-form.json @@ -143,6 +143,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "undo_cancel": { "type": "string", "default": "Review" }, @@ -276,6 +280,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", @@ -325,6 +330,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "weekly": { "type": "string", "default": "Weekly" }, @@ -355,6 +364,7 @@ "subscription_inactive", "subscription_plural", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "weekly", diff --git a/src/static/schemas/shipment-card.json b/src/static/schemas/shipment-card.json index 21e0f7c67..4d8477bbb 100644 --- a/src/static/schemas/shipment-card.json +++ b/src/static/schemas/shipment-card.json @@ -199,6 +199,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "undo_cancel": { "type": "string", "default": "Review" }, @@ -332,6 +336,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", @@ -384,6 +389,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" @@ -417,6 +426,7 @@ "subscription_inactive", "subscription_plural", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "weekly", diff --git a/src/static/schemas/subscription-card.json b/src/static/schemas/subscription-card.json index 3c038fa34..6386b5625 100644 --- a/src/static/schemas/subscription-card.json +++ b/src/static/schemas/subscription-card.json @@ -24,6 +24,7 @@ "subscription_inactive": { "type": "string", "default": "Inactive" }, "subscription_plural": { "type": "string", "default": "Subscriptions" }, "subscription_will_be_cancelled": { "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { "type": "string", "default": "Starts on {{date, date}}" }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "weekly": { "type": "string", "default": "Weekly" }, @@ -54,6 +55,7 @@ "subscription_inactive", "subscription_plural", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "weekly", diff --git a/src/static/schemas/subscription-form.json b/src/static/schemas/subscription-form.json index d149881c2..11f628b63 100644 --- a/src/static/schemas/subscription-form.json +++ b/src/static/schemas/subscription-form.json @@ -40,6 +40,7 @@ "subscription_failed": { "type": "string", "default": "Payment failed on {{date, date}}" }, "subscription_inactive": { "type": "string", "default": "Inactive" }, "subscription_will_be_cancelled": { "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { "type": "string", "default": "Starts on {{date, date}}" }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "undo_cancel": { "type": "string", "default": "Review" }, @@ -394,6 +395,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", diff --git a/src/static/schemas/subscriptions-table.json b/src/static/schemas/subscriptions-table.json index 15723e271..f154141a3 100644 --- a/src/static/schemas/subscriptions-table.json +++ b/src/static/schemas/subscriptions-table.json @@ -23,6 +23,7 @@ "subscription_failed": { "type": "string", "default": "Payment failed on {{date, date}}" }, "subscription_inactive": { "type": "string", "default": "Inactive" }, "subscription_will_be_cancelled": { "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { "type": "string", "default": "Starts on {{date, date}}" }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "update": { "type": "string", "default": "Update" }, @@ -53,6 +54,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "update", diff --git a/src/static/schemas/transaction.json b/src/static/schemas/transaction.json index eaea247a4..3bce24c69 100644 --- a/src/static/schemas/transaction.json +++ b/src/static/schemas/transaction.json @@ -557,6 +557,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_plural": { "type": "string", "default": "Transactions" }, "twice_a_month": { "type": "string", "default": "Twice a month" }, "undo_cancel": { "type": "string", "default": "Review" }, @@ -688,6 +692,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", @@ -743,6 +748,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" @@ -776,6 +785,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "update", @@ -1278,6 +1288,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_plural": { "type": "string", "default": "Transactions" @@ -1459,6 +1473,7 @@ "subscription_failed", "subscription_inactive", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_plural", "twice_a_month", "undo_cancel", @@ -1523,6 +1538,10 @@ "type": "string", "default": "Ends on {{date, date}}" }, + "subscription_will_be_active": { + "type": "string", + "default": "Starts on {{date, date}}" + }, "transaction_summary": { "type": "string", "default": "{{most_expensive_item.name}}" @@ -1565,6 +1584,7 @@ "subscription_inactive", "subscription_plural", "subscription_will_be_cancelled", + "subscription_will_be_active", "transaction_summary", "twice_a_month", "weekly", diff --git a/src/static/translations/admin-subscription-card/en.json b/src/static/translations/admin-subscription-card/en.json index ba9e10db5..02c8487f0 100644 --- a/src/static/translations/admin-subscription-card/en.json +++ b/src/static/translations/admin-subscription-card/en.json @@ -11,6 +11,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "summary": "{{ firstItem.name }}", "summary_plural": "{{ firstItem.name }} + {{ countMinus1 }} more", "summary_approximate": "{{ firstItem.name }} + more", diff --git a/src/static/translations/cart-form/en.json b/src/static/translations/cart-form/en.json index 935b43139..77c85f374 100644 --- a/src/static/translations/cart-form/en.json +++ b/src/static/translations/cart-form/en.json @@ -132,6 +132,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", @@ -193,6 +194,7 @@ "subscription_inactive": "Inactive", "subscription_plural": "Subscriptions", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "weekly": "Weekly", diff --git a/src/static/translations/customer-portal/en.json b/src/static/translations/customer-portal/en.json index 8fdae5148..b3355d2f4 100644 --- a/src/static/translations/customer-portal/en.json +++ b/src/static/translations/customer-portal/en.json @@ -732,6 +732,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "twice a month", "weekly": "/ week", @@ -774,6 +775,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "update_billing": "Update billing", diff --git a/src/static/translations/customer/en.json b/src/static/translations/customer/en.json index dd1873b6d..abd69c9fd 100644 --- a/src/static/translations/customer/en.json +++ b/src/static/translations/customer/en.json @@ -783,6 +783,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", @@ -847,6 +848,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "update": "Update", diff --git a/src/static/translations/item-form/en.json b/src/static/translations/item-form/en.json index c904954fa..e31649dd9 100644 --- a/src/static/translations/item-form/en.json +++ b/src/static/translations/item-form/en.json @@ -79,6 +79,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", @@ -140,6 +141,7 @@ "subscription_inactive": "Inactive", "subscription_plural": "Subscriptions", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "weekly": "Weekly", diff --git a/src/static/translations/shipment-card/en.json b/src/static/translations/shipment-card/en.json index eab6daf15..cfc24f96c 100644 --- a/src/static/translations/shipment-card/en.json +++ b/src/static/translations/shipment-card/en.json @@ -107,6 +107,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", @@ -168,6 +169,7 @@ "subscription_inactive": "Inactive", "subscription_plural": "Subscriptions", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "weekly": "Weekly", diff --git a/src/static/translations/subscription-card/en.json b/src/static/translations/subscription-card/en.json index fecb7afdd..45549108b 100644 --- a/src/static/translations/subscription-card/en.json +++ b/src/static/translations/subscription-card/en.json @@ -12,6 +12,7 @@ "subscription_inactive": "Inactive", "subscription_plural": "Subscriptions", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "weekly": "Weekly", diff --git a/src/static/translations/subscription-form/en.json b/src/static/translations/subscription-form/en.json index 2f7f2c57e..c37411648 100644 --- a/src/static/translations/subscription-form/en.json +++ b/src/static/translations/subscription-form/en.json @@ -28,6 +28,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", diff --git a/src/static/translations/subscriptions-table/en.json b/src/static/translations/subscriptions-table/en.json index 4a9342393..5efd3726f 100644 --- a/src/static/translations/subscriptions-table/en.json +++ b/src/static/translations/subscriptions-table/en.json @@ -11,6 +11,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "update": "Update", diff --git a/src/static/translations/transaction/en.json b/src/static/translations/transaction/en.json index 810f70dee..67868a160 100644 --- a/src/static/translations/transaction/en.json +++ b/src/static/translations/transaction/en.json @@ -214,6 +214,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", @@ -278,6 +279,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "update": "Update", @@ -509,6 +511,7 @@ "subscription_failed": "Payment failed on {{date, date}}", "subscription_inactive": "Inactive", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_plural": "Transactions", "twice_a_month": "Twice a month", "undo_cancel": "Review", @@ -570,6 +573,7 @@ "subscription_inactive": "Inactive", "subscription_plural": "Subscriptions", "subscription_will_be_cancelled": "Ends on {{date, date}}", + "subscription_will_be_active": "Starts on {{date, date}}", "transaction_summary": "{{most_expensive_item.name}}", "twice_a_month": "Twice a month", "weekly": "Weekly",