@financial-times/n-conversion-forms 32.12.0 → 33.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,6 +1,6 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "c7bf91fc151991e214cb6ee5d430825c6f9adefa",
5
- "tag": "v32.12.0"
4
+ "version": "a095aefdcff4fca917872327a21f932adbf4b010",
5
+ "tag": "v33.0.0"
6
6
  }
@@ -1,20 +1,5 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`PackageChange annual render when is7DayPassExperiment is true 1`] = `
4
- <div class="ncf__package-change">
5
- <div class="ncf__package-change__package">
6
- <div class="ncf__package-change__content">
7
- <p>
8
- You have chosen
9
- <span class="ncf__strong">
10
- Trial
11
- </span>
12
- </p>
13
- </div>
14
- </div>
15
- </div>
16
- `;
17
-
18
3
  exports[`PackageChange annual render with defaults 1`] = `
19
4
  <div class="ncf__package-change">
20
5
  <div class="ncf__package-change__package">
@@ -9,7 +9,6 @@ export function AcceptTermsSubscription({
9
9
  isTrial = false,
10
10
  isPrintProduct = false,
11
11
  isSingleTerm = false,
12
- is7DayPassExperiment = false,
13
12
  isTermedSubscriptionTermType = false,
14
13
  isTransition = false,
15
14
  transitionType = null,
@@ -39,56 +38,6 @@ export function AcceptTermsSubscription({
39
38
  required: true,
40
39
  };
41
40
 
42
- if (is7DayPassExperiment) {
43
- return (
44
- <div {...divProps}>
45
- <ul className="o-typography-list ncf__accept-terms-list">
46
- <li>
47
- <span className="terms-transition terms-transition--immediate">
48
- I give consent for my chosen payment method to be charged
49
- automatically.
50
- </span>
51
- </li>
52
- <li>
53
- <span className="terms-transition terms-transition--immediate">
54
- By placing your order subject to the Terms & Conditions (save for
55
- section 2) referred to below, you agree that we may start your
56
- 7-day pass immediately upon our acceptance of your order and that
57
- you are waiving your statutory right to cancel our contract within
58
- 14 days of confirmation. Your payment is a one-time payment
59
- collected at the time of checkout, and cancelling at any point
60
- (whether before or after the 14-day period) will not entitle you
61
- to a refund.
62
- </span>
63
- </li>
64
- <li>
65
- <span className="terms-transition">
66
- Please see here for the complete{' '}
67
- <a
68
- className="ncf__link--external"
69
- href="http://help.ft.com/help/legal-privacy/terms-conditions/"
70
- target="_blank"
71
- rel="noopener noreferrer"
72
- >
73
- Terms &amp; Conditions
74
- </a>
75
- .
76
- </span>
77
- </li>
78
- </ul>
79
- <label className={labelClassName} htmlFor="termsAcceptance">
80
- <input {...inputProps} />
81
- <span className="o-forms-input__label">
82
- I agree to the above terms &amp; conditions.
83
- </span>
84
- <p className="o-forms-input__error">
85
- Please accept our terms &amp; conditions
86
- </p>
87
- </label>
88
- </div>
89
- );
90
- }
91
-
92
41
  if (isTermedSubscriptionTermType) {
93
42
  return (
94
43
  <div {...divProps}>
@@ -309,7 +258,6 @@ AcceptTermsSubscription.propTypes = {
309
258
  isTrial: PropTypes.bool,
310
259
  isPrintProduct: PropTypes.bool,
311
260
  isSingleTerm: PropTypes.bool,
312
- is7DayPassExperiment: PropTypes.bool,
313
261
  isTermedSubscriptionTermType: PropTypes.bool,
314
262
  isTransition: PropTypes.bool,
315
263
  transitionType: PropTypes.string,
@@ -49,7 +49,6 @@ export { Province } from './province';
49
49
  export { RegistrationConfirmation } from './registration-confirmation';
50
50
  export { Responsibility } from './responsibility';
51
51
  export { Section } from './section';
52
- export { SevenDayPassExperimentConfirmation } from './seven-day-pass-experiment-confirmation';
53
52
  export { State } from './state';
54
53
  export { Submit } from './submit';
55
54
  export { TrialBanner } from './trial-banner';
@@ -5,7 +5,6 @@ export function PackageChange({
5
5
  changePackageUrl,
6
6
  currentPackage,
7
7
  packageDescription,
8
- is7DayPassExperiment,
9
8
  }) {
10
9
  return (
11
10
  <div className="ncf__package-change">
@@ -21,17 +20,15 @@ export function PackageChange({
21
20
  </p>
22
21
  )}
23
22
  </div>
24
- {!is7DayPassExperiment && (
25
- <div className="ncf__package-change__actions">
26
- <a
27
- href={changePackageUrl}
28
- className="ncf__button ncf__button--mono ncf__button--baseline"
29
- data-trackable="change"
30
- >
31
- Change
32
- </a>
33
- </div>
34
- )}
23
+ <div className="ncf__package-change__actions">
24
+ <a
25
+ href={changePackageUrl}
26
+ className="ncf__button ncf__button--mono ncf__button--baseline"
27
+ data-trackable="change"
28
+ >
29
+ Change
30
+ </a>
31
+ </div>
35
32
  </div>
36
33
  </div>
37
34
  );
@@ -41,5 +38,4 @@ PackageChange.propTypes = {
41
38
  changePackageUrl: PropTypes.string.isRequired,
42
39
  currentPackage: PropTypes.string.isRequired,
43
40
  packageDescription: PropTypes.string,
44
- is7DayPassExperiment: PropTypes.bool,
45
41
  };
@@ -74,23 +74,6 @@ describe('PackageChange', () => {
74
74
 
75
75
  expect(PackageChange).toRenderCorrectly(props);
76
76
  });
77
-
78
- it('render when is7DayPassExperiment is true', () => {
79
- const props = {
80
- changePackageUrl: 'https://www.ft.com',
81
- currentPackage: 'Trial',
82
- is7DayPassExperiment: true,
83
- terms: [
84
- {
85
- name: term,
86
- price: '£4.99',
87
- weeklyPrice: '£4.99',
88
- },
89
- ],
90
- };
91
-
92
- expect(PackageChange).toRenderCorrectly(props);
93
- });
94
77
  });
95
78
  });
96
79
  });
@@ -18,11 +18,3 @@ WithPackageDescription.args = {
18
18
  changePackageUrl: 'https://ft.com/products',
19
19
  packageDescription: 'Personalised email briefings and alerts',
20
20
  };
21
-
22
- export const SevenDayPassExperiment = (args) => <PackageChange {...args} />;
23
- SevenDayPassExperiment.args = {
24
- currentPackage: 'Premium Digital',
25
- changePackageUrl: 'https://ft.com/products',
26
- packageDescription: 'Personalised email briefings and alerts',
27
- is7DayPassExperiment: true,
28
- };
@@ -15,7 +15,6 @@ export function PaymentTerm({
15
15
  largePrice = false,
16
16
  optionsInARow = false,
17
17
  billingCountry = '',
18
- is7DayPassExperiment = false,
19
18
  isTermedSubscriptionTermType = false,
20
19
  isTrialOfferAsNonTrialOverride = false,
21
20
  labelOverride = '', // this is a temporary hack for the February 2024 campaign
@@ -121,22 +120,11 @@ export function PaymentTerm({
121
120
  },
122
121
  monthly: {
123
122
  title: 'Monthly',
124
- price: (price, is7DayPassExperiment) => {
125
- const paymentIntervalTextToDisplay = (() => {
126
- if (is7DayPassExperiment) {
127
- return ' one-time payment';
128
- }
129
-
130
- return ' per month';
131
- })();
132
-
133
- return (
134
- <React.Fragment>
135
- <span className="ncf__payment-term__price">{price}</span>
136
- {paymentIntervalTextToDisplay}
137
- </React.Fragment>
138
- );
139
- },
123
+ price: (price) => (
124
+ <React.Fragment>
125
+ <span className="ncf__payment-term__price">{price}</span> per month
126
+ </React.Fragment>
127
+ ),
140
128
  trialPrice: (price) => (
141
129
  <React.Fragment>
142
130
  Unless you cancel during your trial you will be billed{' '}
@@ -146,17 +134,9 @@ export function PaymentTerm({
146
134
  ),
147
135
  monthlyPrice: () => {},
148
136
  renewsText: (isFixedTermOffer) => {
149
- const textToDisplay = (() => {
150
- if (is7DayPassExperiment) {
151
- return 'This subscription is for 7 days, charged at the outset.';
152
- }
153
-
154
- if (isFixedTermOffer) {
155
- return 'This subscription is for 3 months, charged monthly. You can cancel at anytime';
156
- }
157
-
158
- return 'Renews monthly unless cancelled';
159
- })();
137
+ const textToDisplay = isFixedTermOffer
138
+ ? 'This subscription is for 3 months, charged monthly. You can cancel at anytime'
139
+ : 'Renews monthly unless cancelled';
160
140
 
161
141
  return (
162
142
  <p className="ncf__payment-term__renews-text">{textToDisplay}</p>
@@ -253,12 +233,9 @@ export function PaymentTerm({
253
233
  <React.Fragment>
254
234
  {nameMap[option.name] ? (
255
235
  <div className="ncf__payment-term__description">
256
- {nameMap[option.name].price(option.price, is7DayPassExperiment)}
236
+ {nameMap[option.name].price(option.price)}
257
237
  {nameMap[option.name].monthlyPrice(option.monthlyPrice)}
258
- {nameMap[option.name].renewsText(
259
- isFixedTermOffer,
260
- is7DayPassExperiment
261
- )}
238
+ {nameMap[option.name].renewsText(isFixedTermOffer)}
262
239
  {/* Remove this discount text temporarily in favour of monthly price */}
263
240
  {/* <br />Save up to 25% when you pay annually */}
264
241
  </div>
@@ -310,20 +287,11 @@ export function PaymentTerm({
310
287
  return labelOverride;
311
288
  }
312
289
 
313
- const defaultTitle = (() => {
314
- if (is7DayPassExperiment) {
315
- return '';
316
- }
317
-
318
- if (Boolean(option.name && nameMap[option.name])) {
319
- return nameMap[option.name].title;
320
- }
321
-
322
- return '';
323
- })();
290
+ const defaultTitle =
291
+ option.name && nameMap[option.name] ? nameMap[option.name].title : '';
324
292
 
325
293
  const title = isFixedTermOffer
326
- ? [offerDisplayName, defaultTitle].filter(Boolean).join(' - ')
294
+ ? `${offerDisplayName} - ${defaultTitle}`
327
295
  : defaultTitle;
328
296
 
329
297
  let termDisplayName = '';
@@ -153,37 +153,6 @@ describe('PaymentTerm', () => {
153
153
  });
154
154
  });
155
155
 
156
- describe('given is7DayPassExperiment is true', () => {
157
- const options = [
158
- {
159
- name: 'monthly',
160
- price: '$5.00',
161
- value: 'monthly',
162
- monthlyPrice: '$5.00',
163
- },
164
- ];
165
- const wrapper = shallow(
166
- <PaymentTerm
167
- isFixedTermOffer={true}
168
- options={options}
169
- offerDisplayName="7-day pass"
170
- is7DayPassExperiment={true}
171
- />
172
- );
173
-
174
- it('renders renewal text that actually reflects how the 7-day pass is a fixed term subscription with a one-off payment made at the outset', () => {
175
- expect(wrapper.find('.ncf__payment-term__renews-text').text()).toMatch(
176
- /This subscription is for 7 days, charged at the outset./
177
- );
178
- });
179
-
180
- it('renders offer name and omits payment term title', () => {
181
- expect(wrapper.find('.ncf__payment-term__title').text()).toMatch(
182
- '7-day pass'
183
- );
184
- });
185
- });
186
-
187
156
  describe('given isTermedSubscriptionTermType is true', () => {
188
157
  describe('options include duration expressed in weeks', () => {
189
158
  const options = [
@@ -299,22 +268,6 @@ describe('PaymentTerm', () => {
299
268
  );
300
269
  });
301
270
  });
302
- describe('7-day pass experiment', () => {
303
- const options = [
304
- {
305
- ...baseOptions,
306
- isTrial: false,
307
- },
308
- ];
309
- it('renders with time period only if trial.option == false', () => {
310
- const wrapper = shallow(
311
- <PaymentTerm options={options} is7DayPassExperiment={true} />
312
- );
313
- expect(wrapper.find('.ncf__payment-term__label').text().trim()).toMatch(
314
- '£20.00 one-time paymentThis subscription is for 7 days, charged at the outset.'
315
- );
316
- });
317
- });
318
271
  });
319
272
 
320
273
  describe('[data-base-amount]', () => {
@@ -109,26 +109,6 @@ FixedTermOffer.args = {
109
109
  offerDisplayName: 'Mix & Match',
110
110
  };
111
111
 
112
- export const SevenDayPassExperimentOffer = (args) => (
113
- <div className="ncf">
114
- <Fieldset>
115
- <PaymentTerm {...args} />
116
- </Fieldset>
117
- </div>
118
- );
119
- SevenDayPassExperimentOffer.args = {
120
- options: [
121
- {
122
- name: 'monthly',
123
- price: '$5.00',
124
- value: 5.0,
125
- },
126
- ],
127
- isFixedTermOffer: true,
128
- is7DayPassExperiment: true,
129
- offerDisplayName: '7-day pass',
130
- };
131
-
132
112
  export const TermedSubscriptionTermType = (args) => (
133
113
  <div className="ncf">
134
114
  <Fieldset>
@@ -24,8 +24,6 @@ function AcceptTermsSubscription(_ref) {
24
24
  isPrintProduct = _ref$isPrintProduct === void 0 ? false : _ref$isPrintProduct,
25
25
  _ref$isSingleTerm = _ref.isSingleTerm,
26
26
  isSingleTerm = _ref$isSingleTerm === void 0 ? false : _ref$isSingleTerm,
27
- _ref$is7DayPassExperi = _ref.is7DayPassExperiment,
28
- is7DayPassExperiment = _ref$is7DayPassExperi === void 0 ? false : _ref$is7DayPassExperi,
29
27
  _ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
30
28
  isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip,
31
29
  _ref$isTransition = _ref.isTransition,
@@ -53,29 +51,6 @@ function AcceptTermsSubscription(_ref) {
53
51
  'aria-required': 'true',
54
52
  required: true
55
53
  };
56
- if (is7DayPassExperiment) {
57
- return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
58
- className: "o-typography-list ncf__accept-terms-list"
59
- }, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
60
- className: "terms-transition terms-transition--immediate"
61
- }, "I give consent for my chosen payment method to be charged automatically.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
62
- className: "terms-transition terms-transition--immediate"
63
- }, "By placing your order subject to the Terms & Conditions (save for section 2) referred to below, you agree that we may start your 7-day pass immediately upon our acceptance of your order and that you are waiving your statutory right to cancel our contract within 14 days of confirmation. Your payment is a one-time payment collected at the time of checkout, and cancelling at any point (whether before or after the 14-day period) will not entitle you to a refund.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
64
- className: "terms-transition"
65
- }, "Please see here for the complete", ' ', /*#__PURE__*/_react["default"].createElement("a", {
66
- className: "ncf__link--external",
67
- href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
68
- target: "_blank",
69
- rel: "noopener noreferrer"
70
- }, "Terms & Conditions"), "."))), /*#__PURE__*/_react["default"].createElement("label", {
71
- className: labelClassName,
72
- htmlFor: "termsAcceptance"
73
- }, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
74
- className: "o-forms-input__label"
75
- }, "I agree to the above terms & conditions."), /*#__PURE__*/_react["default"].createElement("p", {
76
- className: "o-forms-input__error"
77
- }, "Please accept our terms & conditions")));
78
- }
79
54
  if (isTermedSubscriptionTermType) {
80
55
  return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
81
56
  className: "o-typography-list ncf__accept-terms-list"
@@ -168,7 +143,6 @@ AcceptTermsSubscription.propTypes = {
168
143
  isTrial: _propTypes["default"].bool,
169
144
  isPrintProduct: _propTypes["default"].bool,
170
145
  isSingleTerm: _propTypes["default"].bool,
171
- is7DayPassExperiment: _propTypes["default"].bool,
172
146
  isTermedSubscriptionTermType: _propTypes["default"].bool,
173
147
  isTransition: _propTypes["default"].bool,
174
148
  transitionType: _propTypes["default"].string,
package/dist/index.js CHANGED
@@ -339,12 +339,6 @@ Object.defineProperty(exports, "Section", {
339
339
  return _section.Section;
340
340
  }
341
341
  });
342
- Object.defineProperty(exports, "SevenDayPassExperimentConfirmation", {
343
- enumerable: true,
344
- get: function get() {
345
- return _sevenDayPassExperimentConfirmation.SevenDayPassExperimentConfirmation;
346
- }
347
- });
348
342
  Object.defineProperty(exports, "State", {
349
343
  enumerable: true,
350
344
  get: function get() {
@@ -420,7 +414,6 @@ var _province = require("./province");
420
414
  var _registrationConfirmation = require("./registration-confirmation");
421
415
  var _responsibility = require("./responsibility");
422
416
  var _section = require("./section");
423
- var _sevenDayPassExperimentConfirmation = require("./seven-day-pass-experiment-confirmation");
424
417
  var _state = require("./state");
425
418
  var _submit = require("./submit");
426
419
  var _trialBanner = require("./trial-banner");
@@ -10,8 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  function PackageChange(_ref) {
11
11
  var changePackageUrl = _ref.changePackageUrl,
12
12
  currentPackage = _ref.currentPackage,
13
- packageDescription = _ref.packageDescription,
14
- is7DayPassExperiment = _ref.is7DayPassExperiment;
13
+ packageDescription = _ref.packageDescription;
15
14
  return /*#__PURE__*/_react["default"].createElement("div", {
16
15
  className: "ncf__package-change"
17
16
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -22,7 +21,7 @@ function PackageChange(_ref) {
22
21
  className: "ncf__strong"
23
22
  }, currentPackage)), packageDescription && /*#__PURE__*/_react["default"].createElement("p", {
24
23
  className: "ncf__package-change__content__description"
25
- }, packageDescription)), !is7DayPassExperiment && /*#__PURE__*/_react["default"].createElement("div", {
24
+ }, packageDescription)), /*#__PURE__*/_react["default"].createElement("div", {
26
25
  className: "ncf__package-change__actions"
27
26
  }, /*#__PURE__*/_react["default"].createElement("a", {
28
27
  href: changePackageUrl,
@@ -33,6 +32,5 @@ function PackageChange(_ref) {
33
32
  PackageChange.propTypes = {
34
33
  changePackageUrl: _propTypes["default"].string.isRequired,
35
34
  currentPackage: _propTypes["default"].string.isRequired,
36
- packageDescription: _propTypes["default"].string,
37
- is7DayPassExperiment: _propTypes["default"].bool
35
+ packageDescription: _propTypes["default"].string
38
36
  };
@@ -34,8 +34,6 @@ function PaymentTerm(_ref) {
34
34
  optionsInARow = _ref$optionsInARow === void 0 ? false : _ref$optionsInARow,
35
35
  _ref$billingCountry = _ref.billingCountry,
36
36
  billingCountry = _ref$billingCountry === void 0 ? '' : _ref$billingCountry,
37
- _ref$is7DayPassExperi = _ref.is7DayPassExperiment,
38
- is7DayPassExperiment = _ref$is7DayPassExperi === void 0 ? false : _ref$is7DayPassExperi,
39
37
  _ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
40
38
  isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip,
41
39
  _ref$isTrialOfferAsNo = _ref.isTrialOfferAsNonTrialOverride,
@@ -133,16 +131,10 @@ function PaymentTerm(_ref) {
133
131
  },
134
132
  monthly: {
135
133
  title: 'Monthly',
136
- price: function price(_price3, is7DayPassExperiment) {
137
- var paymentIntervalTextToDisplay = function () {
138
- if (is7DayPassExperiment) {
139
- return ' one-time payment';
140
- }
141
- return ' per month';
142
- }();
134
+ price: function price(_price3) {
143
135
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
144
136
  className: "ncf__payment-term__price"
145
- }, _price3), paymentIntervalTextToDisplay);
137
+ }, _price3), " per month");
146
138
  },
147
139
  trialPrice: function trialPrice(price) {
148
140
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Unless you cancel during your trial you will be billed", ' ', /*#__PURE__*/_react["default"].createElement("span", {
@@ -151,15 +143,7 @@ function PaymentTerm(_ref) {
151
143
  },
152
144
  monthlyPrice: function monthlyPrice() {},
153
145
  renewsText: function renewsText(isFixedTermOffer) {
154
- var textToDisplay = function () {
155
- if (is7DayPassExperiment) {
156
- return 'This subscription is for 7 days, charged at the outset.';
157
- }
158
- if (isFixedTermOffer) {
159
- return 'This subscription is for 3 months, charged monthly. You can cancel at anytime';
160
- }
161
- return 'Renews monthly unless cancelled';
162
- }();
146
+ var textToDisplay = isFixedTermOffer ? 'This subscription is for 3 months, charged monthly. You can cancel at anytime' : 'Renews monthly unless cancelled';
163
147
  return /*#__PURE__*/_react["default"].createElement("p", {
164
148
  className: "ncf__payment-term__renews-text"
165
149
  }, textToDisplay);
@@ -221,7 +205,7 @@ function PaymentTerm(_ref) {
221
205
  className: "ncf__payment-term__trial-price"
222
206
  }, 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", {
223
207
  className: "ncf__payment-term__description"
224
- }, nameMap[option.name].price(option.price, is7DayPassExperiment), nameMap[option.name].monthlyPrice(option.monthlyPrice), nameMap[option.name].renewsText(isFixedTermOffer, is7DayPassExperiment)) :
208
+ }, nameMap[option.name].price(option.price), nameMap[option.name].monthlyPrice(option.monthlyPrice), nameMap[option.name].renewsText(isFixedTermOffer)) :
225
209
  // this should cover the cases different than annual, quarterly and monthly
226
210
  // for those containing period on option.value, render custom template, for the rest keep legacy render
227
211
  isValidPeriod(option.value) ? /*#__PURE__*/_react["default"].createElement("div", {
@@ -244,16 +228,8 @@ function PaymentTerm(_ref) {
244
228
  if (isTrialOfferAsNonTrialOverride && labelOverride) {
245
229
  return labelOverride;
246
230
  }
247
- var defaultTitle = function () {
248
- if (is7DayPassExperiment) {
249
- return '';
250
- }
251
- if (Boolean(option.name && nameMap[option.name])) {
252
- return nameMap[option.name].title;
253
- }
254
- return '';
255
- }();
256
- var title = isFixedTermOffer ? [offerDisplayName, defaultTitle].filter(Boolean).join(' - ') : defaultTitle;
231
+ var defaultTitle = option.name && nameMap[option.name] ? nameMap[option.name].title : '';
232
+ var title = isFixedTermOffer ? "".concat(offerDisplayName, " - ").concat(defaultTitle) : defaultTitle;
257
233
  var termDisplayName = '';
258
234
  if (showTrialCopyInTitle) {
259
235
  var termName = option.displayName ? option.displayName : 'Premium Digital';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "32.12.0",
3
+ "version": "33.0.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acqusition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -1,110 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- const DetailsMobileView = ({ details }) => (
5
- <dl className="ncf__list ncf__lite-sub__details ncf__lite-sub-confirmation--hidden-md ncf__lite-sub-confirmation--hidden-lg">
6
- {details.map((detail, index) => (
7
- <React.Fragment key={index}>
8
- <dt className="ncf__list-title">{detail.title}</dt>
9
- <dd className="ncf__list-data">{detail.data}</dd>
10
- </React.Fragment>
11
- ))}
12
- </dl>
13
- );
14
-
15
- export function SevenDayPassExperimentConfirmation({
16
- offerName = '',
17
- details = [],
18
- }) {
19
- const detailElements = details && (
20
- <React.Fragment>
21
- <h2 className="ncf__header2--afterline">Your billing details</h2>
22
- <dl className="ncf__list ncf__lite-sub-confirmation--hidden-sm">
23
- {details.map((detail, index) => (
24
- <React.Fragment key={index}>
25
- <dt className="ncf__list-title">{detail.title}</dt>
26
- <dd className="ncf__list-data">{detail.data}</dd>
27
- </React.Fragment>
28
- ))}
29
- </dl>
30
- <DetailsMobileView details={details} />
31
- </React.Fragment>
32
- );
33
-
34
- return (
35
- <div className="ncf ncf__wrapper">
36
- <div className="ncf__center">
37
- <div className="ncf__icon ncf__icon--tick ncf__icon--large"></div>
38
- <p className="ncf__paragraph--reduced-padding ncf__paragraph--subscription-confirmation">
39
- You are now subscribed to:
40
- </p>
41
- <h1 className="ncf__header ncf__header--confirmation">
42
- {'Premium Digital'}
43
- </h1>
44
- </div>
45
- <p className="ncf__paragraph">
46
- Exciting news! You are one of the first to try a{' '}
47
- <strong>{offerName}</strong>. As a thank you, we are pleased to extend
48
- your subscription to one month at no additional cost.
49
- </p>
50
- <p className="ncf__center">
51
- <a
52
- href="/"
53
- className="ncf__button ncf__button--submit ncf__button--margin ncf__lite-sub-confirmation--lite-sub-cta"
54
- >
55
- Go to FT.com
56
- </a>
57
- </p>
58
- <p className="ncf__paragraph">
59
- Please save or print this page for your records as your purchase
60
- confirmation.
61
- </p>
62
-
63
- <p className="ncf__paragraph">
64
- Here&apos;s a summary of your Premium Digital subscription:
65
- </p>
66
-
67
- {detailElements}
68
-
69
- <div className="ncf__headed-paragraph">
70
- <h3 className="ncf__header">Something not right?</h3>
71
- <p className="ncf__paragraph">
72
- Go to your{' '}
73
- <a
74
- className="ncf__link ncf__link--external"
75
- href="https://www.ft.com/myaccount/personal-details"
76
- target="_blank"
77
- rel="noopener noreferrer"
78
- data-trackable="yourAccount"
79
- >
80
- account settings
81
- </a>{' '}
82
- to view or edit your account. If you need to get in touch call us on{' '}
83
- <a href="tel:+442077556248" className="ncf__link ncf__link--external">
84
- +44 20 7755 6248
85
- </a>
86
- . Or{' '}
87
- <a
88
- className="ncf__link ncf__link--external"
89
- href="https://help.ft.com/contact/"
90
- target="_blank"
91
- rel="noopener noreferrer"
92
- >
93
- contact us
94
- </a>{' '}
95
- for additional support.
96
- </p>
97
- </div>
98
- </div>
99
- );
100
- }
101
-
102
- SevenDayPassExperimentConfirmation.propTypes = {
103
- offerName: PropTypes.string.isRequired,
104
- details: PropTypes.arrayOf(
105
- PropTypes.shape({
106
- title: PropTypes.string.isRequired,
107
- data: PropTypes.string.isRequired,
108
- })
109
- ),
110
- };
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import { SevenDayPassExperimentConfirmation } from './seven-day-pass-experiment-confirmation';
3
-
4
- export default {
5
- title: '7-day pass experiment confirmation',
6
- component: SevenDayPassExperimentConfirmation,
7
- argTypes: {
8
- details: { control: 'array' },
9
- offerType: { control: 'string' },
10
- offerName: { control: 'string' },
11
- },
12
- };
13
-
14
- export const Basic = (args) => <SevenDayPassExperimentConfirmation {...args} />;
15
- Basic.args = {
16
- offerType: 'Premium',
17
- details: [
18
- {
19
- title: 'End Date',
20
- data: 'September 18, 2023',
21
- },
22
- {
23
- title: 'One-time payment',
24
- data: '£4.99',
25
- },
26
- {
27
- title: 'Payment method',
28
- data: 'Credit / Debit Card',
29
- },
30
- ],
31
- offerName: '7-day pass',
32
- subscriptionAmount: '£4.99',
33
- };
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.SevenDayPassExperimentConfirmation = SevenDayPassExperimentConfirmation;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _propTypes = _interopRequireDefault(require("prop-types"));
10
- var DetailsMobileView = function DetailsMobileView(_ref) {
11
- var details = _ref.details;
12
- return /*#__PURE__*/_react["default"].createElement("dl", {
13
- className: "ncf__list ncf__lite-sub__details ncf__lite-sub-confirmation--hidden-md ncf__lite-sub-confirmation--hidden-lg"
14
- }, details.map(function (detail, index) {
15
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
16
- key: index
17
- }, /*#__PURE__*/_react["default"].createElement("dt", {
18
- className: "ncf__list-title"
19
- }, detail.title), /*#__PURE__*/_react["default"].createElement("dd", {
20
- className: "ncf__list-data"
21
- }, detail.data));
22
- }));
23
- };
24
- function SevenDayPassExperimentConfirmation(_ref2) {
25
- var _ref2$offerName = _ref2.offerName,
26
- offerName = _ref2$offerName === void 0 ? '' : _ref2$offerName,
27
- _ref2$details = _ref2.details,
28
- details = _ref2$details === void 0 ? [] : _ref2$details;
29
- var detailElements = details && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("h2", {
30
- className: "ncf__header2--afterline"
31
- }, "Your billing details"), /*#__PURE__*/_react["default"].createElement("dl", {
32
- className: "ncf__list ncf__lite-sub-confirmation--hidden-sm"
33
- }, details.map(function (detail, index) {
34
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
35
- key: index
36
- }, /*#__PURE__*/_react["default"].createElement("dt", {
37
- className: "ncf__list-title"
38
- }, detail.title), /*#__PURE__*/_react["default"].createElement("dd", {
39
- className: "ncf__list-data"
40
- }, detail.data));
41
- })), /*#__PURE__*/_react["default"].createElement(DetailsMobileView, {
42
- details: details
43
- }));
44
- return /*#__PURE__*/_react["default"].createElement("div", {
45
- className: "ncf ncf__wrapper"
46
- }, /*#__PURE__*/_react["default"].createElement("div", {
47
- className: "ncf__center"
48
- }, /*#__PURE__*/_react["default"].createElement("div", {
49
- className: "ncf__icon ncf__icon--tick ncf__icon--large"
50
- }), /*#__PURE__*/_react["default"].createElement("p", {
51
- className: "ncf__paragraph--reduced-padding ncf__paragraph--subscription-confirmation"
52
- }, "You are now subscribed to:"), /*#__PURE__*/_react["default"].createElement("h1", {
53
- className: "ncf__header ncf__header--confirmation"
54
- }, 'Premium Digital')), /*#__PURE__*/_react["default"].createElement("p", {
55
- className: "ncf__paragraph"
56
- }, "Exciting news! You are one of the first to try a", ' ', /*#__PURE__*/_react["default"].createElement("strong", null, offerName), ". As a thank you, we are pleased to extend your subscription to one month at no additional cost."), /*#__PURE__*/_react["default"].createElement("p", {
57
- className: "ncf__center"
58
- }, /*#__PURE__*/_react["default"].createElement("a", {
59
- href: "/",
60
- className: "ncf__button ncf__button--submit ncf__button--margin ncf__lite-sub-confirmation--lite-sub-cta"
61
- }, "Go to FT.com")), /*#__PURE__*/_react["default"].createElement("p", {
62
- className: "ncf__paragraph"
63
- }, "Please save or print this page for your records as your purchase confirmation."), /*#__PURE__*/_react["default"].createElement("p", {
64
- className: "ncf__paragraph"
65
- }, "Here's a summary of your Premium Digital subscription:"), detailElements, /*#__PURE__*/_react["default"].createElement("div", {
66
- className: "ncf__headed-paragraph"
67
- }, /*#__PURE__*/_react["default"].createElement("h3", {
68
- className: "ncf__header"
69
- }, "Something not right?"), /*#__PURE__*/_react["default"].createElement("p", {
70
- className: "ncf__paragraph"
71
- }, "Go to your", ' ', /*#__PURE__*/_react["default"].createElement("a", {
72
- className: "ncf__link ncf__link--external",
73
- href: "https://www.ft.com/myaccount/personal-details",
74
- target: "_blank",
75
- rel: "noopener noreferrer",
76
- "data-trackable": "yourAccount"
77
- }, "account settings"), ' ', "to view or edit your account. If you need to get in touch call us on", ' ', /*#__PURE__*/_react["default"].createElement("a", {
78
- href: "tel:+442077556248",
79
- className: "ncf__link ncf__link--external"
80
- }, "+44 20 7755 6248"), ". Or", ' ', /*#__PURE__*/_react["default"].createElement("a", {
81
- className: "ncf__link ncf__link--external",
82
- href: "https://help.ft.com/contact/",
83
- target: "_blank",
84
- rel: "noopener noreferrer"
85
- }, "contact us"), ' ', "for additional support.")));
86
- }
87
- SevenDayPassExperimentConfirmation.propTypes = {
88
- offerName: _propTypes["default"].string.isRequired,
89
- details: _propTypes["default"].arrayOf(_propTypes["default"].shape({
90
- title: _propTypes["default"].string.isRequired,
91
- data: _propTypes["default"].string.isRequired
92
- }))
93
- };