@financial-times/n-conversion-forms 44.4.2 → 44.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "18c9354c1405982569dd5700f0878577de52746d",
5
- "tag": "v44.4.2",
6
- "buildNumber": "17030"
4
+ "version": "b5701ec726caa486c364874cd38b94dc91b23a04",
5
+ "tag": "v44.5.0",
6
+ "buildNumber": "17440"
7
7
  }
@@ -9,6 +9,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
9
9
  <div class="ncf__payment-term__item o-forms-input--radio-round ncf__payment-term__item--discount">
10
10
  <input type="radio"
11
11
  id="270"
12
+ data-base-amount="270"
12
13
  name="paymentTerm"
13
14
  value="270"
14
15
  class="o-forms-input__radio o-forms-input__radio--right ncf__payment-term__input"
@@ -27,7 +28,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
27
28
  </span>
28
29
  <div>
29
30
  <span class="ncf__payment-term__large-price">
30
- 270.00
31
+ €270.00
31
32
  </span>
32
33
  <p class="ncf__payment-term__charge-on-text">
33
34
  You will be charged on May 1, 2021
@@ -38,6 +39,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
38
39
  <div class="ncf__payment-term__item o-forms-input--radio-round ncf__payment-term__item--discount">
39
40
  <input type="radio"
40
41
  id="300"
42
+ data-base-amount="300"
41
43
  name="paymentTerm"
42
44
  value="300"
43
45
  class="o-forms-input__radio o-forms-input__radio--right ncf__payment-term__input"
@@ -54,7 +56,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
54
56
  </span>
55
57
  <div>
56
58
  <span class="ncf__payment-term__large-price">
57
- 300.00
59
+ €300.00
58
60
  </span>
59
61
  <p class="ncf__payment-term__charge-on-text">
60
62
  You will be charged on May 1, 2021
@@ -52,13 +52,13 @@ export function AcceptTermsSubscriptionUpdatedUI({
52
52
  <li>
53
53
  <span className="terms-updated-ui-transition terms-updated-ui-transition--end-of-term">
54
54
  I consent to payment being taken at the end of each subscription
55
- term until I cancel. By accepting, I am aware that my subscription
56
- will renew on the date given. I understand and agree that I will
57
- lose my statutory right to cancel within 14 days of accepting my
58
- order, and that any notice to cancel will only take effect at the
59
- end of my subscription period. Previously paid amounts are
60
- non-refundable, except in the event of a fault in the provision of
61
- services.
55
+ term until I cancel. By placing my order, I acknowledge that my
56
+ subscription will start on the date given above. I understand and
57
+ agree that I will lose my statutory right to cancel within 14 days
58
+ of accepting my order, and that any notice to cancel will only take
59
+ effect at the end of my subscription period. Previously paid amounts
60
+ are non-refundable, except in the event of a fault in the provision
61
+ of services.
62
62
  </span>
63
63
  </li>
64
64
  )}
@@ -36,7 +36,7 @@ describe('AcceptTermsSubscriptionUpdatedUI', () => {
36
36
  );
37
37
  expect(updatedUITransitionTerms.exists()).toBe(true);
38
38
  expect(updatedUITransitionTerms.text()).toBe(
39
- 'I consent to payment being taken at the end of each subscription term until I cancel. By accepting, I am aware that my subscription will renew on the date given. I understand and agree that I will lose my statutory right to cancel within 14 days of accepting my order, and that any notice to cancel will only take effect at the end of my subscription period. Previously paid amounts are non-refundable, except in the event of a fault in the provision of services.'
39
+ 'I consent to payment being taken at the end of each subscription term until I cancel. By placing my order, I acknowledge that my subscription will start on the date given above. I understand and agree that I will lose my statutory right to cancel within 14 days of accepting my order, and that any notice to cancel will only take effect at the end of my subscription period. Previously paid amounts are non-refundable, except in the event of a fault in the provision of services.'
40
40
  );
41
41
  });
42
42
 
@@ -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 { Period, Monthly } from '@financial-times/n-pricing';
4
+ import { Period, Monthly, Price } from '@financial-times/n-pricing';
5
5
 
