@financial-times/n-conversion-forms 28.4.0 → 28.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.
@@ -2411,7 +2411,7 @@
2411
2411
  "node_modules/@financial-times/n-logger": {
2412
2412
  "version": "5.7.2",
2413
2413
  "integrity": "sha512-MoTlTU5Zqge5ZeoHYbdfFAxKsMxBfrmWRD60QrUb3O+RBHtTkjySYX0lSP2SZQ7FbiVw/sYJokouvz/DYnDXVQ==",
2414
- "deprecated": "this version of n-logger is no longer supported. Please upgrade to the latest version",
2414
+ "deprecated": "n-logger is no longer supported. It will get security patches up until 2023-10-20. You should migrate to Reliability Kit Logger before this date https://github.com/Financial-Times/dotcom-reliability-kit/tree/main/packages/logger",
2415
2415
  "dev": true,
2416
2416
  "dependencies": {
2417
2417
  "isomorphic-fetch": "^2.2.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "28.4.0",
3
+ "version": "28.5.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acqusition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- const { Period, Monthly } = require('@financial-times/n-pricing');
1
+ const { Period } = require('@financial-times/n-pricing');
2
2
 
3
3
  /**
4
4
  * Utility for the `n-conversion-forms/partial/payment-term.html` partial
@@ -103,12 +103,6 @@ class PaymentTerm {
103
103
  }
104
104
  }
105
105
 
106
- getMontlyPriceFromPeriod(amount, currency, period) {
107
- const periodObj = new Period(period);
108
- const monthlyPrice = periodObj.calculatePrice('P1M', amount);
109
- return new Monthly({ value: monthlyPrice, currency }).getAmount('monthly');
110
- }
111
-
112
106
  /**
113
107
  * Update the payment term options
114
108
  * @param {Array} options Array of objects contain terms information
@@ -137,14 +131,8 @@ class PaymentTerm {
137
131
  if (trialPrice) {
138
132
  trialPrice.innerHTML = update.trialPrice;
139
133
  }
140
- if (monthlyPrice) {
141
- monthlyPrice.innerHTML = this.isValidPeriod(update.value)
142
- ? this.getMontlyPriceFromPeriod(
143
- update.amount,
144
- update.currency,
145
- update.value
146
- )
147
- : update.monthlyPrice;
134
+ if (monthlyPrice && update.monthlyPrice) {
135
+ monthlyPrice.innerHTML = update.monthlyPrice;
148
136
  }
149
137
  }
150
138
  }