@financial-times/n-conversion-forms 31.0.0 → 31.0.2
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/.github/workflows/gh-pages-deploy.yml +3 -3
- package/.storybook/main.js +18 -10
- package/.toolkitrc.yml +7 -0
- package/.toolkitstate/ci.json +2 -2
- package/CONTRIBUTING.md +1 -1
- package/components/accept-terms-subscription.jsx +7 -5
- package/dist/accept-terms-business.jsx +74 -0
- package/dist/accept-terms-business.spec.jsx +40 -0
- package/dist/accept-terms-privacy-policy.jsx +71 -0
- package/dist/accept-terms-subscription.jsx +150 -0
- package/dist/accept-terms.jsx +217 -0
- package/dist/app-banner.jsx +51 -0
- package/dist/b2c-partnership-confirmation.jsx +64 -0
- package/dist/billing-city.jsx +58 -0
- package/dist/billing-country.jsx +43 -0
- package/dist/billing-postcode.jsx +76 -0
- package/dist/company-name.jsx +78 -0
- package/dist/confirmation.jsx +117 -0
- package/dist/continue-reading.jsx +45 -0
- package/dist/country.jsx +106 -0
- package/dist/customer-care.jsx +52 -0
- package/dist/debug.jsx +50 -0
- package/dist/decision-maker.jsx +72 -0
- package/dist/deferred-billing-terms.jsx +112 -0
- package/dist/delivery-address-map.jsx +184 -0
- package/dist/delivery-address-type.jsx +74 -0
- package/dist/delivery-address.jsx +123 -0
- package/dist/delivery-city.jsx +70 -0
- package/dist/delivery-county.jsx +48 -0
- package/dist/delivery-instructions.jsx +123 -0
- package/dist/delivery-option.jsx +77 -0
- package/dist/delivery-po-box.jsx +75 -0
- package/dist/delivery-postcode.jsx +116 -0
- package/dist/delivery-security-instructions.jsx +72 -0
- package/dist/delivery-start-date.jsx +77 -0
- package/dist/education-job-title.jsx +67 -0
- package/dist/email.jsx +90 -0
- package/dist/error-page.jsx +45 -0
- package/dist/fieldset.jsx +58 -0
- package/dist/first-name.jsx +73 -0
- package/dist/form.jsx +29 -0
- package/dist/google-sign-in.jsx +24 -0
- package/dist/graduation-date.jsx +112 -0
- package/dist/index.jsx +432 -0
- package/dist/industry.jsx +81 -0
- package/dist/job-title.jsx +65 -0
- package/dist/last-name.jsx +73 -0
- package/dist/licence-confirmation.jsx +67 -0
- package/dist/licence-header.jsx +52 -0
- package/dist/licence-sign-in.jsx +36 -0
- package/dist/licence-title.jsx +46 -0
- package/dist/lite-sub-confirmation.jsx +118 -0
- package/dist/loader.jsx +54 -0
- package/dist/message.jsx +101 -0
- package/dist/message.spec.jsx +96 -0
- package/dist/organisation.jsx +73 -0
- package/dist/package-change.jsx +38 -0
- package/dist/password.jsx +95 -0
- package/dist/payment-term.jsx +328 -0
- package/dist/payment-type.jsx +213 -0
- package/dist/personal-title.jsx +94 -0
- package/dist/phone.jsx +85 -0
- package/dist/position.jsx +86 -0
- package/dist/progress-indicator.jsx +66 -0
- package/dist/province.jsx +80 -0
- package/dist/registration-confirmation.jsx +108 -0
- package/dist/responsibility.jsx +84 -0
- package/dist/section.jsx +20 -0
- package/dist/seven-day-pass-experiment-confirmation.jsx +93 -0
- package/dist/state.jsx +80 -0
- package/dist/submit.jsx +52 -0
- package/dist/text-input.jsx +78 -0
- package/dist/trial-banner.jsx +29 -0
- package/package.json +19 -19
- package/toolkit/run-storybook/.toolkitrc.yml +1 -0
- package/toolkit/run-storybook/index.js +17 -0
|
@@ -13,13 +13,13 @@ jobs:
|
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/setup-node@v3
|
|
15
15
|
with:
|
|
16
|
-
node-version:
|
|
16
|
+
node-version: 18.x
|
|
17
17
|
- uses: actions/checkout@v2
|
|
18
18
|
with:
|
|
19
19
|
persist-credentials: false
|
|
20
20
|
- run: git config --global url."https://${{ secrets.NEXT_USER_PAT }}@github.com/".insteadOf ssh://git@github.com/
|
|
21
|
-
- run: npm install -g npm@
|
|
22
|
-
- run:
|
|
21
|
+
- run: npm install -g npm@9.6.7
|
|
22
|
+
- run: npm install
|
|
23
23
|
- run: npm run build-storybook
|
|
24
24
|
- name: Deploy
|
|
25
25
|
uses: peaceiris/actions-gh-pages@v3
|
package/.storybook/main.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
'stories': [
|
|
3
|
+
'../components/*.stories.js',
|
|
4
|
+
],
|
|
5
|
+
'addons': [
|
|
6
|
+
'@storybook/addon-essentials',
|
|
7
|
+
'@storybook/addon-a11y'
|
|
8
|
+
],
|
|
9
|
+
|
|
10
|
+
webpackFinal: async (config) => {
|
|
11
|
+
return config;
|
|
12
|
+
},
|
|
13
|
+
framework: {
|
|
14
|
+
name: "@storybook/react-webpack5",
|
|
15
|
+
options: {}
|
|
16
|
+
},
|
|
17
|
+
docs: {
|
|
18
|
+
autodocs: true
|
|
19
|
+
}
|
|
12
20
|
};
|
package/.toolkitrc.yml
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
plugins:
|
|
2
2
|
- "@dotcom-tool-kit/component"
|
|
3
|
+
- "@dotcom-tool-kit/babel"
|
|
3
4
|
- "@dotcom-tool-kit/jest"
|
|
4
5
|
- "@dotcom-tool-kit/eslint"
|
|
5
6
|
- "@dotcom-tool-kit/prettier"
|
|
6
7
|
- "@dotcom-tool-kit/lint-staged"
|
|
8
|
+
- './toolkit/run-storybook'
|
|
7
9
|
hooks:
|
|
8
10
|
git:precommit:
|
|
9
11
|
- SecretSquirrel
|
|
@@ -14,6 +16,11 @@ hooks:
|
|
|
14
16
|
test:ci:
|
|
15
17
|
- Eslint
|
|
16
18
|
- JestCI
|
|
19
|
+
run:local:
|
|
20
|
+
- RunStorybook
|
|
17
21
|
options:
|
|
18
22
|
"@dotcom-tool-kit/circleci":
|
|
19
23
|
nodeVersion: 18.17-browsers
|
|
24
|
+
"@dotcom-tool-kit/babel":
|
|
25
|
+
files: components/*.jsx
|
|
26
|
+
outputPath: dist
|
package/.toolkitstate/ci.json
CHANGED
package/CONTRIBUTING.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
To contribute to this project, clone this repository locally and commit your code to a seperate branch. Please write unit tests for your code and run the linter before opening a pull-request.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
npm test # runs linter and unit tests
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
# Releasing new versions
|
|
@@ -51,11 +51,13 @@ export function AcceptTermsSubscription({
|
|
|
51
51
|
<li>
|
|
52
52
|
<span className="terms-transition terms-transition--immediate">
|
|
53
53
|
By placing your order subject to the Terms & Conditions (save for
|
|
54
|
-
section 2) referred to below, you
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
the
|
|
54
|
+
section 2) referred to below, you agree that we may start your
|
|
55
|
+
7-day pass immediately upon our acceptance of your order and that
|
|
56
|
+
you are waiving your statutory right to cancel our contract within
|
|
57
|
+
14 days of confirmation. Your payment is a one-time payment
|
|
58
|
+
collected at the time of checkout, and cancelling at any point
|
|
59
|
+
(whether before or after the 14-day period) will not entitle you
|
|
60
|
+
to a refund.
|
|
59
61
|
</span>
|
|
60
62
|
</li>
|
|
61
63
|
<li>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AcceptTermsBusiness = AcceptTermsBusiness;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
function AcceptTermsBusiness(_ref) {
|
|
12
|
+
var _ref$hasError = _ref.hasError,
|
|
13
|
+
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
14
|
+
_ref$isB2b = _ref.isB2b,
|
|
15
|
+
isB2b = _ref$isB2b === void 0 ? false : _ref$isB2b,
|
|
16
|
+
_ref$isEmbedded = _ref.isEmbedded,
|
|
17
|
+
isEmbedded = _ref$isEmbedded === void 0 ? false : _ref$isEmbedded,
|
|
18
|
+
_ref$isTrial = _ref.isTrial,
|
|
19
|
+
isTrial = _ref$isTrial === void 0 ? false : _ref$isTrial;
|
|
20
|
+
var divProps = {
|
|
21
|
+
id: 'acceptTermsField',
|
|
22
|
+
className: 'o-forms-field o-layout-typography ncf__validation-error',
|
|
23
|
+
'data-validate': 'required,checked'
|
|
24
|
+
};
|
|
25
|
+
var labelClassName = (0, _classnames["default"])(['o-forms-input', 'o-forms-input--checkbox', {
|
|
26
|
+
'o-forms-input--invalid': hasError
|
|
27
|
+
}]);
|
|
28
|
+
var inputProps = {
|
|
29
|
+
id: 'termsAcceptance',
|
|
30
|
+
type: 'checkbox',
|
|
31
|
+
name: 'termsAcceptance',
|
|
32
|
+
value: 'true',
|
|
33
|
+
'data-trackable': 'field-terms',
|
|
34
|
+
'aria-required': 'true',
|
|
35
|
+
required: true
|
|
36
|
+
};
|
|
37
|
+
var b2bTerms = isB2b ? /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
38
|
+
className: "terms-b2b"
|
|
39
|
+
}, "By submitting this form, you indicate your consent to also being contacted by Financial Times by email, post, or phone about our other products, services or special offers unless you untick this box.")) : /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
40
|
+
className: "terms-default"
|
|
41
|
+
}, "I confirm I am 16 years or older and have read and agree to the", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
42
|
+
className: "ncf__link--external",
|
|
43
|
+
href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
|
|
44
|
+
target: isEmbedded ? '_top' : '_blank',
|
|
45
|
+
rel: "noopener noreferrer",
|
|
46
|
+
"data-trackable": "terms-and-conditions"
|
|
47
|
+
}, "Terms & Conditions"), "."));
|
|
48
|
+
var corpSignupTerms = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
49
|
+
className: "terms-corp-signup"
|
|
50
|
+
}, "Your organisation\u2019s administrator(s) may view basic usage and profile data about your account and have the ability to set up myFT topic follows on your behalf.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
51
|
+
className: "terms-corp-signup"
|
|
52
|
+
}, "Basic usage and profile data about your account can include; for example, your job title and profile information, the date you last visited, volume of content consumed, etc.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
53
|
+
className: "terms-corp-signup"
|
|
54
|
+
}, "myFT topics may be selected on your behalf by your company administrator or FT representative for you to follow. You can unfollow these topics or unsubscribe from the myFT digest through the Contact preferences section on myFT.")), isTrial && /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
55
|
+
className: "terms-corp-signup"
|
|
56
|
+
}, "This trial is to demonstrate the value of a group subscription and we\u2019ll contact you during your trial.")));
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
58
|
+
className: "o-typography-list ncf__accept-terms-list"
|
|
59
|
+
}, b2bTerms, corpSignupTerms), /*#__PURE__*/_react["default"].createElement("label", {
|
|
60
|
+
className: labelClassName,
|
|
61
|
+
htmlFor: "termsAcceptance"
|
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
|
|
63
|
+
className: "o-forms-input__label"
|
|
64
|
+
}, "I agree to the above terms & conditions."), /*#__PURE__*/_react["default"].createElement("p", {
|
|
65
|
+
className: "o-forms-input__error"
|
|
66
|
+
}, "Please accept our terms & conditions")));
|
|
67
|
+
}
|
|
68
|
+
AcceptTermsBusiness.propTypes = {
|
|
69
|
+
hasError: _propTypes["default"].bool,
|
|
70
|
+
isChecked: _propTypes["default"].bool,
|
|
71
|
+
isB2b: _propTypes["default"].bool,
|
|
72
|
+
isEmbedded: _propTypes["default"].bool,
|
|
73
|
+
isTrial: _propTypes["default"].bool
|
|
74
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5
|
+
var _enzyme = require("enzyme");
|
|
6
|
+
var _index = require("./index");
|
|
7
|
+
describe('AcceptTermsPrivacyPolicy', function () {
|
|
8
|
+
it('renders with "o-forms-input--invalid" class when hasError prop is true', function () {
|
|
9
|
+
var props = {
|
|
10
|
+
hasError: true
|
|
11
|
+
};
|
|
12
|
+
var component = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.AcceptTermsBusiness, props));
|
|
13
|
+
var labelElement = component.find('label');
|
|
14
|
+
expect(labelElement.hasClass('o-forms-input--invalid')).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('renders the B2B terms when isB2b prop is true', function () {
|
|
17
|
+
var props = {
|
|
18
|
+
isB2b: true
|
|
19
|
+
};
|
|
20
|
+
var component = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.AcceptTermsBusiness, props));
|
|
21
|
+
var b2bTerms = component.find('.terms-b2b');
|
|
22
|
+
expect(b2bTerms.exists()).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
it('renders the external link with target="_blank" when isEmbedded prop is false', function () {
|
|
25
|
+
var props = {
|
|
26
|
+
isEmbedded: false
|
|
27
|
+
};
|
|
28
|
+
var component = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.AcceptTermsBusiness, props));
|
|
29
|
+
var externalLink = component.find('.ncf__link--external');
|
|
30
|
+
expect(externalLink.prop('target')).toBe('_blank');
|
|
31
|
+
});
|
|
32
|
+
it('renders the trial terms when isTrial prop is true', function () {
|
|
33
|
+
var props = {
|
|
34
|
+
isTrial: true
|
|
35
|
+
};
|
|
36
|
+
var component = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index.AcceptTermsBusiness, props));
|
|
37
|
+
var trialTerms = component.find('.terms-corp-signup');
|
|
38
|
+
expect(trialTerms.exists()).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AcceptTermsPrivacyPolicy = AcceptTermsPrivacyPolicy;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
function AcceptTermsPrivacyPolicy(_ref) {
|
|
12
|
+
var _ref$hasError = _ref.hasError,
|
|
13
|
+
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
14
|
+
_ref$isEmbedded = _ref.isEmbedded,
|
|
15
|
+
isEmbedded = _ref$isEmbedded === void 0 ? false : _ref$isEmbedded,
|
|
16
|
+
children = _ref.children;
|
|
17
|
+
var divProps = {
|
|
18
|
+
id: 'acceptTermsField',
|
|
19
|
+
className: 'o-forms-field o-layout-typography ncf__validation-error',
|
|
20
|
+
'data-validate': 'required,checked'
|
|
21
|
+
};
|
|
22
|
+
var labelClassName = (0, _classnames["default"])(['o-forms-input', 'o-forms-input--checkbox', {
|
|
23
|
+
'o-forms-input--invalid': hasError
|
|
24
|
+
}]);
|
|
25
|
+
var inputProps = {
|
|
26
|
+
id: 'termsAcceptance',
|
|
27
|
+
type: 'checkbox',
|
|
28
|
+
name: 'termsAcceptance',
|
|
29
|
+
value: 'true',
|
|
30
|
+
'data-trackable': 'field-terms',
|
|
31
|
+
'aria-required': 'true',
|
|
32
|
+
required: true
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("div", {
|
|
35
|
+
className: "privacy-policy-terms"
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement("label", {
|
|
37
|
+
className: labelClassName,
|
|
38
|
+
htmlFor: "termsAcceptance"
|
|
39
|
+
}, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
|
|
40
|
+
className: "o-forms-input__label"
|
|
41
|
+
}, "I confirm that I am 16 years or older and agree to the full", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
42
|
+
className: "ncf__link--external",
|
|
43
|
+
href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
|
|
44
|
+
target: isEmbedded ? '_top' : '_blank',
|
|
45
|
+
rel: "noopener noreferrer",
|
|
46
|
+
"data-trackable": "terms-and-conditions"
|
|
47
|
+
}, "Terms & Conditions"), "."), /*#__PURE__*/_react["default"].createElement("p", {
|
|
48
|
+
className: "o-forms-input__error"
|
|
49
|
+
}, "Please accept our terms & conditions")), children && /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
|
+
className: "children-container"
|
|
51
|
+
}, children), /*#__PURE__*/_react["default"].createElement("span", {
|
|
52
|
+
className: "consent-text--bottom"
|
|
53
|
+
}, "For more information about how we use your data, please refer to our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
54
|
+
className: "ncf__link--external",
|
|
55
|
+
href: "https://help.ft.com/legal-privacy/privacy-policy/",
|
|
56
|
+
target: "_blank",
|
|
57
|
+
rel: "noopener noreferrer",
|
|
58
|
+
"data-trackable": "privacy-policy-info"
|
|
59
|
+
}, "privacy"), ' ', "and\xA0", /*#__PURE__*/_react["default"].createElement("a", {
|
|
60
|
+
className: "ncf__link--external",
|
|
61
|
+
href: "https://help.ft.com/legal-privacy/cookies/",
|
|
62
|
+
target: "_blank",
|
|
63
|
+
rel: "noopener noreferrer",
|
|
64
|
+
"data-trackable": "cookies-info"
|
|
65
|
+
}, "cookie"), ' ', "policies.")));
|
|
66
|
+
}
|
|
67
|
+
AcceptTermsPrivacyPolicy.propTypes = {
|
|
68
|
+
hasError: _propTypes["default"].bool,
|
|
69
|
+
isEmbedded: _propTypes["default"].bool,
|
|
70
|
+
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node])
|
|
71
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AcceptTermsSubscription = AcceptTermsSubscription;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function AcceptTermsSubscription(_ref) {
|
|
15
|
+
var _ref$hasError = _ref.hasError,
|
|
16
|
+
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
17
|
+
_ref$isSignup = _ref.isSignup,
|
|
18
|
+
isSignup = _ref$isSignup === void 0 ? false : _ref$isSignup,
|
|
19
|
+
_ref$isEmbedded = _ref.isEmbedded,
|
|
20
|
+
isEmbedded = _ref$isEmbedded === void 0 ? false : _ref$isEmbedded,
|
|
21
|
+
_ref$isTrial = _ref.isTrial,
|
|
22
|
+
isTrial = _ref$isTrial === void 0 ? false : _ref$isTrial,
|
|
23
|
+
_ref$isPrintProduct = _ref.isPrintProduct,
|
|
24
|
+
isPrintProduct = _ref$isPrintProduct === void 0 ? false : _ref$isPrintProduct,
|
|
25
|
+
_ref$isSingleTerm = _ref.isSingleTerm,
|
|
26
|
+
isSingleTerm = _ref$isSingleTerm === void 0 ? false : _ref$isSingleTerm,
|
|
27
|
+
_ref$is7DayPassExperi = _ref.is7DayPassExperiment,
|
|
28
|
+
is7DayPassExperiment = _ref$is7DayPassExperi === void 0 ? false : _ref$is7DayPassExperi,
|
|
29
|
+
_ref$isTransition = _ref.isTransition,
|
|
30
|
+
isTransition = _ref$isTransition === void 0 ? false : _ref$isTransition,
|
|
31
|
+
_ref$transitionType = _ref.transitionType,
|
|
32
|
+
transitionType = _ref$transitionType === void 0 ? null : _ref$transitionType,
|
|
33
|
+
_ref$isDeferredBillin = _ref.isDeferredBilling,
|
|
34
|
+
isDeferredBilling = _ref$isDeferredBillin === void 0 ? false : _ref$isDeferredBillin;
|
|
35
|
+
var divProps = _objectSpread({
|
|
36
|
+
id: 'acceptTermsField',
|
|
37
|
+
className: 'o-forms-field o-layout-typography ncf__validation-error',
|
|
38
|
+
'data-validate': 'required,checked'
|
|
39
|
+
}, isSignup && {
|
|
40
|
+
'data-trackable': 'sign-up-terms'
|
|
41
|
+
});
|
|
42
|
+
var labelClassName = (0, _classnames["default"])(['o-forms-input', 'o-forms-input--checkbox', {
|
|
43
|
+
'o-forms-input--invalid': hasError
|
|
44
|
+
}]);
|
|
45
|
+
var inputProps = {
|
|
46
|
+
id: 'termsAcceptance',
|
|
47
|
+
type: 'checkbox',
|
|
48
|
+
name: 'termsAcceptance',
|
|
49
|
+
value: 'true',
|
|
50
|
+
'data-trackable': 'field-terms',
|
|
51
|
+
'aria-required': 'true',
|
|
52
|
+
required: true
|
|
53
|
+
};
|
|
54
|
+
if (is7DayPassExperiment) {
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
56
|
+
className: "o-typography-list ncf__accept-terms-list"
|
|
57
|
+
}, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
58
|
+
className: "terms-transition terms-transition--immediate"
|
|
59
|
+
}, "I give consent for my chosen payment method to be charged automatically.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
60
|
+
className: "terms-transition terms-transition--immediate"
|
|
61
|
+
}, "By placing your order subject to the Terms & Conditions (save for section 2) referred to below, you agree that we may start your 7-day pass immediately upon our acceptance of your order and that you are waiving your statutory right to cancel our contract within 14 days of confirmation. Your payment is a one-time payment collected at the time of checkout, and cancelling at any point (whether before or after the 14-day period) will not entitle you to a refund.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
62
|
+
className: "terms-transition"
|
|
63
|
+
}, "Please see here for the complete", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
64
|
+
className: "ncf__link--external",
|
|
65
|
+
href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
|
|
66
|
+
target: "_blank",
|
|
67
|
+
rel: "noopener noreferrer"
|
|
68
|
+
}, "Terms & Conditions"), "."))), /*#__PURE__*/_react["default"].createElement("label", {
|
|
69
|
+
className: labelClassName,
|
|
70
|
+
htmlFor: "termsAcceptance"
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
|
|
72
|
+
className: "o-forms-input__label"
|
|
73
|
+
}, "I agree to the above terms & conditions."), /*#__PURE__*/_react["default"].createElement("p", {
|
|
74
|
+
className: "o-forms-input__error"
|
|
75
|
+
}, "Please accept our terms & conditions")));
|
|
76
|
+
}
|
|
77
|
+
var transitionTerms = isTransition && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !isSingleTerm && /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
78
|
+
className: "terms-transition"
|
|
79
|
+
}, "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", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
80
|
+
className: "ncf__link--external",
|
|
81
|
+
href: "https://help.ft.com/help/contact-us/",
|
|
82
|
+
target: "_blank",
|
|
83
|
+
rel: "noopener noreferrer"
|
|
84
|
+
}, "customer care through chat, phone or email"), ".")), transitionType === 'immediate' ? /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
85
|
+
className: "terms-transition terms-transition--immediate"
|
|
86
|
+
}, "By placing my order, my subscription will start immediately and I am aware and agree that I will therefore lose my statutory right to cancel my subscription within 14 days of acceptance of my order. Any notice of cancellation that I provide will only take effect at the end of my subscription period and previously paid amounts are non-refundable, except in the event that there is a fault in the provision of the services.")) : /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
87
|
+
className: "terms-transition terms-transition--other"
|
|
88
|
+
}, "By placing my order, I acknowledge that my subscription will start", isSingleTerm ? ' and the chosen payment method will be charged ' : ' ', "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.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
89
|
+
className: "terms-transition"
|
|
90
|
+
}, "Find out more about our cancellation policy in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
91
|
+
className: "ncf__link--external",
|
|
92
|
+
href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
|
|
93
|
+
target: "_blank",
|
|
94
|
+
rel: "noopener noreferrer"
|
|
95
|
+
}, "Terms & Conditions"), ".")));
|
|
96
|
+
var deferredBillingTerms = isDeferredBilling && /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
97
|
+
className: "terms-deferred"
|
|
98
|
+
}, "Please note if you fail to make payment for your deferred billing plan within due date your subscription will be automatically cancelled."));
|
|
99
|
+
var printSignupTermText = isTrial ? 'Credits for delivery suspension or delivery failure are not available during introductory offer periods.' : 'Credit for delivery suspensions is only available for hand-delivered subscriptions and is limited to a maximum of 24 issues per yearly subscription terms (4 issues per yearly FT Weekend subscription term).';
|
|
100
|
+
var printTerms = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
101
|
+
className: "terms-print"
|
|
102
|
+
}, printSignupTermText)), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
103
|
+
className: "terms-print"
|
|
104
|
+
}, "Find out more about your delivery start date in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
105
|
+
className: "ncf__link--external",
|
|
106
|
+
href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
|
|
107
|
+
target: isEmbedded ? '_top' : '_blank',
|
|
108
|
+
rel: "noopener noreferrer"
|
|
109
|
+
}, "Terms & Conditions"), ".")));
|
|
110
|
+
var nonPrintTerms = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
111
|
+
className: "terms-signup"
|
|
112
|
+
}, "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", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
113
|
+
className: "ncf__link--external",
|
|
114
|
+
href: "https://help.ft.com/help/contact-us/",
|
|
115
|
+
target: isEmbedded ? '_top' : '_blank',
|
|
116
|
+
rel: "noopener noreferrer"
|
|
117
|
+
}, "customer care through chat, phone or email"), ".")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
118
|
+
className: "terms-signup"
|
|
119
|
+
}, "By placing my order, my subscription will start immediately and I am aware and agree that I will therefore lose my statutory right to cancel my subscription within 14 days of acceptance of my order. Any notice of cancellation that I provide will only take effect at the end of my subscription period and previously paid amounts are non-refundable, except in the event that there is a fault in the provision of the services.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
120
|
+
className: "terms-signup"
|
|
121
|
+
}, "Find out more about our cancellation policy in our", ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
|
122
|
+
className: "ncf__link--external",
|
|
123
|
+
href: "https://help.ft.com/legal-privacy/terms-and-conditions/",
|
|
124
|
+
target: isEmbedded ? '_top' : '_blank',
|
|
125
|
+
rel: "noopener noreferrer"
|
|
126
|
+
}, "Terms & Conditions"), ".")));
|
|
127
|
+
var signupTerms = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isPrintProduct ? printTerms : nonPrintTerms);
|
|
128
|
+
return /*#__PURE__*/_react["default"].createElement("div", divProps, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
129
|
+
className: "o-typography-list ncf__accept-terms-list"
|
|
130
|
+
}, transitionTerms, signupTerms, deferredBillingTerms), /*#__PURE__*/_react["default"].createElement("label", {
|
|
131
|
+
className: labelClassName,
|
|
132
|
+
htmlFor: "termsAcceptance"
|
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement("input", inputProps), /*#__PURE__*/_react["default"].createElement("span", {
|
|
134
|
+
className: "o-forms-input__label"
|
|
135
|
+
}, "I agree to the above terms & conditions."), /*#__PURE__*/_react["default"].createElement("p", {
|
|
136
|
+
className: "o-forms-input__error"
|
|
137
|
+
}, "Please accept our terms & conditions")));
|
|
138
|
+
}
|
|
139
|
+
AcceptTermsSubscription.propTypes = {
|
|
140
|
+
hasError: _propTypes["default"].bool,
|
|
141
|
+
isSignup: _propTypes["default"].bool,
|
|
142
|
+
isEmbedded: _propTypes["default"].bool,
|
|
143
|
+
isTrial: _propTypes["default"].bool,
|
|
144
|
+
isPrintProduct: _propTypes["default"].bool,
|
|
145
|
+
isSingleTerm: _propTypes["default"].bool,
|
|
146
|
+
is7DayPassExperiment: _propTypes["default"].bool,
|
|
147
|
+
isTransition: _propTypes["default"].bool,
|
|
148
|
+
transitionType: _propTypes["default"].string,
|
|
149
|
+
isDeferredBilling: _propTypes["default"].bool
|
|
150
|
+
};
|