6
6
  export function PaymentTerm({
7
7
  fieldId = 'paymentTermField',
@@ -210,6 +210,7 @@ export function PaymentTerm({
210
210
  )
211
211
  );
212
212
  };
213
+
213
214
  const createDescription = () => {
214
215
  return option.isTrial ? (
215
216
  <div className="ncf__payment-term__description">
@@ -252,7 +253,10 @@ export function PaymentTerm({
252
253
  <span
253
254
  className={largePrice ? 'ncf__payment-term__large-price' : ''}
254
255
  >
255
- {option.price}
256
+ {new Price({
257
+ value: option.amount,
258
+ symbol: option.symbol,
259
+ }).getAmountFormatted()}
256
260
  </span>
257
261
  {option.chargeOnText && (
258
262
  <p className="ncf__payment-term__charge-on-text">
@@ -265,6 +265,8 @@ describe('PaymentTerm', () => {
265
265
  title: 'Annual',
266
266
  subTitle: '(Renews annually unless cancelled)',
267
267
  price: '€ 270.00',
268
+ symbol: '€',
269
+ amount: 270.0,
268
270
  value: 270.0,
269
271
  isTrial: false,
270
272
  discount: '33%',
@@ -275,6 +277,8 @@ describe('PaymentTerm', () => {
275
277
  {
276
278
  title: '12 Month Subscription',
277
279
  price: '€ 300.00',
280
+ symbol: '€',
281
+ amount: 300.0,
278
282
  value: 300.0,
279
283
  isTrial: false,
280
284
  discount: '10%',
@@ -37,7 +37,7 @@ function AcceptTermsSubscriptionUpdatedUI(_ref) {
37
37
  className: "terms-updated-ui-transition terms-updated-ui-transition--immediate"
38
38
  }, "I consent to payment being taken at the end of each subscription term until I cancel. I understand and agree that I will lose my statutory right to cancel within 14 days of accepting my order, and that any notice to cancel will only take effect at the end of my subscription period. Previously paid amounts are non-refundable, except in the event of a fault in the provision of services.")) : /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
39
39
  className: "terms-updated-ui-transition terms-updated-ui-transition--end-of-term"
40
- }, "I consent to payment being taken at the end of each subscription term until I cancel. By accepting, I am aware that my subscription will renew on the date given. I understand and agree that I will lose my statutory right to cancel within 14 days of accepting my order, and that any notice to cancel will only take effect at the end of my subscription period. Previously paid amounts are non-refundable, except in the event of a fault in the provision of services.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
40
+ }, "I consent to payment being taken at the end of each subscription term until I cancel. By placing my order, I acknowledge that my subscription will start on the date given above. I understand and agree that I will lose my statutory right to cancel within 14 days of accepting my order, and that any notice to cancel will only take effect at the end of my subscription period. Previously paid amounts are non-refundable, except in the event of a fault in the provision of services.")), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("span", {
41
41
  className: "terms-updated-ui-transition o3-type-body-base"
42
42
  }, "For more information, see our full", ' ', /*#__PURE__*/_react["default"].createElement("a", {
43
43
  href: "http://help.ft.com/help/legal-privacy/terms-conditions/",
@@ -204,7 +204,10 @@ function PaymentTerm(_ref) {
204
204
  className: "ncf__payment-term__description"
205
205
  }, nameMap['custom'].price(option.price), nameMap['custom'].monthlyPrice(option.monthlyPrice && option.monthlyPrice !== '0' ? Number(option.monthlyPrice) : getMonthlyPriceFromPeriod(option.amount, option.currency, option.value)), nameMap['custom'].renewsText(getTimeFromPeriod(option.value))) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
206
206
  className: largePrice ? 'ncf__payment-term__large-price' : ''
207
- }, option.price), option.chargeOnText && /*#__PURE__*/_react["default"].createElement("p", {
207
+ }, new _nPricing.Price({
208
+ value: option.amount,
209
+ symbol: option.symbol
210
+ }).getAmountFormatted()), option.chargeOnText && /*#__PURE__*/_react["default"].createElement("p", {
208
211
  className: "ncf__payment-term__charge-on-text"
209
212
  }, option.chargeOnText)));
210
213
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "44.4.2",
3
+ "version": "44.5.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": {