@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.
- package/.toolkitstate/ci.json +3 -3
- package/components/__snapshots__/confirmation.spec.js.snap +3 -3
- package/components/accept-terms-subscription.jsx +3 -3
- package/components/accept-terms-subscription.spec.js +2 -2
- package/components/accept-terms-subscription.stories.js +3 -3
- package/components/confirmation.jsx +11 -8
- package/components/confirmation.spec.js +6 -6
- package/components/confirmation.stories.js +5 -5
- package/components/delivery-option.jsx +6 -6
- package/components/delivery-option.stories.js +8 -8
- package/components/payment-term.jsx +8 -8
- package/components/payment-term.spec.js +14 -14
- package/components/payment-term.stories.js +3 -3
- package/dist/accept-terms-subscription.jsx +4 -4
- package/dist/confirmation.jsx +9 -9
- package/dist/delivery-option.jsx +8 -8
- package/dist/payment-term.jsx +10 -10
- package/package.json +1 -1
- package/utils/delivery-option-messages.js +9 -9
- package/utils/delivery-option-messages.spec.js +8 -8
package/.toolkitstate/ci.json
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
|
95
|
+
it('renders the transition terms when isNonRenewingSubscriptionTermType prop is true', () => {
|
|
96
96
|
const props = {
|
|
97
|
-
|
|
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
|
|
33
|
+
export const NonRenewingTermType = (args) => (
|
|
34
34
|
<AcceptTermsSubscription {...args} />
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
{
|
|
69
|
-
{
|
|
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}
|
|
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
|
-
{
|
|
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
|
-
|
|
146
|
-
|
|
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(
|
|
32
|
+
it('renders appropriately if is auto-renewing subscription term type', () => {
|
|
33
33
|
const props = {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
isAutoRenewingSubscriptionTermType: true,
|
|
35
|
+
isNonRenewingSubscriptionTermType: false,
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
expect(Confirmation).toRenderCorrectly(props);
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
it(
|
|
41
|
+
it('renders appropriately if is non-renewing subscription term type', () => {
|
|
42
42
|
const props = {
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
67
|
-
|
|
66
|
+
export const NonRenewingTermType = (args) => <Confirmation {...args} />;
|
|
67
|
+
NonRenewingTermType.args = {
|
|
68
68
|
sendConfirmationEmail: false,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
offer: '
|
|
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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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
|
-
|
|
104
|
-
|
|
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
|
|
37
|
+
export const UKPaperVoucherAutoReniewingDeliveryOptions = (args) => (
|
|
38
38
|
<div className="ncf">
|
|
39
39
|
<DeliveryOption {...args} />
|
|
40
40
|
</div>
|
|
41
41
|
);
|
|
42
|
-
|
|
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
|
-
|
|
51
|
-
|
|
50
|
+
isAutoRenewingSubscriptionTermType: true,
|
|
51
|
+
isNonRenewingSubscriptionTermType: false,
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
export const
|
|
54
|
+
export const UKPaperVoucherNonRenewingDeliveryOptions = (args) => (
|
|
55
55
|
<div className="ncf">
|
|
56
56
|
<DeliveryOption {...args} />
|
|
57
57
|
</div>
|
|
58
58
|
);
|
|
59
|
-
|
|
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
|
-
|
|
68
|
-
|
|
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
|
-
|
|
17
|
-
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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
|
-
|
|
419
|
-
|
|
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('
|
|
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
|
-
|
|
148
|
-
|
|
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
|
-
|
|
178
|
-
|
|
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('
|
|
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
|
-
|
|
201
|
-
|
|
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
|
|
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
|
-
|
|
232
|
-
|
|
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
|
|
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
|
-
|
|
265
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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$
|
|
29
|
-
|
|
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 (
|
|
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
|
-
|
|
138
|
+
isNonRenewingSubscriptionTermType: _propTypes["default"].bool,
|
|
139
139
|
isTransition: _propTypes["default"].bool,
|
|
140
140
|
transitionType: _propTypes["default"].string,
|
|
141
141
|
isDeferredBilling: _propTypes["default"].bool,
|
package/dist/confirmation.jsx
CHANGED
|
@@ -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$
|
|
24
|
-
|
|
25
|
-
_ref$
|
|
26
|
-
|
|
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
|
-
},
|
|
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,
|
|
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.")),
|
|
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
|
-
|
|
114
|
-
|
|
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({
|
package/dist/delivery-option.jsx
CHANGED
|
@@ -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$
|
|
24
|
-
|
|
25
|
-
_ref$
|
|
26
|
-
|
|
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
|
-
|
|
48
|
-
|
|
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
|
-
|
|
92
|
-
|
|
91
|
+
isAutoRenewingSubscriptionTermType: _propTypes["default"].bool,
|
|
92
|
+
isNonRenewingSubscriptionTermType: _propTypes["default"].bool
|
|
93
93
|
};
|
package/dist/payment-term.jsx
CHANGED
|
@@ -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$
|
|
35
|
-
|
|
36
|
-
_ref$
|
|
37
|
-
|
|
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),
|
|
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)),
|
|
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
|
-
},
|
|
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"), ".")),
|
|
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
|
-
|
|
303
|
-
|
|
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": "
|
|
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
|
-
|
|
44
|
-
|
|
43
|
+
isAutoRenewingSubscriptionTermType,
|
|
44
|
+
isNonRenewingSubscriptionTermType,
|
|
45
45
|
}) => {
|
|
46
|
-
if (
|
|
46
|
+
if (isAutoRenewingSubscriptionTermType) {
|
|
47
47
|
return '13-week voucher pack delivered quarterly and redeemable at retailers nationwide.';
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
if (
|
|
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
|
-
//
|
|
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
|
-
|
|
335
|
-
|
|
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
|
-
|
|
351
|
-
|
|
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('
|
|
146
|
-
it('returns UK Paper Vouchers delivery option for
|
|
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
|
-
|
|
159
|
-
|
|
158
|
+
isAutoRenewingSubscriptionTermType: true,
|
|
159
|
+
isNonRenewingSubscriptionTermType: false,
|
|
160
160
|
});
|
|
161
161
|
|
|
162
162
|
expect(deliveryOption).toEqual(expected);
|
|
163
163
|
});
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
describe('
|
|
167
|
-
it('returns UK Paper Vouchers delivery option for
|
|
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
|
-
|
|
180
|
-
|
|
179
|
+
isAutoRenewingSubscriptionTermType: false,
|
|
180
|
+
isNonRenewingSubscriptionTermType: true,
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
expect(deliveryOption).toEqual(expected);
|