@financial-times/n-conversion-forms 38.0.0 → 39.1.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.
- package/.toolkitstate/ci.json +2 -2
- package/components/__snapshots__/b2c-partnership-confirmation.spec.js.snap +18 -18
- package/components/__snapshots__/confirmation.spec.js.snap +1 -1
- package/components/__snapshots__/delivery-option.spec.js.snap +31 -1
- package/components/b2c-partnership-confirmation.jsx +2 -2
- package/components/b2c-partnership-confirmation.spec.js +2 -2
- package/components/confirmation.spec.js +1 -1
- package/components/delivery-address.jsx +13 -16
- package/components/delivery-city.jsx +5 -8
- package/components/delivery-instructions.jsx +14 -7
- package/components/delivery-instructions.stories.js +27 -6
- package/components/delivery-option.jsx +3 -6
- package/components/delivery-option.spec.js +19 -0
- package/components/delivery-option.stories.js +20 -0
- package/components/payment-term.jsx +3 -3
- package/dist/b2c-partnership-confirmation.jsx +2 -2
- package/dist/delivery-address.jsx +11 -11
- package/dist/delivery-city.jsx +3 -3
- package/dist/delivery-instructions.jsx +7 -6
- package/dist/delivery-option.jsx +2 -2
- package/dist/payment-term.jsx +4 -4
- package/helpers/index.js +1 -2
- package/helpers/index.spec.js +2 -2
- package/helpers/supportedCountries.js +2 -2
- package/package.json +1 -1
- package/utils/delivery-option-messages.js +16 -4
- package/utils/delivery-option-messages.spec.js +11 -5
package/.toolkitstate/ci.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`B2CPartnershipConfirmation renders
|
|
3
|
+
exports[`B2CPartnershipConfirmation renders Digital Edition access for Digital Edition subscription lowercase 1`] = `
|
|
4
4
|
<div class="ncf ncf__wrapper">
|
|
5
5
|
<div class="ncf__center">
|
|
6
6
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
7
7
|
</div>
|
|
8
8
|
<div class="ncf__paragraph">
|
|
9
9
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
10
|
-
Welcome to your
|
|
10
|
+
Welcome to your Digital Edition access
|
|
11
11
|
</h1>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
@@ -40,14 +40,14 @@ exports[`B2CPartnershipConfirmation renders FT access if subscription prop is nu
|
|
|
40
40
|
</div>
|
|
41
41
|
`;
|
|
42
42
|
|
|
43
|
-
exports[`B2CPartnershipConfirmation renders
|
|
43
|
+
exports[`B2CPartnershipConfirmation renders Digital Edition access for Digital Edition subscription uppercase 1`] = `
|
|
44
44
|
<div class="ncf ncf__wrapper">
|
|
45
45
|
<div class="ncf__center">
|
|
46
46
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
47
47
|
</div>
|
|
48
48
|
<div class="ncf__paragraph">
|
|
49
49
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
50
|
-
Welcome to your
|
|
50
|
+
Welcome to your Digital Edition access
|
|
51
51
|
</h1>
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
@@ -80,14 +80,14 @@ exports[`B2CPartnershipConfirmation renders FT access if subscription prop is un
|
|
|
80
80
|
</div>
|
|
81
81
|
`;
|
|
82
82
|
|
|
83
|
-
exports[`B2CPartnershipConfirmation renders
|
|
83
|
+
exports[`B2CPartnershipConfirmation renders FT access if subscription prop is null 1`] = `
|
|
84
84
|
<div class="ncf ncf__wrapper">
|
|
85
85
|
<div class="ncf__center">
|
|
86
86
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
87
87
|
</div>
|
|
88
88
|
<div class="ncf__paragraph">
|
|
89
89
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
90
|
-
Welcome to your
|
|
90
|
+
Welcome to your FT access
|
|
91
91
|
</h1>
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
@@ -120,14 +120,14 @@ exports[`B2CPartnershipConfirmation renders Premium access for premium subscript
|
|
|
120
120
|
</div>
|
|
121
121
|
`;
|
|
122
122
|
|
|
123
|
-
exports[`B2CPartnershipConfirmation renders
|
|
123
|
+
exports[`B2CPartnershipConfirmation renders FT access if subscription prop is undefined 1`] = `
|
|
124
124
|
<div class="ncf ncf__wrapper">
|
|
125
125
|
<div class="ncf__center">
|
|
126
126
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
127
127
|
</div>
|
|
128
128
|
<div class="ncf__paragraph">
|
|
129
129
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
130
|
-
Welcome to your
|
|
130
|
+
Welcome to your FT access
|
|
131
131
|
</h1>
|
|
132
132
|
</div>
|
|
133
133
|
</div>
|
|
@@ -160,14 +160,14 @@ exports[`B2CPartnershipConfirmation renders Premium access for premium subscript
|
|
|
160
160
|
</div>
|
|
161
161
|
`;
|
|
162
162
|
|
|
163
|
-
exports[`B2CPartnershipConfirmation renders
|
|
163
|
+
exports[`B2CPartnershipConfirmation renders Premium access for premium subscription lowercase 1`] = `
|
|
164
164
|
<div class="ncf ncf__wrapper">
|
|
165
165
|
<div class="ncf__center">
|
|
166
166
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
167
167
|
</div>
|
|
168
168
|
<div class="ncf__paragraph">
|
|
169
169
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
170
|
-
Welcome to your
|
|
170
|
+
Welcome to your Premium access
|
|
171
171
|
</h1>
|
|
172
172
|
</div>
|
|
173
173
|
</div>
|
|
@@ -200,14 +200,14 @@ exports[`B2CPartnershipConfirmation renders Standard access for standard subscri
|
|
|
200
200
|
</div>
|
|
201
201
|
`;
|
|
202
202
|
|
|
203
|
-
exports[`B2CPartnershipConfirmation renders
|
|
203
|
+
exports[`B2CPartnershipConfirmation renders Premium access for premium subscription uppercase 1`] = `
|
|
204
204
|
<div class="ncf ncf__wrapper">
|
|
205
205
|
<div class="ncf__center">
|
|
206
206
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
207
207
|
</div>
|
|
208
208
|
<div class="ncf__paragraph">
|
|
209
209
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
210
|
-
Welcome to your
|
|
210
|
+
Welcome to your Premium access
|
|
211
211
|
</h1>
|
|
212
212
|
</div>
|
|
213
213
|
</div>
|
|
@@ -240,14 +240,14 @@ exports[`B2CPartnershipConfirmation renders Standard access for standard subscri
|
|
|
240
240
|
</div>
|
|
241
241
|
`;
|
|
242
242
|
|
|
243
|
-
exports[`B2CPartnershipConfirmation renders
|
|
243
|
+
exports[`B2CPartnershipConfirmation renders Standard access for standard subscription lowercase 1`] = `
|
|
244
244
|
<div class="ncf ncf__wrapper">
|
|
245
245
|
<div class="ncf__center">
|
|
246
246
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
247
247
|
</div>
|
|
248
248
|
<div class="ncf__paragraph">
|
|
249
249
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
250
|
-
Welcome to your
|
|
250
|
+
Welcome to your Standard access
|
|
251
251
|
</h1>
|
|
252
252
|
</div>
|
|
253
253
|
</div>
|
|
@@ -280,14 +280,14 @@ exports[`B2CPartnershipConfirmation renders as default 1`] = `
|
|
|
280
280
|
</div>
|
|
281
281
|
`;
|
|
282
282
|
|
|
283
|
-
exports[`B2CPartnershipConfirmation renders
|
|
283
|
+
exports[`B2CPartnershipConfirmation renders Standard access for standard subscription uppercase 1`] = `
|
|
284
284
|
<div class="ncf ncf__wrapper">
|
|
285
285
|
<div class="ncf__center">
|
|
286
286
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
287
287
|
</div>
|
|
288
288
|
<div class="ncf__paragraph">
|
|
289
289
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
290
|
-
Welcome to your
|
|
290
|
+
Welcome to your Standard access
|
|
291
291
|
</h1>
|
|
292
292
|
</div>
|
|
293
293
|
</div>
|
|
@@ -320,14 +320,14 @@ exports[`B2CPartnershipConfirmation renders ePaper access for ePaper subscriptio
|
|
|
320
320
|
</div>
|
|
321
321
|
`;
|
|
322
322
|
|
|
323
|
-
exports[`B2CPartnershipConfirmation renders
|
|
323
|
+
exports[`B2CPartnershipConfirmation renders as default 1`] = `
|
|
324
324
|
<div class="ncf ncf__wrapper">
|
|
325
325
|
<div class="ncf__center">
|
|
326
326
|
<div class="ncf__icon ncf__icon--tick ncf__icon--large">
|
|
327
327
|
</div>
|
|
328
328
|
<div class="ncf__paragraph">
|
|
329
329
|
<h1 class="ncf__header ncf__header--confirmation">
|
|
330
|
-
Welcome to your
|
|
330
|
+
Welcome to your FT access
|
|
331
331
|
</h1>
|
|
332
332
|
</div>
|
|
333
333
|
</div>
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`DeliveryOption renders a print offer HD for LUX country 1`] = `
|
|
4
|
+
<div id="deliveryOptionField"
|
|
5
|
+
class="o-forms-field ncf__delivery-option"
|
|
6
|
+
role="group"
|
|
7
|
+
aria-label="Delivery options"
|
|
8
|
+
>
|
|
9
|
+
<span class="o-forms-input o-forms-input--radio-round">
|
|
10
|
+
<label class="ncf__delivery-option__item"
|
|
11
|
+
for="HD"
|
|
12
|
+
>
|
|
13
|
+
<input type="radio"
|
|
14
|
+
id="HD"
|
|
15
|
+
name="deliveryOption"
|
|
16
|
+
value="HD"
|
|
17
|
+
class="ncf__delivery-option__input"
|
|
18
|
+
checked
|
|
19
|
+
>
|
|
20
|
+
<span class="o-forms-input__label ncf__delivery-option__label">
|
|
21
|
+
<span class="ncf__delivery-option__title o-forms-title__main">
|
|
22
|
+
Hand delivery
|
|
23
|
+
</span>
|
|
24
|
+
<div class="ncf__delivery-option__description">
|
|
25
|
+
Enjoy delivery of the newspaper daily to your home or office address.
|
|
26
|
+
</div>
|
|
27
|
+
</span>
|
|
28
|
+
</label>
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
|
|
3
33
|
exports[`DeliveryOption renders with USA print offer 1`] = `
|
|
4
34
|
<div id="deliveryOptionField"
|
|
5
35
|
class="o-forms-field ncf__delivery-option"
|
|
@@ -40,7 +70,7 @@ exports[`DeliveryOption renders with USA print offer 1`] = `
|
|
|
40
70
|
Mail
|
|
41
71
|
</span>
|
|
42
72
|
<div class="ncf__delivery-option__description">
|
|
43
|
-
We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT
|
|
73
|
+
We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT Digital Edition - a digital replica of the print edition.
|
|
44
74
|
</div>
|
|
45
75
|
</span>
|
|
46
76
|
</label>
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
const productCodeMapping = {
|
|
5
5
|
P1: 'Standard',
|
|
6
6
|
P2: 'Premium',
|
|
7
|
-
EP: '
|
|
7
|
+
EP: 'Digital Edition',
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export function B2CPartnershipConfirmation({
|
|
@@ -23,7 +23,7 @@ export function B2CPartnershipConfirmation({
|
|
|
23
23
|
|
|
24
24
|
// Welcome to your Standard access
|
|
25
25
|
// Welcome to your Premium access
|
|
26
|
-
// Welcome to your
|
|
26
|
+
// Welcome to your Digital Edition access
|
|
27
27
|
// Welcome to your FT access (default)
|
|
28
28
|
const accessType = productCodeMapping[productCode?.toUpperCase()] || 'FT';
|
|
29
29
|
|
|
@@ -34,13 +34,13 @@ describe('B2CPartnershipConfirmation', () => {
|
|
|
34
34
|
expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
it('renders
|
|
37
|
+
it('renders Digital Edition access for Digital Edition subscription lowercase', () => {
|
|
38
38
|
const props = { ctaElement: 'hello', productCode: 'ep' };
|
|
39
39
|
|
|
40
40
|
expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
it('renders
|
|
43
|
+
it('renders Digital Edition access for Digital Edition subscription uppercase', () => {
|
|
44
44
|
const props = { ctaElement: 'hello', productCode: 'EP' };
|
|
45
45
|
|
|
46
46
|
expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
|
|
@@ -5,7 +5,7 @@ expect.extend(expectToRenderCorrectly);
|
|
|
5
5
|
|
|
6
6
|
const OFFER_TEXT = 'Offer text';
|
|
7
7
|
const nextActionTop = ['i might take you to tailor your experience'];
|
|
8
|
-
const nextActionBottom = ['i might take you to the
|
|
8
|
+
const nextActionBottom = ['i might take you to the Digital Edition'];
|
|
9
9
|
const newsletterScheduleExplainer = [
|
|
10
10
|
'You will receive your first newsletter on the next weekday to foo@bar.com',
|
|
11
11
|
];
|
|
@@ -7,10 +7,7 @@ import {
|
|
|
7
7
|
addressLine2AutoComplete,
|
|
8
8
|
addressLine3AutoComplete,
|
|
9
9
|
} from '../helpers/constants';
|
|
10
|
-
import {
|
|
11
|
-
identifyFTShippingZone,
|
|
12
|
-
countriesSupportedISO,
|
|
13
|
-
} from '../helpers/supportedCountries';
|
|
10
|
+
import { identifyShippingZone } from '../helpers/supportedCountries';
|
|
14
11
|
|
|
15
12
|
export function DeliveryAddress({
|
|
16
13
|
fieldId = 'deliveryAddressFields',
|
|
@@ -29,7 +26,7 @@ export function DeliveryAddress({
|
|
|
29
26
|
'o-forms-input--text',
|
|
30
27
|
{ 'o-forms-input--invalid': hasError },
|
|
31
28
|
]);
|
|
32
|
-
const
|
|
29
|
+
const shippingZone = identifyShippingZone(country);
|
|
33
30
|
|
|
34
31
|
const addressLine1 = (
|
|
35
32
|
<label
|
|
@@ -38,7 +35,7 @@ export function DeliveryAddress({
|
|
|
38
35
|
>
|
|
39
36
|
<span className="o-forms-title">
|
|
40
37
|
<span className="o-forms-title__main">
|
|
41
|
-
{deliveryAddressMap[addressType].addressLine1Title[
|
|
38
|
+
{deliveryAddressMap[addressType].addressLine1Title[shippingZone] ||
|
|
42
39
|
'Address line 1'}
|
|
43
40
|
</span>
|
|
44
41
|
</span>
|
|
@@ -51,8 +48,8 @@ export function DeliveryAddress({
|
|
|
51
48
|
autoComplete={addressLine1AutoComplete}
|
|
52
49
|
placeholder={
|
|
53
50
|
deliveryAddressMap[addressType].addressLine1Placeholder[
|
|
54
|
-
|
|
55
|
-
]
|
|
51
|
+
shippingZone
|
|
52
|
+
] || ''
|
|
56
53
|
}
|
|
57
54
|
maxLength={50}
|
|
58
55
|
aria-required="true"
|
|
@@ -83,12 +80,12 @@ export function DeliveryAddress({
|
|
|
83
80
|
data-trackable="field-deliveryAddressLine2"
|
|
84
81
|
autoComplete={
|
|
85
82
|
deliveryAddressMap[addressType].addressLine2AutoComplete[
|
|
86
|
-
|
|
83
|
+
shippingZone
|
|
87
84
|
] || addressLine2AutoComplete
|
|
88
85
|
}
|
|
89
86
|
placeholder={
|
|
90
87
|
deliveryAddressMap[addressType].addressLine2Placeholder[
|
|
91
|
-
|
|
88
|
+
shippingZone
|
|
92
89
|
] || ''
|
|
93
90
|
}
|
|
94
91
|
maxLength={50}
|
|
@@ -106,10 +103,10 @@ export function DeliveryAddress({
|
|
|
106
103
|
>
|
|
107
104
|
<span className="o-forms-title">
|
|
108
105
|
<span className="o-forms-title__main">
|
|
109
|
-
{deliveryAddressMap[addressType].addressLine3Title[
|
|
106
|
+
{deliveryAddressMap[addressType].addressLine3Title[shippingZone]}
|
|
110
107
|
</span>
|
|
111
108
|
<span className="o-forms-title__prompt">
|
|
112
|
-
{deliveryAddressMap[addressType].addressLine3Prompt[
|
|
109
|
+
{deliveryAddressMap[addressType].addressLine3Prompt[shippingZone]}
|
|
113
110
|
</span>
|
|
114
111
|
</span>
|
|
115
112
|
<span className={inputWrapperClassNames}>
|
|
@@ -120,12 +117,12 @@ export function DeliveryAddress({
|
|
|
120
117
|
data-trackable="field-deliveryAddressLine3"
|
|
121
118
|
autoComplete={
|
|
122
119
|
deliveryAddressMap[addressType].addressLine3AutoComplete[
|
|
123
|
-
|
|
120
|
+
shippingZone
|
|
124
121
|
] || addressLine3AutoComplete
|
|
125
122
|
}
|
|
126
123
|
placeholder={
|
|
127
124
|
deliveryAddressMap[addressType].addressLine3Placeholder[
|
|
128
|
-
|
|
125
|
+
shippingZone
|
|
129
126
|
] || 'e.g. Apt. 1'
|
|
130
127
|
}
|
|
131
128
|
maxLength={
|
|
@@ -141,7 +138,7 @@ export function DeliveryAddress({
|
|
|
141
138
|
addressLine1,
|
|
142
139
|
addressLine2,
|
|
143
140
|
addressLine3,
|
|
144
|
-
|
|
141
|
+
shippingZone
|
|
145
142
|
);
|
|
146
143
|
|
|
147
144
|
return (
|
|
@@ -159,6 +156,6 @@ DeliveryAddress.propTypes = {
|
|
|
159
156
|
line3: PropTypes.string,
|
|
160
157
|
isDisabled: PropTypes.bool,
|
|
161
158
|
isHidden: PropTypes.bool,
|
|
162
|
-
country: PropTypes.
|
|
159
|
+
country: PropTypes.string,
|
|
163
160
|
addressType: PropTypes.oneOf(['home', 'company', 'pobox']),
|
|
164
161
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
5
|
-
countriesSupportedISO,
|
|
6
|
-
identifyFTShippingZone,
|
|
7
|
-
} from '../helpers/supportedCountries';
|
|
4
|
+
import { identifyShippingZone } from '../helpers/supportedCountries';
|
|
8
5
|
|
|
9
6
|
export function DeliveryCity({
|
|
10
7
|
hasError = false,
|
|
@@ -24,15 +21,15 @@ export function DeliveryCity({
|
|
|
24
21
|
CAN: 'e.g. Montreal',
|
|
25
22
|
ARE: 'e.g. Dubai',
|
|
26
23
|
};
|
|
27
|
-
const
|
|
24
|
+
const shippingZone = identifyShippingZone(country);
|
|
28
25
|
|
|
29
26
|
const labelMapping = {
|
|
30
27
|
ARE: 'Emirate or City',
|
|
31
28
|
APAC: 'City/Prefecture',
|
|
32
29
|
DEFAULT: 'City',
|
|
33
30
|
};
|
|
34
|
-
const inputLabel = labelMapping[
|
|
35
|
-
? labelMapping[
|
|
31
|
+
const inputLabel = labelMapping[shippingZone]
|
|
32
|
+
? labelMapping[shippingZone]
|
|
36
33
|
: labelMapping['DEFAULT'];
|
|
37
34
|
|
|
38
35
|
return (
|
|
@@ -72,5 +69,5 @@ DeliveryCity.propTypes = {
|
|
|
72
69
|
value: PropTypes.string,
|
|
73
70
|
isDisabled: PropTypes.bool,
|
|
74
71
|
maxlength: PropTypes.number,
|
|
75
|
-
country: PropTypes.
|
|
72
|
+
country: PropTypes.string,
|
|
76
73
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import { identifyShippingZone } from '../helpers/supportedCountries';
|
|
5
5
|
|
|
6
6
|
const spanMessageByCountry = {
|
|
7
7
|
GBR: (
|
|
@@ -99,7 +99,7 @@ export function DeliveryInstructions({
|
|
|
99
99
|
fieldId = 'deliveryInstructionsField',
|
|
100
100
|
hasError = false,
|
|
101
101
|
inputId = 'deliveryInstructions',
|
|
102
|
-
maxlength =
|
|
102
|
+
maxlength = '',
|
|
103
103
|
rows = null,
|
|
104
104
|
isDisabled = false,
|
|
105
105
|
placeholder = '',
|
|
@@ -111,12 +111,12 @@ export function DeliveryInstructions({
|
|
|
111
111
|
'o-forms-input--textarea',
|
|
112
112
|
{ 'o-forms-input--invalid': hasError },
|
|
113
113
|
]);
|
|
114
|
-
const
|
|
114
|
+
const shippingZone = identifyShippingZone(country);
|
|
115
115
|
const extraInstruction =
|
|
116
116
|
country === 'GBR'
|
|
117
117
|
? ''
|
|
118
118
|
: '\u000a- Special handling, e.g. place in plastic bag, 24/7 security on reception';
|
|
119
|
-
const
|
|
119
|
+
const shippingZoneToPlaceholderMap = {
|
|
120
120
|
CEMEA_V1: `Enter instructions ${
|
|
121
121
|
maxlength && `(Max. ${maxlength} characters)`
|
|
122
122
|
}:\u000a- Door colour, letterbox location\u000a- Door entry codes, etc.`,
|
|
@@ -134,13 +134,20 @@ export function DeliveryInstructions({
|
|
|
134
134
|
}:\u000a- Door colour, driveway signage\u000a- Cross street${extraInstruction}`,
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
+
const defaultPlaceholder = `Enter instructions ${
|
|
138
|
+
maxlength && `(Max. ${maxlength} characters)`
|
|
139
|
+
}:\u000a- Door colour, letterbox location\u000a- Door entry codes, etc.`;
|
|
140
|
+
|
|
137
141
|
const textAreaProps = {
|
|
138
142
|
id: inputId,
|
|
139
143
|
name: inputId,
|
|
140
144
|
...(maxlength && { maxLength: maxlength }),
|
|
141
145
|
...(rows && { rows }),
|
|
142
146
|
'data-trackable': 'field-deliveryInstructions',
|
|
143
|
-
placeholder:
|
|
147
|
+
placeholder:
|
|
148
|
+
placeholder ||
|
|
149
|
+
shippingZoneToPlaceholderMap[shippingZone] ||
|
|
150
|
+
defaultPlaceholder,
|
|
144
151
|
disabled: isDisabled,
|
|
145
152
|
defaultValue: value,
|
|
146
153
|
};
|
|
@@ -160,7 +167,7 @@ export function DeliveryInstructions({
|
|
|
160
167
|
>
|
|
161
168
|
<span className="o-forms-title">
|
|
162
169
|
<span className="o-forms-title__main">Delivery instructions</span>
|
|
163
|
-
{spanMessageByCountry[
|
|
170
|
+
{spanMessageByCountry[shippingZone]}
|
|
164
171
|
{country === 'GBR' && deliveryInstructionsMessage}
|
|
165
172
|
</span>
|
|
166
173
|
|
|
@@ -177,5 +184,5 @@ DeliveryInstructions.propTypes = {
|
|
|
177
184
|
rows: PropTypes.number,
|
|
178
185
|
isDisabled: PropTypes.bool,
|
|
179
186
|
value: PropTypes.string,
|
|
180
|
-
country: PropTypes.
|
|
187
|
+
country: PropTypes.string.isRequired,
|
|
181
188
|
};
|
|
@@ -10,17 +10,38 @@ export default {
|
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const
|
|
14
|
-
|
|
13
|
+
export const GreatBritainDeliveryInstructions = (args) => (
|
|
14
|
+
<DeliveryInstructions {...args} />
|
|
15
|
+
);
|
|
16
|
+
GreatBritainDeliveryInstructions.args = {
|
|
15
17
|
country: 'GBR',
|
|
18
|
+
maxlength: 50,
|
|
16
19
|
};
|
|
17
20
|
|
|
18
|
-
export const
|
|
19
|
-
|
|
21
|
+
export const UnitedStatesDeliveryInstructions = (args) => (
|
|
22
|
+
<DeliveryInstructions {...args} />
|
|
23
|
+
);
|
|
24
|
+
UnitedStatesDeliveryInstructions.args = {
|
|
20
25
|
country: 'USA',
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
export const
|
|
24
|
-
|
|
28
|
+
export const CanadaDeliveryInstructions = (args) => (
|
|
29
|
+
<DeliveryInstructions {...args} />
|
|
30
|
+
);
|
|
31
|
+
CanadaDeliveryInstructions.args = {
|
|
25
32
|
country: 'CAN',
|
|
26
33
|
};
|
|
34
|
+
|
|
35
|
+
export const LuxembourgDeliveryInstructions = (args) => (
|
|
36
|
+
<DeliveryInstructions {...args} />
|
|
37
|
+
);
|
|
38
|
+
LuxembourgDeliveryInstructions.args = {
|
|
39
|
+
country: 'LUX',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const BosniaDeliveryInstructions = (args) => (
|
|
43
|
+
<DeliveryInstructions {...args} />
|
|
44
|
+
);
|
|
45
|
+
BosniaDeliveryInstructions.args = {
|
|
46
|
+
country: 'BIH',
|
|
47
|
+
};
|
|
@@ -2,10 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { getDeliveryOption } from '../utils/delivery-option-messages';
|
|
5
|
-
import {
|
|
6
|
-
identifyFTShippingZone,
|
|
7
|
-
countriesSupportedISO,
|
|
8
|
-
} from '../helpers/supportedCountries';
|
|
5
|
+
import { identifyShippingZone } from '../helpers/supportedCountries';
|
|
9
6
|
|
|
10
7
|
export function DeliveryOption({
|
|
11
8
|
fieldId = 'deliveryOptionField',
|
|
@@ -20,7 +17,7 @@ export function DeliveryOption({
|
|
|
20
17
|
{ 'ncf__delivery-option--single': isSingle },
|
|
21
18
|
]);
|
|
22
19
|
|
|
23
|
-
const shippingZone =
|
|
20
|
+
const shippingZone = identifyShippingZone(countryCode);
|
|
24
21
|
|
|
25
22
|
return (
|
|
26
23
|
<div
|
|
@@ -87,7 +84,7 @@ export function DeliveryOption({
|
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
DeliveryOption.propTypes = {
|
|
90
|
-
country: PropTypes.
|
|
87
|
+
country: PropTypes.string.isRequired,
|
|
91
88
|
productCode: PropTypes.string,
|
|
92
89
|
options: PropTypes.arrayOf(
|
|
93
90
|
PropTypes.shape({
|
|
@@ -128,4 +128,23 @@ describe('DeliveryOption', () => {
|
|
|
128
128
|
|
|
129
129
|
expect(DeliveryOption).toRenderCorrectly(props);
|
|
130
130
|
});
|
|
131
|
+
|
|
132
|
+
it('renders a print offer HD for LUX country', () => {
|
|
133
|
+
const props = {
|
|
134
|
+
country: 'LUX',
|
|
135
|
+
productCode: 'EPNWE',
|
|
136
|
+
options: [
|
|
137
|
+
{
|
|
138
|
+
value: 'HD',
|
|
139
|
+
isSelected: true,
|
|
140
|
+
isValidDeliveryOption: true,
|
|
141
|
+
deliveryOnPublicationDate: false,
|
|
142
|
+
flightMarket: true,
|
|
143
|
+
mailDelivery: false,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
expect(DeliveryOption).toRenderCorrectly(props);
|
|
149
|
+
});
|
|
131
150
|
});
|
|
@@ -104,3 +104,23 @@ JapanDeliveryOptions.args = {
|
|
|
104
104
|
},
|
|
105
105
|
],
|
|
106
106
|
};
|
|
107
|
+
|
|
108
|
+
export const LuxembourgDeliveryOptions = (args) => (
|
|
109
|
+
<div className="ncf">
|
|
110
|
+
<DeliveryOption {...args} />
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
LuxembourgDeliveryOptions.args = {
|
|
114
|
+
country: 'LUX',
|
|
115
|
+
productCode: 'EPNWE',
|
|
116
|
+
options: [
|
|
117
|
+
{
|
|
118
|
+
value: 'HD',
|
|
119
|
+
isSelected: true,
|
|
120
|
+
isValidDeliveryOption: true,
|
|
121
|
+
deliveryOnPublicationDate: false,
|
|
122
|
+
flightMarket: true,
|
|
123
|
+
mailDelivery: false,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|
|
@@ -7,7 +7,7 @@ export function PaymentTerm({
|
|
|
7
7
|
fieldId = 'paymentTermField',
|
|
8
8
|
inputName = 'paymentTerm',
|
|
9
9
|
isPrintOrBundle = false,
|
|
10
|
-
|
|
10
|
+
isDigitalEdition = false,
|
|
11
11
|
options = [],
|
|
12
12
|
showLegal = true,
|
|
13
13
|
largePrice = false,
|
|
@@ -278,7 +278,7 @@ export function PaymentTerm({
|
|
|
278
278
|
|
|
279
279
|
const getTermDisplayName = () => {
|
|
280
280
|
const showTrialCopyInTitle =
|
|
281
|
-
option.isTrial && !isPrintOrBundle && !
|
|
281
|
+
option.isTrial && !isPrintOrBundle && !isDigitalEdition;
|
|
282
282
|
|
|
283
283
|
// https://financialtimes.atlassian.net/browse/ACQ-2592
|
|
284
284
|
// We need to have one specific trial offer to have terms displayed as non-trial.
|
|
@@ -410,7 +410,7 @@ PaymentTerm.propTypes = {
|
|
|
410
410
|
fieldId: PropTypes.string,
|
|
411
411
|
inputName: PropTypes.string,
|
|
412
412
|
isPrintOrBundle: PropTypes.bool,
|
|
413
|
-
|
|
413
|
+
isDigitalEdition: PropTypes.bool,
|
|
414
414
|
options: PropTypes.arrayOf(
|
|
415
415
|
PropTypes.shape({
|
|
416
416
|
b2cDiscountCopy: PropTypes.string,
|
|
@@ -10,7 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var productCodeMapping = {
|
|
11
11
|
P1: 'Standard',
|
|
12
12
|
P2: 'Premium',
|
|
13
|
-
EP: '
|
|
13
|
+
EP: 'Digital Edition'
|
|
14
14
|
};
|
|
15
15
|
function B2CPartnershipConfirmation(_ref) {
|
|
16
16
|
var _ref$ctaElement = _ref.ctaElement,
|
|
@@ -28,7 +28,7 @@ function B2CPartnershipConfirmation(_ref) {
|
|
|
28
28
|
|
|
29
29
|
// Welcome to your Standard access
|
|
30
30
|
// Welcome to your Premium access
|
|
31
|
-
// Welcome to your
|
|
31
|
+
// Welcome to your Digital Edition access
|
|
32
32
|
// Welcome to your FT access (default)
|
|
33
33
|
var accessType = productCodeMapping[productCode === null || productCode === void 0 ? void 0 : productCode.toUpperCase()] || 'FT';
|
|
34
34
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -36,7 +36,7 @@ function DeliveryAddress(_ref) {
|
|
|
36
36
|
var inputWrapperClassNames = (0, _classnames["default"])(['o-forms-input', 'o-forms-input--text', {
|
|
37
37
|
'o-forms-input--invalid': hasError
|
|
38
38
|
}]);
|
|
39
|
-
var
|
|
39
|
+
var shippingZone = (0, _supportedCountries.identifyShippingZone)(country);
|
|
40
40
|
var addressLine1 = /*#__PURE__*/_react["default"].createElement("label", {
|
|
41
41
|
className: "o-forms-field ncf__validation-error",
|
|
42
42
|
htmlFor: "deliveryAddressLine1"
|
|
@@ -44,7 +44,7 @@ function DeliveryAddress(_ref) {
|
|
|
44
44
|
className: "o-forms-title"
|
|
45
45
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
46
46
|
className: "o-forms-title__main"
|
|
47
|
-
}, _deliveryAddressMap["default"][addressType].addressLine1Title[
|
|
47
|
+
}, _deliveryAddressMap["default"][addressType].addressLine1Title[shippingZone] || 'Address line 1')), /*#__PURE__*/_react["default"].createElement("span", {
|
|
48
48
|
className: inputWrapperClassNames
|
|
49
49
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
50
50
|
type: "text",
|
|
@@ -52,7 +52,7 @@ function DeliveryAddress(_ref) {
|
|
|
52
52
|
name: "deliveryAddressLine1",
|
|
53
53
|
"data-trackable": "field-deliveryAddressLine1",
|
|
54
54
|
autoComplete: _constants.addressLine1AutoComplete,
|
|
55
|
-
placeholder: _deliveryAddressMap["default"][addressType].addressLine1Placeholder[
|
|
55
|
+
placeholder: _deliveryAddressMap["default"][addressType].addressLine1Placeholder[shippingZone] || '',
|
|
56
56
|
maxLength: 50,
|
|
57
57
|
"aria-required": "true",
|
|
58
58
|
required: true,
|
|
@@ -75,8 +75,8 @@ function DeliveryAddress(_ref) {
|
|
|
75
75
|
id: "deliveryAddressLine2",
|
|
76
76
|
name: "deliveryAddressLine2",
|
|
77
77
|
"data-trackable": "field-deliveryAddressLine2",
|
|
78
|
-
autoComplete: _deliveryAddressMap["default"][addressType].addressLine2AutoComplete[
|
|
79
|
-
placeholder: _deliveryAddressMap["default"][addressType].addressLine2Placeholder[
|
|
78
|
+
autoComplete: _deliveryAddressMap["default"][addressType].addressLine2AutoComplete[shippingZone] || _constants.addressLine2AutoComplete,
|
|
79
|
+
placeholder: _deliveryAddressMap["default"][addressType].addressLine2Placeholder[shippingZone] || '',
|
|
80
80
|
maxLength: 50,
|
|
81
81
|
disabled: isDisabled,
|
|
82
82
|
defaultValue: line2
|
|
@@ -88,22 +88,22 @@ function DeliveryAddress(_ref) {
|
|
|
88
88
|
className: "o-forms-title"
|
|
89
89
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
90
90
|
className: "o-forms-title__main"
|
|
91
|
-
}, _deliveryAddressMap["default"][addressType].addressLine3Title[
|
|
91
|
+
}, _deliveryAddressMap["default"][addressType].addressLine3Title[shippingZone]), /*#__PURE__*/_react["default"].createElement("span", {
|
|
92
92
|
className: "o-forms-title__prompt"
|
|
93
|
-
}, _deliveryAddressMap["default"][addressType].addressLine3Prompt[
|
|
93
|
+
}, _deliveryAddressMap["default"][addressType].addressLine3Prompt[shippingZone])), /*#__PURE__*/_react["default"].createElement("span", {
|
|
94
94
|
className: inputWrapperClassNames
|
|
95
95
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
96
96
|
type: "text",
|
|
97
97
|
id: "deliveryAddressLine3",
|
|
98
98
|
name: "deliveryAddressLine3",
|
|
99
99
|
"data-trackable": "field-deliveryAddressLine3",
|
|
100
|
-
autoComplete: _deliveryAddressMap["default"][addressType].addressLine3AutoComplete[
|
|
101
|
-
placeholder: _deliveryAddressMap["default"][addressType].addressLine3Placeholder[
|
|
100
|
+
autoComplete: _deliveryAddressMap["default"][addressType].addressLine3AutoComplete[shippingZone] || _constants.addressLine3AutoComplete,
|
|
101
|
+
placeholder: _deliveryAddressMap["default"][addressType].addressLine3Placeholder[shippingZone] || 'e.g. Apt. 1',
|
|
102
102
|
maxLength: _deliveryAddressMap["default"][addressType].addressLine3MaxLength[country] || 50,
|
|
103
103
|
disabled: isDisabled,
|
|
104
104
|
defaultValue: line3
|
|
105
105
|
})));
|
|
106
|
-
var addressLines = _deliveryAddressMap["default"][addressType].template(addressLine1, addressLine2, addressLine3,
|
|
106
|
+
var addressLines = _deliveryAddressMap["default"][addressType].template(addressLine1, addressLine2, addressLine3, shippingZone);
|
|
107
107
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
108
108
|
id: fieldId,
|
|
109
109
|
"data-validate": "required",
|
|
@@ -118,6 +118,6 @@ DeliveryAddress.propTypes = {
|
|
|
118
118
|
line3: _propTypes["default"].string,
|
|
119
119
|
isDisabled: _propTypes["default"].bool,
|
|
120
120
|
isHidden: _propTypes["default"].bool,
|
|
121
|
-
country: _propTypes["default"].
|
|
121
|
+
country: _propTypes["default"].string,
|
|
122
122
|
addressType: _propTypes["default"].oneOf(['home', 'company', 'pobox'])
|
|
123
123
|
};
|
package/dist/delivery-city.jsx
CHANGED
|
@@ -27,13 +27,13 @@ function DeliveryCity(_ref) {
|
|
|
27
27
|
CAN: 'e.g. Montreal',
|
|
28
28
|
ARE: 'e.g. Dubai'
|
|
29
29
|
};
|
|
30
|
-
var
|
|
30
|
+
var shippingZone = (0, _supportedCountries.identifyShippingZone)(country);
|
|
31
31
|
var labelMapping = {
|
|
32
32
|
ARE: 'Emirate or City',
|
|
33
33
|
APAC: 'City/Prefecture',
|
|
34
34
|
DEFAULT: 'City'
|
|
35
35
|
};
|
|
36
|
-
var inputLabel = labelMapping[
|
|
36
|
+
var inputLabel = labelMapping[shippingZone] ? labelMapping[shippingZone] : labelMapping['DEFAULT'];
|
|
37
37
|
return /*#__PURE__*/_react["default"].createElement("label", {
|
|
38
38
|
id: "deliveryCityField",
|
|
39
39
|
className: "o-forms-field ncf__validation-error",
|
|
@@ -66,5 +66,5 @@ DeliveryCity.propTypes = {
|
|
|
66
66
|
value: _propTypes["default"].string,
|
|
67
67
|
isDisabled: _propTypes["default"].bool,
|
|
68
68
|
maxlength: _propTypes["default"].number,
|
|
69
|
-
country: _propTypes["default"].
|
|
69
|
+
country: _propTypes["default"].string
|
|
70
70
|
};
|
|
@@ -62,7 +62,7 @@ function DeliveryInstructions(_ref) {
|
|
|
62
62
|
_ref$inputId = _ref.inputId,
|
|
63
63
|
inputId = _ref$inputId === void 0 ? 'deliveryInstructions' : _ref$inputId,
|
|
64
64
|
_ref$maxlength = _ref.maxlength,
|
|
65
|
-
maxlength = _ref$maxlength === void 0 ?
|
|
65
|
+
maxlength = _ref$maxlength === void 0 ? '' : _ref$maxlength,
|
|
66
66
|
_ref$rows = _ref.rows,
|
|
67
67
|
rows = _ref$rows === void 0 ? null : _ref$rows,
|
|
68
68
|
_ref$isDisabled = _ref.isDisabled,
|
|
@@ -75,15 +75,16 @@ function DeliveryInstructions(_ref) {
|
|
|
75
75
|
var textAreaWrapperClassNames = (0, _classnames["default"])(['o-forms-input', 'o-forms-input--textarea', {
|
|
76
76
|
'o-forms-input--invalid': hasError
|
|
77
77
|
}]);
|
|
78
|
-
var
|
|
78
|
+
var shippingZone = (0, _supportedCountries.identifyShippingZone)(country);
|
|
79
79
|
var extraInstruction = country === 'GBR' ? '' : "\n- Special handling, e.g. place in plastic bag, 24/7 security on reception";
|
|
80
|
-
var
|
|
80
|
+
var shippingZoneToPlaceholderMap = {
|
|
81
81
|
CEMEA_V1: "Enter instructions ".concat(maxlength && "(Max. ".concat(maxlength, " characters)"), ":\n- Door colour, letterbox location\n- Door entry codes, etc."),
|
|
82
82
|
CEMEA_V2: "Enter instructions ".concat(maxlength && "(Max. ".concat(maxlength, " characters)"), ":\n- Door colour, letterbox location\n- Door entry codes, etc."),
|
|
83
83
|
GBR: "Enter instructions ".concat(maxlength && "(Max. ".concat(maxlength, " characters)"), ":\n- Door colour, letterbox location\n- Placement i.e. letterbox delivery").concat(extraInstruction),
|
|
84
84
|
USA: "Enter instructions ".concat(maxlength && "(Max. ".concat(maxlength, " characters)"), ":\n- Door colour, driveway signage\n- Cross street").concat(extraInstruction),
|
|
85
85
|
CAN: "Enter instructions ".concat(maxlength && "(Max. ".concat(maxlength, " characters)"), ":\n- Door colour, driveway signage\n- Cross street").concat(extraInstruction)
|
|
86
86
|
};
|
|
87
|
+
var defaultPlaceholder = "Enter instructions ".concat(maxlength && "(Max. ".concat(maxlength, " characters)"), ":\n- Door colour, letterbox location\n- Door entry codes, etc.");
|
|
87
88
|
var textAreaProps = _objectSpread(_objectSpread(_objectSpread({
|
|
88
89
|
id: inputId,
|
|
89
90
|
name: inputId
|
|
@@ -93,7 +94,7 @@ function DeliveryInstructions(_ref) {
|
|
|
93
94
|
rows: rows
|
|
94
95
|
}), {}, {
|
|
95
96
|
'data-trackable': 'field-deliveryInstructions',
|
|
96
|
-
placeholder: placeholder
|
|
97
|
+
placeholder: placeholder || shippingZoneToPlaceholderMap[shippingZone] || defaultPlaceholder,
|
|
97
98
|
disabled: isDisabled,
|
|
98
99
|
defaultValue: value
|
|
99
100
|
});
|
|
@@ -109,7 +110,7 @@ function DeliveryInstructions(_ref) {
|
|
|
109
110
|
className: "o-forms-title"
|
|
110
111
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
111
112
|
className: "o-forms-title__main"
|
|
112
|
-
}, "Delivery instructions"), spanMessageByCountry[
|
|
113
|
+
}, "Delivery instructions"), spanMessageByCountry[shippingZone], country === 'GBR' && deliveryInstructionsMessage), /*#__PURE__*/_react["default"].createElement("span", {
|
|
113
114
|
className: textAreaWrapperClassNames
|
|
114
115
|
}, /*#__PURE__*/_react["default"].createElement("textarea", textAreaProps)));
|
|
115
116
|
}
|
|
@@ -119,5 +120,5 @@ DeliveryInstructions.propTypes = {
|
|
|
119
120
|
rows: _propTypes["default"].number,
|
|
120
121
|
isDisabled: _propTypes["default"].bool,
|
|
121
122
|
value: _propTypes["default"].string,
|
|
122
|
-
country: _propTypes["default"].
|
|
123
|
+
country: _propTypes["default"].string.isRequired
|
|
123
124
|
};
|
package/dist/delivery-option.jsx
CHANGED
|
@@ -23,7 +23,7 @@ function DeliveryOption(_ref) {
|
|
|
23
23
|
var divClassName = (0, _classnames["default"])(['o-forms-field', 'ncf__delivery-option', {
|
|
24
24
|
'ncf__delivery-option--single': isSingle
|
|
25
25
|
}]);
|
|
26
|
-
var shippingZone = (0, _supportedCountries.
|
|
26
|
+
var shippingZone = (0, _supportedCountries.identifyShippingZone)(countryCode);
|
|
27
27
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
28
28
|
id: fieldId,
|
|
29
29
|
className: divClassName,
|
|
@@ -72,7 +72,7 @@ function DeliveryOption(_ref) {
|
|
|
72
72
|
})));
|
|
73
73
|
}
|
|
74
74
|
DeliveryOption.propTypes = {
|
|
75
|
-
country: _propTypes["default"].
|
|
75
|
+
country: _propTypes["default"].string.isRequired,
|
|
76
76
|
productCode: _propTypes["default"].string,
|
|
77
77
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
78
78
|
value: _propTypes["default"].oneOf(['PV', 'HD', 'EV']),
|
package/dist/payment-term.jsx
CHANGED
|
@@ -19,8 +19,8 @@ function PaymentTerm(_ref) {
|
|
|
19
19
|
inputName = _ref$inputName === void 0 ? 'paymentTerm' : _ref$inputName,
|
|
20
20
|
_ref$isPrintOrBundle = _ref.isPrintOrBundle,
|
|
21
21
|
isPrintOrBundle = _ref$isPrintOrBundle === void 0 ? false : _ref$isPrintOrBundle,
|
|
22
|
-
_ref$
|
|
23
|
-
|
|
22
|
+
_ref$isDigitalEdition = _ref.isDigitalEdition,
|
|
23
|
+
isDigitalEdition = _ref$isDigitalEdition === void 0 ? false : _ref$isDigitalEdition,
|
|
24
24
|
_ref$options = _ref.options,
|
|
25
25
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
26
26
|
_ref$showLegal = _ref.showLegal,
|
|
@@ -221,7 +221,7 @@ function PaymentTerm(_ref) {
|
|
|
221
221
|
}, option.chargeOnText)));
|
|
222
222
|
};
|
|
223
223
|
var getTermDisplayName = function getTermDisplayName() {
|
|
224
|
-
var showTrialCopyInTitle = option.isTrial && !isPrintOrBundle && !
|
|
224
|
+
var showTrialCopyInTitle = option.isTrial && !isPrintOrBundle && !isDigitalEdition;
|
|
225
225
|
|
|
226
226
|
// https://financialtimes.atlassian.net/browse/ACQ-2592
|
|
227
227
|
// We need to have one specific trial offer to have terms displayed as non-trial.
|
|
@@ -296,7 +296,7 @@ PaymentTerm.propTypes = {
|
|
|
296
296
|
fieldId: _propTypes["default"].string,
|
|
297
297
|
inputName: _propTypes["default"].string,
|
|
298
298
|
isPrintOrBundle: _propTypes["default"].bool,
|
|
299
|
-
|
|
299
|
+
isDigitalEdition: _propTypes["default"].bool,
|
|
300
300
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
301
301
|
b2cDiscountCopy: _propTypes["default"].string,
|
|
302
302
|
isB2cPartnership: _propTypes["default"].bool,
|
package/helpers/index.js
CHANGED
|
@@ -4,8 +4,7 @@ module.exports = {
|
|
|
4
4
|
cemeaV1ISO: require('./supportedCountries').cemeaV1ISO,
|
|
5
5
|
cemeaV2ISO: require('./supportedCountries').cemeaV2ISO,
|
|
6
6
|
apacISO: require('./supportedCountries').apacISO,
|
|
7
|
-
|
|
8
|
-
.identifyFTShippingZone,
|
|
7
|
+
identifyShippingZone: require('./supportedCountries').identifyShippingZone,
|
|
9
8
|
countriesSupported: require('./supportedCountries').countriesSupported,
|
|
10
9
|
countriesSupportedISO: require('./supportedCountries').countriesSupportedISO,
|
|
11
10
|
supportedPostcodeValidators: require('./supportedPostcodeValidators')
|
package/helpers/index.spec.js
CHANGED
|
@@ -31,8 +31,8 @@ describe('helpers', () => {
|
|
|
31
31
|
expect(helpers).toHaveProperty('apacISO');
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
it('export
|
|
35
|
-
expect(helpers).toHaveProperty('
|
|
34
|
+
it('export identifyShippingZone', () => {
|
|
35
|
+
expect(helpers).toHaveProperty('identifyShippingZone');
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it('export countriesSupported', () => {
|
|
@@ -60,7 +60,7 @@ const apacISO = Object.keys(supportedCountriesMasterList.apac);
|
|
|
60
60
|
const countriesSupported = flattenObj(supportedCountriesMasterList);
|
|
61
61
|
const countriesSupportedISO = Object.keys(countriesSupported);
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const identifyShippingZone = (country) => {
|
|
64
64
|
if (cemeaV1ISO.includes(country)) {
|
|
65
65
|
return printRegions.cemeaV1;
|
|
66
66
|
}
|
|
@@ -79,5 +79,5 @@ module.exports = {
|
|
|
79
79
|
apacISO,
|
|
80
80
|
countriesSupported,
|
|
81
81
|
countriesSupportedISO,
|
|
82
|
-
|
|
82
|
+
identifyShippingZone,
|
|
83
83
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/n-conversion-forms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "39.1.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": {
|
|
@@ -171,7 +171,7 @@ const deliveryOptionMessages = [
|
|
|
171
171
|
customId: 'ML',
|
|
172
172
|
flightMarket: true,
|
|
173
173
|
description:
|
|
174
|
-
'Enjoy delivery of the newspaper to your home or office address. Note this is a postal delivery - expect delivery after the day of publication. If you would prefer to read the newspaper on the day of publication, purchase an FT
|
|
174
|
+
'Enjoy delivery of the newspaper to your home or office address. Note this is a postal delivery - expect delivery after the day of publication. If you would prefer to read the newspaper on the day of publication, purchase an FT Digital Edition subscription, our digital replica of each daily edition.',
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
deliveryFrequency: [
|
|
@@ -197,7 +197,7 @@ const deliveryOptionMessages = [
|
|
|
197
197
|
title: 'Mail',
|
|
198
198
|
customId: 'ML',
|
|
199
199
|
description:
|
|
200
|
-
"We can only deliver the newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT
|
|
200
|
+
"We can only deliver the newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT Digital Edition - a digital replica of the print edition.",
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
deliveryFrequency: [ONLY_WEEKEND_DELIVERY_FREQ],
|
|
@@ -246,10 +246,19 @@ const deliveryOptionMessages = [
|
|
|
246
246
|
title: 'Mail',
|
|
247
247
|
customId: 'ML',
|
|
248
248
|
description:
|
|
249
|
-
"We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT
|
|
249
|
+
"We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT Digital Edition - a digital replica of the print edition.",
|
|
250
250
|
},
|
|
251
251
|
];
|
|
252
252
|
|
|
253
|
+
// Default delivery options based on delivery type
|
|
254
|
+
const defaultDeliveryOptionsMap = {
|
|
255
|
+
HD: {
|
|
256
|
+
title: 'Hand delivery',
|
|
257
|
+
description:
|
|
258
|
+
'Enjoy delivery of the newspaper daily to your home or office address.',
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
|
|
253
262
|
function includesDeliveryFrequency(productCode = '', item) {
|
|
254
263
|
return item.deliveryFrequency.find((freq) => {
|
|
255
264
|
const productCodePattern = deliveryFrequencyProductsMapping[freq];
|
|
@@ -308,7 +317,10 @@ function getDeliveryOption({ productCode, option, shippingZone, countryCode }) {
|
|
|
308
317
|
return countryCodeToCustomDeliveryOptionsMap[countryCode][option.value];
|
|
309
318
|
}
|
|
310
319
|
|
|
311
|
-
return
|
|
320
|
+
return (
|
|
321
|
+
findCustomDeliveryOption(productCode, option, shippingZone) ||
|
|
322
|
+
defaultDeliveryOptionsMap[option.value]
|
|
323
|
+
);
|
|
312
324
|
}
|
|
313
325
|
|
|
314
326
|
module.exports = {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const { getDeliveryOption } = require('./delivery-option-messages');
|
|
2
2
|
|
|
3
|
+
const defaultHandDeliveryOption = {
|
|
4
|
+
title: 'Hand delivery',
|
|
5
|
+
description:
|
|
6
|
+
'Enjoy delivery of the newspaper daily to your home or office address.',
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
describe('Find Custom Delivery Option', () => {
|
|
4
10
|
const stubOption = { value: 'HD' };
|
|
5
11
|
const sixDaysProductCode = 'P2N6D';
|
|
@@ -20,7 +26,7 @@ describe('Find Custom Delivery Option', () => {
|
|
|
20
26
|
shippingZone: 'AAA',
|
|
21
27
|
countryCode: 'AAA',
|
|
22
28
|
})
|
|
23
|
-
).
|
|
29
|
+
).toEqual(defaultHandDeliveryOption);
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
it('returns undefined when invalid distributor type code', () => {
|
|
@@ -45,7 +51,7 @@ describe('Find Custom Delivery Option', () => {
|
|
|
45
51
|
shippingZone: 'AAA',
|
|
46
52
|
countryCode: 'AAA',
|
|
47
53
|
})
|
|
48
|
-
).
|
|
54
|
+
).toEqual(defaultHandDeliveryOption);
|
|
49
55
|
});
|
|
50
56
|
});
|
|
51
57
|
|
|
@@ -103,7 +109,7 @@ describe('Find Custom Delivery Option', () => {
|
|
|
103
109
|
title: 'Mail',
|
|
104
110
|
customId: 'ML',
|
|
105
111
|
description:
|
|
106
|
-
"We can only deliver the newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT
|
|
112
|
+
"We can only deliver the newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT Digital Edition - a digital replica of the print edition.",
|
|
107
113
|
};
|
|
108
114
|
|
|
109
115
|
const deliveryOption = getDeliveryOption({
|
|
@@ -121,7 +127,7 @@ describe('Find Custom Delivery Option', () => {
|
|
|
121
127
|
title: 'Mail',
|
|
122
128
|
customId: 'ML',
|
|
123
129
|
description:
|
|
124
|
-
"We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT
|
|
130
|
+
"We can only deliver the FT Weekend newspaper to your location by postal mail which means your delivery will arrive up to 5 business days after the date of publication and will not include the HTSI Magazine. We also fly the newspaper to your location which means delivery is subject to flight delays/cancellations outside the FT's control. If you prefer to read the printed content on the day of publication, please proceed to subscribe to the FT Digital Edition - a digital replica of the print edition.",
|
|
125
131
|
};
|
|
126
132
|
|
|
127
133
|
const deliveryOption = getDeliveryOption({
|
|
@@ -200,7 +206,7 @@ describe('Find Custom Delivery Option', () => {
|
|
|
200
206
|
title: 'Mail Delivery',
|
|
201
207
|
customId: 'ML',
|
|
202
208
|
description:
|
|
203
|
-
'Enjoy delivery of the newspaper to your home or office address. Note this is a postal delivery - expect delivery after the day of publication. If you would prefer to read the newspaper on the day of publication, purchase an FT
|
|
209
|
+
'Enjoy delivery of the newspaper to your home or office address. Note this is a postal delivery - expect delivery after the day of publication. If you would prefer to read the newspaper on the day of publication, purchase an FT Digital Edition subscription, our digital replica of each daily edition.',
|
|
204
210
|
};
|
|
205
211
|
|
|
206
212
|
const deliveryOption = getDeliveryOption({
|