@financial-times/n-conversion-forms 45.3.0 → 46.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "83a1121b7dce87aa2750326ecac8b77d696acb9d",
5
- "tag": "v45.3.0",
6
- "buildNumber": "18143"
4
+ "version": "36e9728ddb082df599a9273d3e2c3d5136141d47",
5
+ "tag": "v46.0.0",
6
+ "buildNumber": "18221"
7
7
  }
@@ -97,7 +97,7 @@ exports[`Confirmation renders appropriately if a confirmation email has not been
97
97
  </div>
98
98
  `;
99
99
 
100
- exports[`Confirmation renders appropriately if is 'Evergreen' subscription term type 1`] = `
100
+ exports[`Confirmation renders appropriately if is auto-renewing subscription term type 1`] = `
101
101
  <div class="ncf ncf__wrapper">
102
102
  <div class="ncf__center">
103
103
  <div class="ncf__icon ncf__icon--tick ncf__icon--large">
@@ -147,7 +147,7 @@ exports[`Confirmation renders appropriately if is 'Evergreen' subscription term
147
147
  </div>
148
148
  `;
149
149
 
150
- exports[`Confirmation renders appropriately if is 'Termed' subscription term type 1`] = `
150
+ exports[`Confirmation renders appropriately if is non-renewing subscription term type 1`] = `
151
151
  <div class="ncf ncf__wrapper">
152
152
  <div class="ncf__center">
153
153
  <div class="ncf__icon ncf__icon--tick ncf__icon--large">
@@ -162,7 +162,7 @@ exports[`Confirmation renders appropriately if is 'Termed' subscription term typ
162
162
  We’ve sent confirmation to your email. Make sure you check your spam folder if you don’t receive it.
163
163
  </p>
164
164
  <p class="ncf__paragraph">
165
- Here’s a summary of your subscription:
165
+ Here’s a summary of your purchase:
166
166
  </p>
167
167
  <div class="ncf__headed-paragraph">
168
168
  <h3 class="ncf__header">
@@ -9,7 +9,7 @@ export function AcceptTermsSubscription({
9
9
  isTrial = false,
10
10
  isPrintProduct = false,
11
11
  isSingleTerm = false,
12
- isTermedSubscriptionTermType = false,
12
+ isNonRenewingSubscriptionTermType = false,
13
13
  isTransition = false,
14
14
  transitionType = null,
15
15
  isDeferredBilling = false,
@@ -61,7 +61,7 @@ export function AcceptTermsSubscription({
61
61
  </li>
62
62
  );
63
63
 
64
- if (isTermedSubscriptionTermType) {
64
+ if (isNonRenewingSubscriptionTermType) {
65
65
  return (
66
66
  <div {...divProps}>
67
67
  <ul className="o3-typography-ul ncf__accept-terms-list">
@@ -244,7 +244,7 @@ AcceptTermsSubscription.propTypes = {
244
244
  isTrial: PropTypes.bool,
245
245
  isPrintProduct: PropTypes.bool,
246
246
  isSingleTerm: PropTypes.bool,
247
- isTermedSubscriptionTermType: PropTypes.bool,
247
+ isNonRenewingSubscriptionTermType: PropTypes.bool,
248
248
  isTransition: PropTypes.bool,
249
249
  transitionType: PropTypes.string,
250
250
  isDeferredBilling: PropTypes.bool,
@@ -92,9 +92,9 @@ describe('AcceptTermsSubscription', () => {
92
92
  expect(transitionTerms.exists()).toBe(true);
93
93
  });
94
94
 
95
- it('renders the transition terms when isTermedSubscriptionTermType prop is true', () => {
95
+ it('renders the transition terms when isNonRenewingSubscriptionTermType prop is true', () => {
96
96
  const props = {
97
- isTermedSubscriptionTermType: true,
97
+ isNonRenewingSubscriptionTermType: true,
98
98
  };
99
99
 
100
100
  const component = mount(<AcceptTermsSubscription {...props} />);
@@ -30,12 +30,12 @@ IsSingleTerm.args = {
30
30
  isSingleTerm: true,
31
31
  };
32
32
 
33
- export const TermedSubscriptionTermType = (args) => (
33
+ export const NonRenewingTermType = (args) => (
34
34
  <AcceptTermsSubscription {...args} />
35
35
  );
36
36
 
37
- TermedSubscriptionTermType.args = {
38
- isTermedSubscriptionTermType: true,
37
+ NonRenewingTermType.args = {
38
+ isNonRenewingSubscriptionTermType: true,
39
39
  };
40
40
 
41
41
  export const IsTransition = (args) => <AcceptTermsSubscription {...args} />;
@@ -9,8 +9,8 @@ export function Confirmation({
9
9
  isB2cPartnership = false,
10
10
  b2cPartnershipCopy = [],
11
11
  sendConfirmationEmail = true,
12
- isEvergreenSubscriptionTermType = true,
13
- isTermedSubscriptionTermType = false,
12
+ isAutoRenewingSubscriptionTermType = true,
13
+ isNonRenewingSubscriptionTermType = false,
14
14
  offer = '',
15
15
  email = EMAIL_DEFAULT_TEXT,
16
16
  details = null,
@@ -65,8 +65,9 @@ export function Confirmation({
65
65
  <div className="ncf__center">
66
66
  <div className="ncf__icon ncf__icon--tick ncf__icon--large"></div>
67
67
  <p className="ncf__paragraph--reduced-padding ncf__paragraph--subscription-confirmation">
68
- {isEvergreenSubscriptionTermType && 'You are now subscribed to:'}
69
- {isTermedSubscriptionTermType && 'Your purchase is complete for:'}
68
+ {isAutoRenewingSubscriptionTermType && 'You are now subscribed to:'}
69
+ {isNonRenewingSubscriptionTermType &&
70
+ 'Your purchase is complete for:'}
70
71
  </p>
71
72
  <h1 className="ncf__header ncf__header--confirmation">{offer}</h1>
72
73
  </div>
@@ -92,7 +93,9 @@ export function Confirmation({
92
93
  {newsletterScheduleExplainer}
93
94
 
94
95
  <p className="ncf__paragraph">
95
- Here’s a summary of your {offer} subscription:
96
+ Here’s a summary of your {offer}{' '}
97
+ {isAutoRenewingSubscriptionTermType && 'subscription'}
98
+ {isNonRenewingSubscriptionTermType && 'purchase'}:
96
99
  </p>
97
100
 
98
101
  {detailElements}
@@ -117,7 +120,7 @@ export function Confirmation({
117
120
  </p>
118
121
  </div>
119
122
 
120
- {isEvergreenSubscriptionTermType && (
123
+ {isAutoRenewingSubscriptionTermType && (
121
124
  <p className="ncf__paragraph o3-type-body-base">
122
125
  We will automatically renew your subscription using the payment method
123
126
  provided unless you cancel before your renewal date. See our{' '}
@@ -142,8 +145,8 @@ Confirmation.propTypes = {
142
145
  isB2cPartnership: PropTypes.bool,
143
146
  b2cPartnershipCopy: PropTypes.array,
144
147
  sendConfirmationEmail: PropTypes.bool,
145
- isEvergreenSubscriptionTermType: PropTypes.bool,
146
- isTermedSubscriptionTermType: PropTypes.bool,
148
+ isAutoRenewingSubscriptionTermType: PropTypes.bool,
149
+ isNonRenewingSubscriptionTermType: PropTypes.bool,
147
150
  offer: PropTypes.string.isRequired,
148
151
  email: PropTypes.string,
149
152
  details: PropTypes.arrayOf(
@@ -29,19 +29,19 @@ describe('Confirmation', () => {
29
29
  expect(Confirmation).toRenderCorrectly(props);
30
30
  });
31
31
 
32
- it("renders appropriately if is 'Evergreen' subscription term type", () => {
32
+ it('renders appropriately if is auto-renewing subscription term type', () => {
33
33
  const props = {
34
- isEvergreenSubscriptionTermType: true,
35
- isTermedSubscriptionTermType: false,
34
+ isAutoRenewingSubscriptionTermType: true,
35
+ isNonRenewingSubscriptionTermType: false,
36
36
  };
37
37
 
38
38
  expect(Confirmation).toRenderCorrectly(props);
39
39
  });
40
40
 
41
- it("renders appropriately if is 'Termed' subscription term type", () => {
41
+ it('renders appropriately if is non-renewing subscription term type', () => {
42
42
  const props = {
43
- isEvergreenSubscriptionTermType: false,
44
- isTermedSubscriptionTermType: true,
43
+ isAutoRenewingSubscriptionTermType: false,
44
+ isNonRenewingSubscriptionTermType: true,
45
45
  };
46
46
 
47
47
  expect(Confirmation).toRenderCorrectly(props);
@@ -63,12 +63,12 @@ Basic.args = {
63
63
  newsletterScheduleExplainer,
64
64
  };
65
65
 
66
- export const TermedSubscriptionTermType = (args) => <Confirmation {...args} />;
67
- TermedSubscriptionTermType.args = {
66
+ export const NonRenewingTermType = (args) => <Confirmation {...args} />;
67
+ NonRenewingTermType.args = {
68
68
  sendConfirmationEmail: false,
69
- isEvergreenTermedSubscriptionTermType: false,
70
- isTermedSubscriptionTermType: true,
71
- offer: 'Single-term subscription',
69
+ isAutoRenewingSubscriptionTermType: false,
70
+ isNonRenewingSubscriptionTermType: true,
71
+ offer: 'Standard Digital',
72
72
  details: [
73
73
  {
74
74
  title: 'End date',
@@ -10,8 +10,8 @@ export function DeliveryOption({
10
10
  productCode = undefined,
11
11
  options = [],
12
12
  isSingle = false,
13
- isEvergreenSubscriptionTermType = true,
14
- isTermedSubscriptionTermType = false,
13
+ isAutoRenewingSubscriptionTermType = true,
14
+ isNonRenewingSubscriptionTermType = false,
15
15
  }) {
16
16
  const divClassName = classNames([
17
17
  'o-forms-field',
@@ -36,8 +36,8 @@ export function DeliveryOption({
36
36
  option,
37
37
  shippingZone,
38
38
  countryCode,
39
- isEvergreenSubscriptionTermType,
40
- isTermedSubscriptionTermType,
39
+ isAutoRenewingSubscriptionTermType,
40
+ isNonRenewingSubscriptionTermType,
41
41
  });
42
42
 
43
43
  if (!isValidDeliveryOption || !deliveryOptionValue) {
@@ -100,6 +100,6 @@ DeliveryOption.propTypes = {
100
100
  })
101
101
  ),
102
102
  isSingle: PropTypes.bool,
103
- isEvergreenSubscriptionTermType: PropTypes.bool,
104
- isTermedSubscriptionTermType: PropTypes.bool,
103
+ isAutoRenewingSubscriptionTermType: PropTypes.bool,
104
+ isNonRenewingSubscriptionTermType: PropTypes.bool,
105
105
  };
@@ -34,12 +34,12 @@ Basic.args = {
34
34
  ],
35
35
  };
36
36
 
37
- export const UKPaperVoucherEvergreenDeliveryOptions = (args) => (
37
+ export const UKPaperVoucherAutoReniewingDeliveryOptions = (args) => (
38
38
  <div className="ncf">
39
39
  <DeliveryOption {...args} />
40
40
  </div>
41
41
  );
42
- UKPaperVoucherEvergreenDeliveryOptions.args = {
42
+ UKPaperVoucherAutoReniewingDeliveryOptions.args = {
43
43
  country: 'GBR',
44
44
  options: [
45
45
  {
@@ -47,16 +47,16 @@ UKPaperVoucherEvergreenDeliveryOptions.args = {
47
47
  isValidDeliveryOption: true,
48
48
  },
49
49
  ],
50
- isEvergreenSubscriptionTermType: true,
51
- isTermedSubscriptionTermType: false,
50
+ isAutoRenewingSubscriptionTermType: true,
51
+ isNonRenewingSubscriptionTermType: false,
52
52
  };
53
53
 
54
- export const UKPaperVoucherTermedDeliveryOptions = (args) => (
54
+ export const UKPaperVoucherNonRenewingDeliveryOptions = (args) => (
55
55
  <div className="ncf">
56
56
  <DeliveryOption {...args} />
57
57
  </div>
58
58
  );
59
- UKPaperVoucherTermedDeliveryOptions.args = {
59
+ UKPaperVoucherNonRenewingDeliveryOptions.args = {
60
60
  country: 'GBR',
61
61
  options: [
62
62
  {
@@ -64,8 +64,8 @@ UKPaperVoucherTermedDeliveryOptions.args = {
64
64
  isValidDeliveryOption: true,
65
65
  },
66
66
  ],
67
- isEvergreenSubscriptionTermType: false,
68
- isTermedSubscriptionTermType: true,
67
+ isAutoRenewingSubscriptionTermType: false,
68
+ isNonRenewingSubscriptionTermType: true,
69
69
  };
70
70
 
71
71
  export const UnitedStates5or6DaysWeekDeliveryOptions = (args) => (
@@ -13,8 +13,8 @@ export function PaymentTerm({
13
13
  largePrice = false,
14
14
  optionsInARow = false,
15
15
  billingCountry = '',
16
- isEvergreenSubscriptionTermType = true,
17
- isTermedSubscriptionTermType = false,
16
+ isAutoRenewingSubscriptionTermType = true,
17
+ isNonRenewingSubscriptionTermType = false,
18
18
  }) {
19
19
  /**
20
20
  * Compute monthly price for given term name
@@ -228,7 +228,7 @@ export function PaymentTerm({
228
228
  <div className="ncf__payment-term__description">
229
229
  {nameMap[option.name].price(option.price)}
230
230
  {nameMap[option.name].monthlyPrice(option.monthlyPrice)}
231
- {isEvergreenSubscriptionTermType &&
231
+ {isAutoRenewingSubscriptionTermType &&
232
232
  nameMap[option.name].renewsText()}
233
233
  {/* Remove this discount text temporarily in favour of monthly price */}
234
234
  {/* <br />Save up to 25% when you pay annually */}
@@ -247,7 +247,7 @@ export function PaymentTerm({
247
247
  option.value
248
248
  )
249
249
  )}
250
- {isEvergreenSubscriptionTermType &&
250
+ {isAutoRenewingSubscriptionTermType &&
251
251
  nameMap['custom'].renewsText(getTimeFromPeriod(option.value))}
252
252
  </div>
253
253
  ) : (
@@ -344,7 +344,7 @@ export function PaymentTerm({
344
344
 
345
345
  {showLegal && (
346
346
  <div className="ncf__payment-term__legal">
347
- {isEvergreenSubscriptionTermType && (
347
+ {isAutoRenewingSubscriptionTermType && (
348
348
  <React.Fragment>
349
349
  <p>
350
350
  With all subscription types, we will automatically renew your
@@ -368,7 +368,7 @@ export function PaymentTerm({
368
368
  </React.Fragment>
369
369
  )}
370
370
 
371
- {isTermedSubscriptionTermType && (
371
+ {isNonRenewingSubscriptionTermType && (
372
372
  <p className="o3-type-body-base">
373
373
  Find out more about our cancellation policy in our{' '}
374
374
  <a
@@ -415,8 +415,8 @@ PaymentTerm.propTypes = {
415
415
  fulfilmentOption: PropTypes.string,
416
416
  })
417
417
  ),
418
- isEvergreenSubscriptionTermType: PropTypes.bool,
419
- isTermedSubscriptionTermType: PropTypes.bool,
418
+ isAutoRenewingSubscriptionTermType: PropTypes.bool,
419
+ isNonRenewingSubscriptionTermType: PropTypes.bool,
420
420
  showLegal: PropTypes.bool,
421
421
  largePrice: PropTypes.bool,
422
422
  optionsInARow: PropTypes.bool,
@@ -117,7 +117,7 @@ describe('PaymentTerm', () => {
117
117
  });
118
118
  });
119
119
 
120
- describe('isEvergreenSubscriptionTermType is true; isTermedSubscriptionTermType is false', () => {
120
+ describe('isAutoRenewingSubscriptionTermType is true; isNonRenewingSubscriptionTermType is false', () => {
121
121
  describe('pre-defined option name (i.e. frequency)', () => {
122
122
  const ANNUAL_FREQUENCY = 'annual';
123
123
  const QUARTERLY_FREQUENCY = 'quarterly';
@@ -144,8 +144,8 @@ describe('PaymentTerm', () => {
144
144
  const wrapper = shallow(
145
145
  <PaymentTerm
146
146
  options={options}
147
- isEvergreenSubscriptionTermType={true}
148
- isTermedSubscriptionTermType={false}
147
+ isAutoRenewingSubscriptionTermType={true}
148
+ isNonRenewingSubscriptionTermType={false}
149
149
  />
150
150
  );
151
151
  expect(
@@ -174,8 +174,8 @@ describe('PaymentTerm', () => {
174
174
  const wrapper = shallow(
175
175
  <PaymentTerm
176
176
  options={options}
177
- isEvergreenSubscriptionTermType={true}
178
- isTermedSubscriptionTermType={false}
177
+ isAutoRenewingSubscriptionTermType={true}
178
+ isNonRenewingSubscriptionTermType={false}
179
179
  />
180
180
  );
181
181
  expect(wrapper.find('.ncf__payment-term__renews-text').text()).toBe(
@@ -185,7 +185,7 @@ describe('PaymentTerm', () => {
185
185
  });
186
186
  });
187
187
 
188
- describe('isEvergreenSubscriptionTermType is false; isTermedSubscriptionTermType is true', () => {
188
+ describe('isAutoRenewingSubscriptionTermType is false; isNonRenewingSubscriptionTermType is true', () => {
189
189
  describe('options include duration expressed in weeks', () => {
190
190
  const options = [
191
191
  {
@@ -197,8 +197,8 @@ describe('PaymentTerm', () => {
197
197
  const wrapper = shallow(
198
198
  <PaymentTerm
199
199
  options={options}
200
- isEvergreenSubscriptionTermType={false}
201
- isTermedSubscriptionTermType={true}
200
+ isAutoRenewingSubscriptionTermType={false}
201
+ isNonRenewingSubscriptionTermType={true}
202
202
  />
203
203
  );
204
204
 
@@ -208,7 +208,7 @@ describe('PaymentTerm', () => {
208
208
  );
209
209
  });
210
210
 
211
- it('renders description text that reflects that the termed subscription requires a single payment that expresses the per duration cost for shorter durations', () => {
211
+ it('renders description text that reflects that the non-renewing subscription requires a single payment that expresses the per duration cost for shorter durations', () => {
212
212
  expect(
213
213
  wrapper.find('.ncf__payment-term__description').text()
214
214
  ).toContain(
@@ -228,8 +228,8 @@ describe('PaymentTerm', () => {
228
228
  const wrapper = shallow(
229
229
  <PaymentTerm
230
230
  options={options}
231
- isEvergreenSubscriptionTermType={false}
232
- isTermedSubscriptionTermType={true}
231
+ isAutoRenewingSubscriptionTermType={false}
232
+ isNonRenewingSubscriptionTermType={true}
233
233
  />
234
234
  );
235
235
 
@@ -239,7 +239,7 @@ describe('PaymentTerm', () => {
239
239
  );
240
240
  });
241
241
 
242
- it('renders description text that reflects that the termed subscription requires a single payment that expresses the per duration cost for shorter durations', () => {
242
+ it('renders description text that reflects that the non-renewing subscription requires a single payment that expresses the per duration cost for shorter durations', () => {
243
243
  expect(
244
244
  wrapper.find('.ncf__payment-term__description').text()
245
245
  ).toContain(
@@ -261,8 +261,8 @@ describe('PaymentTerm', () => {
261
261
  const wrapper = shallow(
262
262
  <PaymentTerm
263
263
  options={options}
264
- isEvergreenSubscriptionTermType={false}
265
- isTermedSubscriptionTermType={true}
264
+ isAutoRenewingSubscriptionTermType={false}
265
+ isNonRenewingSubscriptionTermType={true}
266
266
  />
267
267
  );
268
268
  expect(wrapper.find('.ncf__payment-term__renews-text').exists()).toBe(
@@ -90,14 +90,14 @@ Basic.args = {
90
90
  ],
91
91
  };
92
92
 
93
- export const TermedSubscriptionTermType = (args) => (
93
+ export const NonRenewingTermType = (args) => (
94
94
  <div className="ncf">
95
95
  <Fieldset>
96
96
  <PaymentTerm {...args} />
97
97
  </Fieldset>
98
98
  </div>
99
99
  );
100
- TermedSubscriptionTermType.args = {
100
+ NonRenewingTermType.args = {
101
101
  options: [
102
102
  {
103
103
  name: '8 weeks',
@@ -106,7 +106,7 @@ TermedSubscriptionTermType.args = {
106
106
  value: 'P8W',
107
107
  },
108
108
  ],
109
- isTermedSubscriptionTermType: true,
109
+ isNonRenewingSubscriptionTermType: true,
110
110
  };
111
111
 
112
112
  export const RenewOffers = (args) => (
@@ -25,8 +25,8 @@ function AcceptTermsSubscription(_ref) {
25
25
  isPrintProduct = _ref$isPrintProduct === void 0 ? false : _ref$isPrintProduct,
26
26
  _ref$isSingleTerm = _ref.isSingleTerm,
27
27
  isSingleTerm = _ref$isSingleTerm === void 0 ? false : _ref$isSingleTerm,
28
- _ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
29
- isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip,
28
+ _ref$isNonRenewingSub = _ref.isNonRenewingSubscriptionTermType,
29
+ isNonRenewingSubscriptionTermType = _ref$isNonRenewingSub === void 0 ? false : _ref$isNonRenewingSub,
30
30
  _ref$isTransition = _ref.isTransition,
31
31
  isTransition = _ref$isTransition === void 0 ? false : _ref$isTransition,
32
32
  _ref$transitionType = _ref.transitionType,
@@ -61,7 +61,7 @@ function AcceptTermsSubscription(_ref) {
61
61
  target: isEmbedded ? '_top' : '_blank',
62
62
  rel: "noopener noreferrer"
63
63
  }, "customer care through chat, phone or email"), "."));
64
- if (isTermedSubscriptionTermType) {
64
+ if (isNonRenewingSubscriptionTermType) {
65
65
  return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
66
66
  className: "o3-typography-ul ncf__accept-terms-list"
67
67
  }, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
@@ -135,7 +135,7 @@ AcceptTermsSubscription.propTypes = {
135
135
  isTrial: _propTypes["default"].bool,
136
136
  isPrintProduct: _propTypes["default"].bool,
137
137
  isSingleTerm: _propTypes["default"].bool,
138
- isTermedSubscriptionTermType: _propTypes["default"].bool,
138
+ isNonRenewingSubscriptionTermType: _propTypes["default"].bool,
139
139
  isTransition: _propTypes["default"].bool,
140
140
  transitionType: _propTypes["default"].string,
141
141
  isDeferredBilling: _propTypes["default"].bool,
@@ -20,10 +20,10 @@ function Confirmation(_ref) {
20
20
  b2cPartnershipCopy = _ref$b2cPartnershipCo === void 0 ? [] : _ref$b2cPartnershipCo,
21
21
  _ref$sendConfirmation = _ref.sendConfirmationEmail,
22
22
  sendConfirmationEmail = _ref$sendConfirmation === void 0 ? true : _ref$sendConfirmation,
23
- _ref$isEvergreenSubsc = _ref.isEvergreenSubscriptionTermType,
24
- isEvergreenSubscriptionTermType = _ref$isEvergreenSubsc === void 0 ? true : _ref$isEvergreenSubsc,
25
- _ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
26
- isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip,
23
+ _ref$isAutoRenewingSu = _ref.isAutoRenewingSubscriptionTermType,
24
+ isAutoRenewingSubscriptionTermType = _ref$isAutoRenewingSu === void 0 ? true : _ref$isAutoRenewingSu,
25
+ _ref$isNonRenewingSub = _ref.isNonRenewingSubscriptionTermType,
26
+ isNonRenewingSubscriptionTermType = _ref$isNonRenewingSub === void 0 ? false : _ref$isNonRenewingSub,
27
27
  _ref$offer = _ref.offer,
28
28
  offer = _ref$offer === void 0 ? '' : _ref$offer,
29
29
  _ref$email = _ref.email,
@@ -74,7 +74,7 @@ function Confirmation(_ref) {
74
74
  className: "ncf__icon ncf__icon--tick ncf__icon--large"
75
75
  }), /*#__PURE__*/_react["default"].createElement("p", {
76
76
  className: "ncf__paragraph--reduced-padding ncf__paragraph--subscription-confirmation"
77
- }, isEvergreenSubscriptionTermType && 'You are now subscribed to:', isTermedSubscriptionTermType && 'Your purchase is complete for:'), /*#__PURE__*/_react["default"].createElement("h1", {
77
+ }, isAutoRenewingSubscriptionTermType && 'You are now subscribed to:', isNonRenewingSubscriptionTermType && 'Your purchase is complete for:'), /*#__PURE__*/_react["default"].createElement("h1", {
78
78
  className: "ncf__header ncf__header--confirmation"
79
79
  }, offer)), nextActionTop, sendConfirmationEmail && !isB2cPartnershipCopyAvailable && /*#__PURE__*/_react["default"].createElement("p", {
80
80
  className: "ncf__paragraph"
@@ -84,7 +84,7 @@ function Confirmation(_ref) {
84
84
  className: "ncf__legend"
85
85
  }, " ".concat(email, ". ")), b2cPartnershipCopy[1]) : '', newsletterScheduleExplainer, /*#__PURE__*/_react["default"].createElement("p", {
86
86
  className: "ncf__paragraph"
87
- }, "Here\u2019s a summary of your ", offer, " subscription:"), detailElements, directDebitMandateUrlElement, /*#__PURE__*/_react["default"].createElement("div", {
87
+ }, "Here\u2019s a summary of your ", offer, ' ', isAutoRenewingSubscriptionTermType && 'subscription', isNonRenewingSubscriptionTermType && 'purchase', ":"), detailElements, directDebitMandateUrlElement, /*#__PURE__*/_react["default"].createElement("div", {
88
88
  className: "ncf__headed-paragraph"
89
89
  }, /*#__PURE__*/_react["default"].createElement("h3", {
90
90
  className: "ncf__header"
@@ -97,7 +97,7 @@ function Confirmation(_ref) {
97
97
  "data-trackable": "yourAccount"
98
98
  }, "account settings"), ' ', "to view or edit your account. If you need to get in touch call us on", ' ', /*#__PURE__*/_react["default"].createElement("a", {
99
99
  href: "tel:+442077556248"
100
- }, "+44 (0) 207 755 6248"), ". Or contact us for additional support.")), isEvergreenSubscriptionTermType && /*#__PURE__*/_react["default"].createElement("p", {
100
+ }, "+44 (0) 207 755 6248"), ". Or contact us for additional support.")), isAutoRenewingSubscriptionTermType && /*#__PURE__*/_react["default"].createElement("p", {
101
101
  className: "ncf__paragraph o3-type-body-base"
102
102
  }, "We will automatically renew your subscription using the payment method provided unless you cancel before your renewal date. See our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
103
103
  href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
@@ -110,8 +110,8 @@ Confirmation.propTypes = {
110
110
  isB2cPartnership: _propTypes["default"].bool,
111
111
  b2cPartnershipCopy: _propTypes["default"].array,
112
112
  sendConfirmationEmail: _propTypes["default"].bool,
113
- isEvergreenSubscriptionTermType: _propTypes["default"].bool,
114
- isTermedSubscriptionTermType: _propTypes["default"].bool,
113
+ isAutoRenewingSubscriptionTermType: _propTypes["default"].bool,
114
+ isNonRenewingSubscriptionTermType: _propTypes["default"].bool,
115
115
  offer: _propTypes["default"].string.isRequired,
116
116
  email: _propTypes["default"].string,
117
117
  details: _propTypes["default"].arrayOf(_propTypes["default"].shape({
@@ -20,10 +20,10 @@ function DeliveryOption(_ref) {
20
20
  options = _ref$options === void 0 ? [] : _ref$options,
21
21
  _ref$isSingle = _ref.isSingle,
22
22
  isSingle = _ref$isSingle === void 0 ? false : _ref$isSingle,
23
- _ref$isEvergreenSubsc = _ref.isEvergreenSubscriptionTermType,
24
- isEvergreenSubscriptionTermType = _ref$isEvergreenSubsc === void 0 ? true : _ref$isEvergreenSubsc,
25
- _ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
26
- isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip;
23
+ _ref$isAutoRenewingSu = _ref.isAutoRenewingSubscriptionTermType,
24
+ isAutoRenewingSubscriptionTermType = _ref$isAutoRenewingSu === void 0 ? true : _ref$isAutoRenewingSu,
25
+ _ref$isNonRenewingSub = _ref.isNonRenewingSubscriptionTermType,
26
+ isNonRenewingSubscriptionTermType = _ref$isNonRenewingSub === void 0 ? false : _ref$isNonRenewingSub;
27
27
  var divClassName = (0, _classnames["default"])(['o-forms-field', 'ncf__delivery-option', {
28
28
  'ncf__delivery-option--single': isSingle
29
29
  }]);
@@ -44,8 +44,8 @@ function DeliveryOption(_ref) {
44
44
  option: option,
45
45
  shippingZone: shippingZone,
46
46
  countryCode: countryCode,
47
- isEvergreenSubscriptionTermType: isEvergreenSubscriptionTermType,
48
- isTermedSubscriptionTermType: isTermedSubscriptionTermType
47
+ isAutoRenewingSubscriptionTermType: isAutoRenewingSubscriptionTermType,
48
+ isNonRenewingSubscriptionTermType: isNonRenewingSubscriptionTermType
49
49
  });
50
50
  if (!isValidDeliveryOption || !deliveryOptionValue) {
51
51
  return null;
@@ -88,6 +88,6 @@ DeliveryOption.propTypes = {
88
88
  mailDelivery: _propTypes["default"].bool
89
89
  })),
90
90
  isSingle: _propTypes["default"].bool,
91
- isEvergreenSubscriptionTermType: _propTypes["default"].bool,
92
- isTermedSubscriptionTermType: _propTypes["default"].bool
91
+ isAutoRenewingSubscriptionTermType: _propTypes["default"].bool,
92
+ isNonRenewingSubscriptionTermType: _propTypes["default"].bool
93
93
  };
@@ -31,10 +31,10 @@ function PaymentTerm(_ref) {
31
31
  optionsInARow = _ref$optionsInARow === void 0 ? false : _ref$optionsInARow,
32
32
  _ref$billingCountry = _ref.billingCountry,
33
33
  billingCountry = _ref$billingCountry === void 0 ? '' : _ref$billingCountry,
34
- _ref$isEvergreenSubsc = _ref.isEvergreenSubscriptionTermType,
35
- isEvergreenSubscriptionTermType = _ref$isEvergreenSubsc === void 0 ? true : _ref$isEvergreenSubsc,
36
- _ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
37
- isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip;
34
+ _ref$isAutoRenewingSu = _ref.isAutoRenewingSubscriptionTermType,
35
+ isAutoRenewingSubscriptionTermType = _ref$isAutoRenewingSu === void 0 ? true : _ref$isAutoRenewingSu,
36
+ _ref$isNonRenewingSub = _ref.isNonRenewingSubscriptionTermType,
37
+ isNonRenewingSubscriptionTermType = _ref$isNonRenewingSub === void 0 ? false : _ref$isNonRenewingSub;
38
38
  /**
39
39
  * Compute monthly price for given term name
40
40
  * @param {number} amount price in number format
@@ -199,12 +199,12 @@ function PaymentTerm(_ref) {
199
199
  className: "ncf__payment-term__trial-price"
200
200
  }, option.trialPrice), /*#__PURE__*/_react["default"].createElement("br", null), nameMap[option.name] && nameMap[option.name].trialPrice(option.price)) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, nameMap[option.name] ? /*#__PURE__*/_react["default"].createElement("div", {
201
201
  className: "ncf__payment-term__description"
202
- }, nameMap[option.name].price(option.price), nameMap[option.name].monthlyPrice(option.monthlyPrice), isEvergreenSubscriptionTermType && nameMap[option.name].renewsText()) :
202
+ }, nameMap[option.name].price(option.price), nameMap[option.name].monthlyPrice(option.monthlyPrice), isAutoRenewingSubscriptionTermType && nameMap[option.name].renewsText()) :
203
203
  // this should cover the cases different than annual, quarterly and monthly
204
204
  // for those containing period on option.value, render custom template, for the rest keep legacy render
205
205
  isValidPeriod(option.value) ? /*#__PURE__*/_react["default"].createElement("div", {
206
206
  className: "ncf__payment-term__description"
207
- }, nameMap['custom'].price(option.price), nameMap['custom'].monthlyPrice(option.monthlyPrice && option.monthlyPrice !== '0' ? Number(option.monthlyPrice) : getMonthlyPriceFromPeriod(option.amount, option.currency, option.value)), isEvergreenSubscriptionTermType && nameMap['custom'].renewsText(getTimeFromPeriod(option.value))) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
207
+ }, nameMap['custom'].price(option.price), nameMap['custom'].monthlyPrice(option.monthlyPrice && option.monthlyPrice !== '0' ? Number(option.monthlyPrice) : getMonthlyPriceFromPeriod(option.amount, option.currency, option.value)), isAutoRenewingSubscriptionTermType && nameMap['custom'].renewsText(getTimeFromPeriod(option.value))) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
208
208
  className: largePrice ? 'ncf__payment-term__large-price' : ''
209
209
  }, option.price), option.chargeOnText && /*#__PURE__*/_react["default"].createElement("p", {
210
210
  className: "ncf__payment-term__charge-on-text"
@@ -258,14 +258,14 @@ function PaymentTerm(_ref) {
258
258
  return createPaymentTerm(option);
259
259
  })), showLegal && /*#__PURE__*/_react["default"].createElement("div", {
260
260
  className: "ncf__payment-term__legal"
261
- }, isEvergreenSubscriptionTermType && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("p", null, "With all subscription types, we will automatically renew your subscription using the payment method provided unless you cancel before your renewal date."), /*#__PURE__*/_react["default"].createElement("p", {
261
+ }, isAutoRenewingSubscriptionTermType && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("p", null, "With all subscription types, we will automatically renew your subscription using the payment method provided unless you cancel before your renewal date."), /*#__PURE__*/_react["default"].createElement("p", {
262
262
  className: "o3-type-body-base"
263
263
  }, "We will notify you at least 14 days in advance of any changes to the price in your subscription that would apply upon next renewal. Find out more about our cancellation policy in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
264
264
  href: "https://help.ft.com/legal-privacy/terms-and-conditions/",
265
265
  title: "FT Legal Terms and Conditions help page",
266
266
  target: "_blank",
267
267
  rel: "noopener noreferrer"
268
- }, "Terms & Conditions"), ".")), isTermedSubscriptionTermType && /*#__PURE__*/_react["default"].createElement("p", {
268
+ }, "Terms & Conditions"), ".")), isNonRenewingSubscriptionTermType && /*#__PURE__*/_react["default"].createElement("p", {
269
269
  className: "o3-type-body-base"
270
270
  }, "Find out more about our cancellation policy in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
271
271
  href: "https://help.ft.com/legal-privacy/terms-and-conditions/",
@@ -299,8 +299,8 @@ PaymentTerm.propTypes = {
299
299
  chargeOnText: _propTypes["default"].string,
300
300
  fulfilmentOption: _propTypes["default"].string
301
301
  })),
302
- isEvergreenSubscriptionTermType: _propTypes["default"].bool,
303
- isTermedSubscriptionTermType: _propTypes["default"].bool,
302
+ isAutoRenewingSubscriptionTermType: _propTypes["default"].bool,
303
+ isNonRenewingSubscriptionTermType: _propTypes["default"].bool,
304
304
  showLegal: _propTypes["default"].bool,
305
305
  largePrice: _propTypes["default"].bool,
306
306
  optionsInARow: _propTypes["default"].bool,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "45.3.0",
3
+ "version": "46.0.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acquisition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -40,19 +40,19 @@ const countryCodeToCustomDeliveryOptionsMap = {
40
40
  PV: {
41
41
  title: 'Paper vouchers',
42
42
  description: ({
43
- isEvergreenSubscriptionTermType,
44
- isTermedSubscriptionTermType,
43
+ isAutoRenewingSubscriptionTermType,
44
+ isNonRenewingSubscriptionTermType,
45
45
  }) => {
46
- if (isEvergreenSubscriptionTermType) {
46
+ if (isAutoRenewingSubscriptionTermType) {
47
47
  return '13-week voucher pack delivered quarterly and redeemable at retailers nationwide.';
48
48
  }
49
49
 
50
- if (isTermedSubscriptionTermType) {
50
+ if (isNonRenewingSubscriptionTermType) {
51
51
  // Note: This wording relates to a specific offer: UK Retail Sampling
52
52
  // • Production environment offer ID: f9f6383d-98fd-4655-9bc8-2b22bfda8bab
53
53
  // • Test environment offer ID: 83fd2c19-2899-4e59-8929-aeb1e0cae096
54
54
  // Should in the future there be additional offers for
55
- // Termed subscriptions then this approach will need to be revised.
55
+ // non-renewing subscriptions then this approach will need to be revised.
56
56
  return '6 flexible vouchers that can be exchanged for a copy of FT Weekend over a 13-week period at retailers nationwide.';
57
57
  }
58
58
 
@@ -331,8 +331,8 @@ function getDeliveryOption({
331
331
  option,
332
332
  shippingZone,
333
333
  countryCode,
334
- isEvergreenSubscriptionTermType,
335
- isTermedSubscriptionTermType,
334
+ isAutoRenewingSubscriptionTermType,
335
+ isNonRenewingSubscriptionTermType,
336
336
  }) {
337
337
  let deliveryOption;
338
338
 
@@ -347,8 +347,8 @@ function getDeliveryOption({
347
347
  ...deliveryOption,
348
348
  // Set `description` value as string returned from function.
349
349
  description: deliveryOption?.description({
350
- isEvergreenSubscriptionTermType,
351
- isTermedSubscriptionTermType,
350
+ isAutoRenewingSubscriptionTermType,
351
+ isNonRenewingSubscriptionTermType,
352
352
  }),
353
353
  };
354
354
 
@@ -142,8 +142,8 @@ describe('Find Custom Delivery Option', () => {
142
142
  });
143
143
 
144
144
  describe('find UK Paper Vouchers delivery option', () => {
145
- describe('Evergreen (i.e. recurring) subscription term type', () => {
146
- it('returns UK Paper Vouchers delivery option for Evergreen subscription term type', () => {
145
+ describe('Auto-renewing subscription term type', () => {
146
+ it('returns UK Paper Vouchers delivery option for auto-renewing subscription term type', () => {
147
147
  const expected = {
148
148
  title: 'Paper vouchers',
149
149
  description:
@@ -155,16 +155,16 @@ describe('Find Custom Delivery Option', () => {
155
155
  option: { value: 'PV' },
156
156
  shippingZone: 'GBR',
157
157
  countryCode: 'GBR',
158
- isEvergreenSubscriptionTermType: true,
159
- isTermedSubscriptionTermType: false,
158
+ isAutoRenewingSubscriptionTermType: true,
159
+ isNonRenewingSubscriptionTermType: false,
160
160
  });
161
161
 
162
162
  expect(deliveryOption).toEqual(expected);
163
163
  });
164
164
  });
165
165
 
166
- describe('Termed (i.e. single-term) subscription term type', () => {
167
- it('returns UK Paper Vouchers delivery option for Termed subscription term type', () => {
166
+ describe('Non-renewing subscription term type', () => {
167
+ it('returns UK Paper Vouchers delivery option for non-renewing subscription term type', () => {
168
168
  const expected = {
169
169
  title: 'Paper vouchers',
170
170
  description:
@@ -176,8 +176,8 @@ describe('Find Custom Delivery Option', () => {
176
176
  option: { value: 'PV' },
177
177
  shippingZone: 'GBR',
178
178
  countryCode: 'GBR',
179
- isEvergreenSubscriptionTermType: false,
180
- isTermedSubscriptionTermType: true,
179
+ isAutoRenewingSubscriptionTermType: false,
180
+ isNonRenewingSubscriptionTermType: true,
181
181
  });
182
182
 
183
183
  expect(deliveryOption).toEqual(expected);