@financial-times/n-conversion-forms 27.7.1 → 28.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/.eslintignore +1 -0
- package/build-state/npm-shrinkwrap.json +1808 -1324
- package/components/__snapshots__/payment-type.spec.js.snap +0 -2
- package/components/accept-terms.jsx +18 -16
- package/components/app-banner.jsx +1 -1
- package/components/b2c-partnership-confirmation.jsx +1 -1
- package/components/billing-city.jsx +1 -1
- package/components/billing-country.jsx +1 -1
- package/components/billing-postcode.jsx +1 -1
- package/components/company-name.jsx +1 -1
- package/components/confirmation.jsx +5 -4
- package/components/continue-reading.jsx +1 -1
- package/components/continue-reading.stories.js +1 -1
- package/components/country.jsx +1 -1
- package/components/customer-care.jsx +1 -1
- package/components/debug.jsx +1 -1
- package/components/decision-maker.jsx +1 -1
- package/components/decision-maker.spec.js +1 -1
- package/components/deferred-billing-terms.jsx +92 -76
- package/components/deferred-billing-terms.spec.js +5 -1
- package/components/deferred-billing-terms.stories.js +3 -3
- package/components/delivery-address-type.jsx +4 -4
- package/components/delivery-address.jsx +1 -1
- package/components/delivery-city.jsx +9 -5
- package/components/delivery-county.jsx +1 -1
- package/components/delivery-instructions.jsx +30 -21
- package/components/delivery-option.jsx +5 -2
- package/components/delivery-po-box.jsx +1 -1
- package/components/delivery-postcode.jsx +32 -28
- package/components/delivery-security-instructions.jsx +1 -1
- package/components/delivery-start-date.jsx +1 -1
- package/components/education-job-title.jsx +1 -1
- package/components/email.jsx +1 -1
- package/components/error-page.jsx +1 -1
- package/components/fieldset.jsx +1 -1
- package/components/first-name.jsx +1 -1
- package/components/form.jsx +1 -1
- package/components/google-sign-in.jsx +1 -1
- package/components/graduation-date.jsx +1 -1
- package/components/industry.jsx +1 -1
- package/components/job-title.jsx +1 -1
- package/components/last-name.jsx +1 -1
- package/components/licence-confirmation.jsx +10 -8
- package/components/licence-header.jsx +3 -3
- package/components/licence-sign-in.jsx +2 -2
- package/components/licence-title.jsx +2 -2
- package/components/lite-sub-confirmation.jsx +1 -1
- package/components/loader.jsx +1 -1
- package/components/message.jsx +1 -1
- package/components/organisation.jsx +1 -1
- package/components/package-change.jsx +1 -1
- package/components/password.jsx +1 -1
- package/components/payment-term.jsx +52 -43
- package/components/payment-term.spec.js +15 -9
- package/components/payment-term.stories.js +63 -63
- package/components/payment-type.jsx +4 -4
- package/components/personal-title.jsx +1 -1
- package/components/phone.jsx +1 -1
- package/components/position.jsx +1 -1
- package/components/progress-indicator.jsx +3 -3
- package/components/province.jsx +1 -1
- package/components/registration-confirmation.jsx +1 -1
- package/components/responsibility.jsx +1 -1
- package/components/section.jsx +1 -1
- package/components/state.jsx +1 -1
- package/components/submit.jsx +1 -1
- package/components/text-input.jsx +1 -1
- package/components/trial-banner.jsx +1 -1
- package/dist/deferred-billing-terms.js +2 -3
- package/dist/payment-term.js +1 -1
- package/dist/payment-type.js +2 -2
- package/helpers/index.js +11 -8
- package/helpers/ncf-countries.spec.js +1 -1
- package/helpers/supportedCountries.js +12 -5
- package/helpers/supportedPostcodeExamples.js +5 -5
- package/helpers/supportedPostcodeValidators.js +5 -5
- package/helpers/supportedPostcodeValidators.spec.js +30 -10
- package/helpers/utilities.js +4 -4
- package/jest.config.js +1 -5
- package/package.json +14 -17
- package/styles/message.scss +0 -16
- package/test-jest/helpers/expect-to-render-correctly.js +1 -1
- package/utils/app-banner.js +1 -1
- package/utils/apple-pay.js +15 -15
- package/utils/billing-city.js +1 -1
- package/utils/billing-country.js +3 -3
- package/utils/billing-postcode.js +1 -1
- package/utils/company-name.js +1 -1
- package/utils/countries.js +2 -2
- package/utils/country.js +3 -3
- package/utils/delivery-address-type.js +3 -3
- package/utils/delivery-address-type.spec.js +6 -2
- package/utils/delivery-address.js +1 -1
- package/utils/delivery-instructions.js +1 -1
- package/utils/delivery-option-messages.js +11 -11
- package/utils/delivery-option-messages.spec.js +4 -13
- package/utils/delivery-option.js +5 -5
- package/utils/delivery-po-box.js +1 -1
- package/utils/delivery-postcode.js +1 -1
- package/utils/delivery-start-date.js +4 -4
- package/utils/delivery-start-date.spec.js +3 -2
- package/utils/email.js +4 -4
- package/utils/email.spec.js +2 -1
- package/utils/event-notifier.js +1 -1
- package/utils/form-element.js +8 -8
- package/utils/loader.js +10 -10
- package/utils/password.js +2 -2
- package/utils/payment-term.js +16 -15
- package/utils/payment-type.js +14 -14
- package/utils/postcode.js +3 -3
- package/utils/postcode.spec.js +21 -12
- package/utils/province.js +1 -1
- package/utils/salesforce.js +2 -2
- package/utils/state.js +1 -1
- package/utils/submit.js +5 -5
- package/utils/tracking.js +7 -7
- package/utils/validation.js +18 -11
- package/utils/zuora-error-map.js +5 -5
- package/utils/zuora.js +17 -12
|
@@ -461,7 +461,6 @@ exports[`PaymentType render with enableCreditcard 1`] = `
|
|
|
461
461
|
overflow="visible"
|
|
462
462
|
scrolling="no"
|
|
463
463
|
frameborder="0"
|
|
464
|
-
allowtransparency="true"
|
|
465
464
|
class="z_hppm_iframe"
|
|
466
465
|
style="display:block;width:100%"
|
|
467
466
|
>
|
|
@@ -611,7 +610,6 @@ exports[`PaymentType render with enableDirectdebit 1`] = `
|
|
|
611
610
|
overflow="visible"
|
|
612
611
|
scrolling="no"
|
|
613
612
|
frameborder="0"
|
|
614
|
-
allowtransparency="true"
|
|
615
613
|
class="z_hppm_iframe"
|
|
616
614
|
style="display:block;width:100%"
|
|
617
615
|
>
|
|
@@ -4,7 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
const DEFAULT_AGE_RESTRICTION = '16';
|
|
6
6
|
|
|
7
|
-
export function AcceptTerms
|
|
7
|
+
export function AcceptTerms({
|
|
8
8
|
isAuthFirstAccount = false,
|
|
9
9
|
isAuthFirstPayment = false,
|
|
10
10
|
hasError = false,
|
|
@@ -52,7 +52,7 @@ export function AcceptTerms ({
|
|
|
52
52
|
|
|
53
53
|
const authFirstStepTerms = (
|
|
54
54
|
<>
|
|
55
|
-
{
|
|
55
|
+
{
|
|
56
56
|
<ul className="o-typography-list ncf__accept-terms-list">
|
|
57
57
|
<li>
|
|
58
58
|
<span className="terms-auth-first-step">
|
|
@@ -81,7 +81,7 @@ export function AcceptTerms ({
|
|
|
81
81
|
</span>
|
|
82
82
|
</li>
|
|
83
83
|
</ul>
|
|
84
|
-
|
|
84
|
+
}
|
|
85
85
|
{!hideConfirmTermsAndConditions && (
|
|
86
86
|
<label className={labelClassName} htmlFor="termsAcceptance">
|
|
87
87
|
<input {...inputProps} />
|
|
@@ -216,11 +216,12 @@ export function AcceptTerms ({
|
|
|
216
216
|
<li>
|
|
217
217
|
<span className="terms-transition terms-transition--immediate">
|
|
218
218
|
By placing my order, my subscription will start immediately and I am
|
|
219
|
-
aware and agree that I will therefore lose my statutory right to
|
|
220
|
-
subscription within 14 days of acceptance of my order. Any
|
|
221
|
-
cancellation that I provide will only take effect at the
|
|
222
|
-
period and previously paid amounts are
|
|
223
|
-
there is a fault in the
|
|
219
|
+
aware and agree that I will therefore lose my statutory right to
|
|
220
|
+
cancel my subscription within 14 days of acceptance of my order. Any
|
|
221
|
+
notice of cancellation that I provide will only take effect at the
|
|
222
|
+
end of my subscription period and previously paid amounts are
|
|
223
|
+
non-refundable, except in the event that there is a fault in the
|
|
224
|
+
provision of the services.
|
|
224
225
|
</span>
|
|
225
226
|
</li>
|
|
226
227
|
) : (
|
|
@@ -299,12 +300,13 @@ export function AcceptTerms ({
|
|
|
299
300
|
</li>
|
|
300
301
|
<li>
|
|
301
302
|
<span className="terms-signup">
|
|
302
|
-
By placing my order, my subscription will start immediately and I
|
|
303
|
-
aware and agree that I will therefore lose my statutory right
|
|
304
|
-
my subscription within 14 days of acceptance of my
|
|
305
|
-
cancellation that I provide will only take
|
|
306
|
-
subscription period and previously paid
|
|
307
|
-
except in the event that there is a
|
|
303
|
+
By placing my order, my subscription will start immediately and I
|
|
304
|
+
am aware and agree that I will therefore lose my statutory right
|
|
305
|
+
to cancel my subscription within 14 days of acceptance of my
|
|
306
|
+
order. Any notice of cancellation that I provide will only take
|
|
307
|
+
effect at the end of my subscription period and previously paid
|
|
308
|
+
amounts are non-refundable, except in the event that there is a
|
|
309
|
+
fault in the provision of the services.
|
|
308
310
|
</span>
|
|
309
311
|
</li>
|
|
310
312
|
<li>
|
|
@@ -335,8 +337,8 @@ export function AcceptTerms ({
|
|
|
335
337
|
const deferredBillingTerms = isDeferredBilling && (
|
|
336
338
|
<li>
|
|
337
339
|
<span className="terms-deferred">
|
|
338
|
-
Please note if you fail to make payment for your deferred billing plan
|
|
339
|
-
date your subscription will be automatically cancelled.
|
|
340
|
+
Please note if you fail to make payment for your deferred billing plan
|
|
341
|
+
within due date your subscription will be automatically cancelled.
|
|
340
342
|
</span>
|
|
341
343
|
</li>
|
|
342
344
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
export function B2CPartnershipConfirmation
|
|
4
|
+
export function B2CPartnershipConfirmation({ ctaElement = null }) {
|
|
5
5
|
const readingLinkProps = {
|
|
6
6
|
href: '/',
|
|
7
7
|
className: 'ncf__link',
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { getCountries } from '../utils/countries';
|
|
5
5
|
|
|
6
|
-
export function BillingCountry
|
|
6
|
+
export function BillingCountry({
|
|
7
7
|
fieldId = 'billingCountryField',
|
|
8
8
|
filterList = [],
|
|
9
9
|
hasError = false,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
|
|
4
4
|
const EMAIL_DEFAULT_TEXT = 'your email';
|
|
5
5
|
|
|
6
|
-
export function Confirmation
|
|
6
|
+
export function Confirmation({
|
|
7
7
|
// isTrial prop is needed for the floodlight pixel tracking.
|
|
8
8
|
isTrial = false,
|
|
9
9
|
isB2cPartnership = false,
|
|
@@ -20,7 +20,8 @@ export function Confirmation ({
|
|
|
20
20
|
...(isTrial && { 'data-signup-is-trial': 'true' }),
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const isB2cPartnershipCopyAvailable =
|
|
23
|
+
const isB2cPartnershipCopyAvailable =
|
|
24
|
+
isB2cPartnership && b2cPartnershipCopy.length > 0;
|
|
24
25
|
|
|
25
26
|
const detailElements = details && (
|
|
26
27
|
<React.Fragment>
|
|
@@ -68,8 +69,8 @@ export function Confirmation ({
|
|
|
68
69
|
{nextActionTop}
|
|
69
70
|
{!isB2cPartnershipCopyAvailable && (
|
|
70
71
|
<p className="ncf__paragraph">
|
|
71
|
-
We’ve sent confirmation to {email}. Make sure you check your spam
|
|
72
|
-
if you don’t receive it.
|
|
72
|
+
We’ve sent confirmation to {email}. Make sure you check your spam
|
|
73
|
+
folder if you don’t receive it.
|
|
73
74
|
</p>
|
|
74
75
|
)}
|
|
75
76
|
|
|
@@ -9,6 +9,6 @@ export default {
|
|
|
9
9
|
export const Basic = (args) => <ContinueReading {...args} />;
|
|
10
10
|
Basic.args = {
|
|
11
11
|
quote:
|
|
12
|
-
|
|
12
|
+
"The problem with quotes found on the internet, is that they're often not true - Abraham Lincoln",
|
|
13
13
|
link: 'https://ft.com/world',
|
|
14
14
|
};
|
package/components/country.jsx
CHANGED
|
@@ -6,7 +6,7 @@ const DEFAULT_HEADER_TEXT = 'Sorry, this is not available online';
|
|
|
6
6
|
const DEFAULT_MESSAGE_TEXT =
|
|
7
7
|
'Speak now to our Customer Care team to discuss your options';
|
|
8
8
|
|
|
9
|
-
export function CustomerCare
|
|
9
|
+
export function CustomerCare({
|
|
10
10
|
header = DEFAULT_HEADER_TEXT,
|
|
11
11
|
isCompact = false,
|
|
12
12
|
message = DEFAULT_MESSAGE_TEXT,
|
package/components/debug.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
export function Debug
|
|
4
|
+
export function Debug({ isTest = false, showHelpers = false, links = {} }) {
|
|
5
5
|
// Strings are used rather than JSX as this component is injected into HTML
|
|
6
6
|
// along with onclick handlers, styles and javascript. JSX will escape and
|
|
7
7
|
// modify the HTML which we do not want. Once our applications are on JSX
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
export function DecisionMaker
|
|
5
|
+
export function DecisionMaker({ hasError = false, value = 'yes' }) {
|
|
6
6
|
const radioButtonsWrapperClassNames = classNames([
|
|
7
7
|
'o-forms-input',
|
|
8
8
|
'o-forms-input--radio-box',
|
|
@@ -16,7 +16,7 @@ describe('DecisionMaker', () => {
|
|
|
16
16
|
expect(DecisionMaker).toRenderCorrectly(props);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
it(
|
|
19
|
+
it("renders with 'no' as default state for radio buttons", () => {
|
|
20
20
|
const props = { value: 'no' };
|
|
21
21
|
|
|
22
22
|
expect(DecisionMaker).toRenderCorrectly(props);
|
|
@@ -2,7 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
const CONSENT_AGE = 16;
|
|
5
|
-
export function DeferredBillingTerms
|
|
5
|
+
export function DeferredBillingTerms({
|
|
6
|
+
isDeferredBilling = false,
|
|
7
|
+
checkBoxTrackableAttr = 'field-terms',
|
|
8
|
+
trackableAttr = 'deferred-billing-terms',
|
|
9
|
+
errorMessage = 'Please accept our terms & conditions',
|
|
10
|
+
inputId = 'accept-deferred-billing-terms',
|
|
11
|
+
fieldId = 'accept-deferred-terms',
|
|
12
|
+
isChecked = false,
|
|
13
|
+
hasError = false,
|
|
14
|
+
}) {
|
|
6
15
|
const labelClassName = classNames([
|
|
7
16
|
'o-forms-input',
|
|
8
17
|
'o-forms-input--checkbox',
|
|
@@ -25,81 +34,88 @@ export function DeferredBillingTerms ({ isDeferredBilling = false, checkBoxTrack
|
|
|
25
34
|
'data-validate': 'required,checked',
|
|
26
35
|
...(isChecked && { 'data-trackable': trackableAttr }),
|
|
27
36
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<span className="ncf__paragraph">
|
|
48
|
-
I give consent for my chosen payment method to be charged automatically at the end of each subscription term until I cancel it by contacting Customer Care through chat, phone or email.
|
|
49
|
-
</span>
|
|
50
|
-
</p>
|
|
51
|
-
<p className={labelClassName}>
|
|
52
|
-
<span className="ncf__paragraph">
|
|
53
|
-
By placing my order, I acknowledge that my subscription will start on the date given above. Any cancellation notice received after that date will take effect at the end of my subscription term and previously paid amounts are non-refundable.
|
|
54
|
-
</span>
|
|
55
|
-
</p>
|
|
56
|
-
<p className={labelClassName}>
|
|
57
|
-
<span className="ncf__paragraph">
|
|
58
|
-
Find out more about our cancellation policy in our {' '}
|
|
59
|
-
<a
|
|
60
|
-
className="ncf__link--external"
|
|
61
|
-
href="https://help.ft.com/legal-privacy/terms-and-conditions/"
|
|
62
|
-
title="FT Legal Terms and Conditions help page"
|
|
63
|
-
target="_blank"
|
|
64
|
-
rel="noopener noreferrer"
|
|
65
|
-
data-trackable="terms-and-conditions"
|
|
66
|
-
>
|
|
67
|
-
Terms & Conditions
|
|
68
|
-
</a>
|
|
69
|
-
.
|
|
70
|
-
</span>
|
|
71
|
-
</p>
|
|
72
|
-
<p className={labelClassName}>
|
|
73
|
-
<span className="ncf__paragraph">
|
|
74
|
-
Please note that if you fail to make payment for your Deferred Billing Plan within the due date your subscription will be automatically cancelled.
|
|
75
|
-
{' '} <a
|
|
76
|
-
className="ncf__link--external"
|
|
77
|
-
href="https://help.ft.com/legal-privacy/terms-and-conditions/"
|
|
78
|
-
title="FT Legal Terms and Conditions help page"
|
|
79
|
-
target="_blank"
|
|
80
|
-
rel="noopener noreferrer"
|
|
81
|
-
data-trackable="terms-and-conditions"
|
|
82
|
-
>
|
|
83
|
-
Terms & Conditions
|
|
84
|
-
</a>
|
|
85
|
-
.
|
|
86
|
-
</span>
|
|
87
|
-
</p>
|
|
88
|
-
<div {...divProps}>
|
|
89
|
-
<label className={labelClassName} htmlFor={inputId} id={fieldId}>
|
|
90
|
-
<input {...inputProps} />
|
|
91
|
-
<span className="o-forms-input__label">
|
|
92
|
-
I agree with terms & conditions.
|
|
93
|
-
|
|
94
|
-
</span>
|
|
95
|
-
<p className="o-forms-input__error">
|
|
96
|
-
{errorMessage}
|
|
37
|
+
return (
|
|
38
|
+
isDeferredBilling && (
|
|
39
|
+
<>
|
|
40
|
+
<p className={labelClassName}>
|
|
41
|
+
<span className="ncf__paragraph">
|
|
42
|
+
I confirm I am {CONSENT_AGE} years or older and have read and agree
|
|
43
|
+
to the{' '}
|
|
44
|
+
<a
|
|
45
|
+
className="ncf__link--external"
|
|
46
|
+
href="https://help.ft.com/legal-privacy/terms-and-conditions/"
|
|
47
|
+
title="FT Legal Terms and Conditions help page"
|
|
48
|
+
target="_blank"
|
|
49
|
+
rel="noopener noreferrer"
|
|
50
|
+
data-trackable="terms-and-conditions"
|
|
51
|
+
>
|
|
52
|
+
Terms & Conditions
|
|
53
|
+
</a>
|
|
54
|
+
.
|
|
55
|
+
</span>
|
|
97
56
|
</p>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
57
|
+
<p className={labelClassName}>
|
|
58
|
+
<span className="ncf__paragraph">
|
|
59
|
+
I give consent for my chosen payment method to be charged
|
|
60
|
+
automatically at the end of each subscription term until I cancel it
|
|
61
|
+
by contacting Customer Care through chat, phone or email.
|
|
62
|
+
</span>
|
|
63
|
+
</p>
|
|
64
|
+
<p className={labelClassName}>
|
|
65
|
+
<span className="ncf__paragraph">
|
|
66
|
+
By placing my order, I acknowledge that my subscription will start
|
|
67
|
+
on the date given above. Any cancellation notice received after that
|
|
68
|
+
date will take effect at the end of my subscription term and
|
|
69
|
+
previously paid amounts are non-refundable.
|
|
70
|
+
</span>
|
|
71
|
+
</p>
|
|
72
|
+
<p className={labelClassName}>
|
|
73
|
+
<span className="ncf__paragraph">
|
|
74
|
+
Find out more about our cancellation policy in our{' '}
|
|
75
|
+
<a
|
|
76
|
+
className="ncf__link--external"
|
|
77
|
+
href="https://help.ft.com/legal-privacy/terms-and-conditions/"
|
|
78
|
+
title="FT Legal Terms and Conditions help page"
|
|
79
|
+
target="_blank"
|
|
80
|
+
rel="noopener noreferrer"
|
|
81
|
+
data-trackable="terms-and-conditions"
|
|
82
|
+
>
|
|
83
|
+
Terms & Conditions
|
|
84
|
+
</a>
|
|
85
|
+
.
|
|
86
|
+
</span>
|
|
87
|
+
</p>
|
|
88
|
+
<p className={labelClassName}>
|
|
89
|
+
<span className="ncf__paragraph">
|
|
90
|
+
Please note that if you fail to make payment for your Deferred
|
|
91
|
+
Billing Plan within the due date your subscription will be
|
|
92
|
+
automatically cancelled.{' '}
|
|
93
|
+
<a
|
|
94
|
+
className="ncf__link--external"
|
|
95
|
+
href="https://help.ft.com/legal-privacy/terms-and-conditions/"
|
|
96
|
+
title="FT Legal Terms and Conditions help page"
|
|
97
|
+
target="_blank"
|
|
98
|
+
rel="noopener noreferrer"
|
|
99
|
+
data-trackable="terms-and-conditions"
|
|
100
|
+
>
|
|
101
|
+
Terms & Conditions
|
|
102
|
+
</a>
|
|
103
|
+
.
|
|
104
|
+
</span>
|
|
105
|
+
</p>
|
|
106
|
+
<div {...divProps}>
|
|
107
|
+
<label className={labelClassName} htmlFor={inputId} id={fieldId}>
|
|
108
|
+
<input {...inputProps} />
|
|
109
|
+
<span className="o-forms-input__label">
|
|
110
|
+
I agree with terms & conditions.
|
|
111
|
+
</span>
|
|
112
|
+
<p className="o-forms-input__error">{errorMessage}</p>
|
|
113
|
+
</label>
|
|
114
|
+
</div>
|
|
115
|
+
</>
|
|
116
|
+
)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
103
119
|
|
|
104
120
|
DeferredBillingTerms.propTypes = {
|
|
105
121
|
hasError: PropTypes.bool,
|
|
@@ -108,5 +124,5 @@ DeferredBillingTerms.propTypes = {
|
|
|
108
124
|
fieldId: PropTypes.string,
|
|
109
125
|
inputId: PropTypes.string,
|
|
110
126
|
trackableAttr: PropTypes.string,
|
|
111
|
-
errorMessage: PropTypes.string
|
|
127
|
+
errorMessage: PropTypes.string,
|
|
112
128
|
};
|
|
@@ -29,7 +29,11 @@ describe('DeferredBillingTerms', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
it('renders appropriately if all props are set to false - no rendering of the component', () => {
|
|
32
|
-
const props = {
|
|
32
|
+
const props = {
|
|
33
|
+
isChecked: false,
|
|
34
|
+
isDeferredBilling: false,
|
|
35
|
+
hasError: false,
|
|
36
|
+
};
|
|
33
37
|
|
|
34
38
|
expect(DeferredBillingTerms).toRenderCorrectly(props);
|
|
35
39
|
});
|
|
@@ -11,8 +11,8 @@ export default {
|
|
|
11
11
|
fieldId: { control: 'string' },
|
|
12
12
|
trackableAttr: { control: 'string' },
|
|
13
13
|
errorMessage: { control: 'string' },
|
|
14
|
-
isDeferredBilling: { control: 'boolean' }
|
|
15
|
-
}
|
|
14
|
+
isDeferredBilling: { control: 'boolean' },
|
|
15
|
+
},
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const Basic = (args) => <DeferredBillingTerms {...args} />;
|
|
@@ -22,5 +22,5 @@ export const CheckedFlow = (args) => <DeferredBillingTerms {...args} />;
|
|
|
22
22
|
CheckedFlow.args = {
|
|
23
23
|
isChecked: true,
|
|
24
24
|
isDeferredBilling: true,
|
|
25
|
-
hasError: false
|
|
25
|
+
hasError: false,
|
|
26
26
|
};
|
|
@@ -7,13 +7,13 @@ const addressTypes = [
|
|
|
7
7
|
{ id: 'pobox', label: 'P.O. Box' },
|
|
8
8
|
];
|
|
9
9
|
|
|
10
|
-
export function DeliveryAddressType
|
|
10
|
+
export function DeliveryAddressType({
|
|
11
11
|
value = 'home',
|
|
12
12
|
fieldId = 'deliveryAddressTypeField',
|
|
13
13
|
inputName = 'deliveryAddressType',
|
|
14
14
|
options = ['home', 'company', 'pobox'],
|
|
15
15
|
editMode = false,
|
|
16
|
-
titlePrompt = ''
|
|
16
|
+
titlePrompt = '',
|
|
17
17
|
}) {
|
|
18
18
|
return (
|
|
19
19
|
<div
|
|
@@ -39,7 +39,7 @@ export function DeliveryAddressType ({
|
|
|
39
39
|
name={inputName}
|
|
40
40
|
value={type.id}
|
|
41
41
|
className="ncf__delivery-address-type__input"
|
|
42
|
-
disabled={editMode &&
|
|
42
|
+
disabled={editMode && type.id !== value}
|
|
43
43
|
defaultChecked={type.id === value}
|
|
44
44
|
/>
|
|
45
45
|
<span
|
|
@@ -61,5 +61,5 @@ DeliveryAddressType.propTypes = {
|
|
|
61
61
|
inputName: PropTypes.string,
|
|
62
62
|
value: PropTypes.oneOf(['home', 'company', 'pobox']),
|
|
63
63
|
options: PropTypes.arrayOf(PropTypes.oneOf(['home', 'company', 'pobox'])),
|
|
64
|
-
titlePrompt:PropTypes.string,
|
|
64
|
+
titlePrompt: PropTypes.string,
|
|
65
65
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
countriesSupportedISO,
|
|
6
|
+
identifyFTShippingZone,
|
|
7
|
+
} from '../helpers/supportedCountries';
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
export function DeliveryCity ({
|
|
9
|
+
export function DeliveryCity({
|
|
8
10
|
hasError = false,
|
|
9
11
|
value = '',
|
|
10
12
|
isDisabled = false,
|
|
@@ -20,7 +22,7 @@ export function DeliveryCity ({
|
|
|
20
22
|
GBR: 'e.g. Bath',
|
|
21
23
|
USA: 'e.g. Los Angeles',
|
|
22
24
|
CAN: 'e.g. Montreal',
|
|
23
|
-
ARE: 'e.g. Dubai'
|
|
25
|
+
ARE: 'e.g. Dubai',
|
|
24
26
|
};
|
|
25
27
|
const FTShippingZone = identifyFTShippingZone(country);
|
|
26
28
|
|
|
@@ -29,7 +31,9 @@ export function DeliveryCity ({
|
|
|
29
31
|
APAC: 'City/Prefecture',
|
|
30
32
|
DEFAULT: 'City',
|
|
31
33
|
};
|
|
32
|
-
const inputLabel = labelMapping[FTShippingZone]
|
|
34
|
+
const inputLabel = labelMapping[FTShippingZone]
|
|
35
|
+
? labelMapping[FTShippingZone]
|
|
36
|
+
: labelMapping['DEFAULT'];
|
|
33
37
|
|
|
34
38
|
return (
|
|
35
39
|
<label
|