@financial-times/n-conversion-forms 43.0.2 → 44.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
CHANGED
|
@@ -14,8 +14,6 @@ export function PaymentTerm({
|
|
|
14
14
|
optionsInARow = false,
|
|
15
15
|
billingCountry = '',
|
|
16
16
|
isTermedSubscriptionTermType = false,
|
|
17
|
-
isTrialOfferAsNonTrialOverride = false,
|
|
18
|
-
labelOverride = '', // this is a temporary hack for the February 2024 campaign
|
|
19
17
|
}) {
|
|
20
18
|
/**
|
|
21
19
|
* Compute monthly price for given term name
|
|
@@ -271,16 +269,6 @@ export function PaymentTerm({
|
|
|
271
269
|
const showTrialCopyInTitle =
|
|
272
270
|
option.isTrial && !isPrintOrBundle && !isDigitalEdition;
|
|
273
271
|
|
|
274
|
-
// https://financialtimes.atlassian.net/browse/ACQ-2592
|
|
275
|
-
// We need to have one specific trial offer to have terms displayed as non-trial.
|
|
276
|
-
// The offer is a trial offer and should use trial mechanics but should show as non-trial.
|
|
277
|
-
// There is nothing in the offer payload to identify when this should happen, we need to rely on the offer id.
|
|
278
|
-
// This is a TEMPORARY hack and will be removed once the campaign is over.
|
|
279
|
-
// A ticket as been raised already to deal with the clean up: https://financialtimes.atlassian.net/browse/ACQ-2593.
|
|
280
|
-
if (isTrialOfferAsNonTrialOverride && labelOverride) {
|
|
281
|
-
return labelOverride;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
272
|
const title =
|
|
285
273
|
option.name && nameMap[option.name] ? nameMap[option.name].title : '';
|
|
286
274
|
|
|
@@ -427,5 +415,4 @@ PaymentTerm.propTypes = {
|
|
|
427
415
|
largePrice: PropTypes.bool,
|
|
428
416
|
optionsInARow: PropTypes.bool,
|
|
429
417
|
billingCountry: PropTypes.string,
|
|
430
|
-
isTrialOfferAsNonTrialOverride: PropTypes.bool,
|
|
431
418
|
};
|
|
@@ -194,7 +194,7 @@ describe('PaymentTerm', () => {
|
|
|
194
194
|
);
|
|
195
195
|
});
|
|
196
196
|
});
|
|
197
|
-
describe('getDisplayName
|
|
197
|
+
describe('getDisplayName', () => {
|
|
198
198
|
const trialOptions = {
|
|
199
199
|
...baseOptions,
|
|
200
200
|
isTrial: true,
|
|
@@ -206,19 +206,6 @@ describe('PaymentTerm', () => {
|
|
|
206
206
|
/^Trial: Premium Digital - Monthly .*$/
|
|
207
207
|
);
|
|
208
208
|
});
|
|
209
|
-
it('handles trial to non-trial payment term display name', () => {
|
|
210
|
-
const options = [trialOptions];
|
|
211
|
-
const wrapper = shallow(
|
|
212
|
-
<PaymentTerm
|
|
213
|
-
options={options}
|
|
214
|
-
labelOverride={'some term label'}
|
|
215
|
-
isTrialOfferAsNonTrialOverride={true}
|
|
216
|
-
/>
|
|
217
|
-
);
|
|
218
|
-
expect(wrapper.find('.ncf__payment-term__label').text()).toMatch(
|
|
219
|
-
/^some term label.*$/
|
|
220
|
-
);
|
|
221
|
-
});
|
|
222
209
|
it('renders using displayName if available', () => {
|
|
223
210
|
const options = [
|
|
224
211
|
{
|
|
@@ -144,38 +144,3 @@ RenewOffers.args = {
|
|
|
144
144
|
],
|
|
145
145
|
optionsInARow: true,
|
|
146
146
|
};
|
|
147
|
-
|
|
148
|
-
// https://financialtimes.atlassian.net/browse/ACQ-2592
|
|
149
|
-
// We need to have one specific trial offer to have terms displayed as non-trial.
|
|
150
|
-
// The offer is a trial offer and should use trial mechanics but should show as non-trial.
|
|
151
|
-
// There is nothing in the offer payload to identify when this should happen, we need to rely on the offer id.
|
|
152
|
-
// This is a TEMPORARY hack and will be removed once the campaign is over.
|
|
153
|
-
// A ticket as been raised already to deal with the clean up: https://financialtimes.atlassian.net/browse/ACQ-2593.
|
|
154
|
-
export const PaymentTermLabelOverride = (args) => (
|
|
155
|
-
<div className="ncf">
|
|
156
|
-
<Fieldset>
|
|
157
|
-
<PaymentTerm {...args} />
|
|
158
|
-
</Fieldset>
|
|
159
|
-
</div>
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
PaymentTermLabelOverride.args = {
|
|
163
|
-
isTrialOfferAsNonTrialOverride: true,
|
|
164
|
-
labelOverride: 'some fancy payment term',
|
|
165
|
-
options: [
|
|
166
|
-
{
|
|
167
|
-
name: '6 monthly',
|
|
168
|
-
isTrial: false,
|
|
169
|
-
discount: '',
|
|
170
|
-
selected: false,
|
|
171
|
-
price: '$229.00',
|
|
172
|
-
trialPrice: '$0.00',
|
|
173
|
-
trialDuration: '',
|
|
174
|
-
monthlyPrice: '0',
|
|
175
|
-
amount: '229.00',
|
|
176
|
-
trialAmount: null,
|
|
177
|
-
value: 'P6M',
|
|
178
|
-
currency: 'USD',
|
|
179
|
-
},
|
|
180
|
-
],
|
|
181
|
-
};
|
package/dist/payment-term.jsx
CHANGED
|
@@ -32,11 +32,7 @@ function PaymentTerm(_ref) {
|
|
|
32
32
|
_ref$billingCountry = _ref.billingCountry,
|
|
33
33
|
billingCountry = _ref$billingCountry === void 0 ? '' : _ref$billingCountry,
|
|
34
34
|
_ref$isTermedSubscrip = _ref.isTermedSubscriptionTermType,
|
|
35
|
-
isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip
|
|
36
|
-
_ref$isTrialOfferAsNo = _ref.isTrialOfferAsNonTrialOverride,
|
|
37
|
-
isTrialOfferAsNonTrialOverride = _ref$isTrialOfferAsNo === void 0 ? false : _ref$isTrialOfferAsNo,
|
|
38
|
-
_ref$labelOverride = _ref.labelOverride,
|
|
39
|
-
labelOverride = _ref$labelOverride === void 0 ? '' : _ref$labelOverride;
|
|
35
|
+
isTermedSubscriptionTermType = _ref$isTermedSubscrip === void 0 ? false : _ref$isTermedSubscrip;
|
|
40
36
|
/**
|
|
41
37
|
* Compute monthly price for given term name
|
|
42
38
|
* @param {number} amount price in number format
|
|
@@ -214,16 +210,6 @@ function PaymentTerm(_ref) {
|
|
|
214
210
|
};
|
|
215
211
|
var getTermDisplayName = function getTermDisplayName() {
|
|
216
212
|
var showTrialCopyInTitle = option.isTrial && !isPrintOrBundle && !isDigitalEdition;
|
|
217
|
-
|
|
218
|
-
// https://financialtimes.atlassian.net/browse/ACQ-2592
|
|
219
|
-
// We need to have one specific trial offer to have terms displayed as non-trial.
|
|
220
|
-
// The offer is a trial offer and should use trial mechanics but should show as non-trial.
|
|
221
|
-
// There is nothing in the offer payload to identify when this should happen, we need to rely on the offer id.
|
|
222
|
-
// This is a TEMPORARY hack and will be removed once the campaign is over.
|
|
223
|
-
// A ticket as been raised already to deal with the clean up: https://financialtimes.atlassian.net/browse/ACQ-2593.
|
|
224
|
-
if (isTrialOfferAsNonTrialOverride && labelOverride) {
|
|
225
|
-
return labelOverride;
|
|
226
|
-
}
|
|
227
213
|
var title = option.name && nameMap[option.name] ? nameMap[option.name].title : '';
|
|
228
214
|
var termDisplayName = '';
|
|
229
215
|
if (showTrialCopyInTitle) {
|
|
@@ -315,6 +301,5 @@ PaymentTerm.propTypes = {
|
|
|
315
301
|
showLegal: _propTypes["default"].bool,
|
|
316
302
|
largePrice: _propTypes["default"].bool,
|
|
317
303
|
optionsInARow: _propTypes["default"].bool,
|
|
318
|
-
billingCountry: _propTypes["default"].string
|
|
319
|
-
isTrialOfferAsNonTrialOverride: _propTypes["default"].bool
|
|
304
|
+
billingCountry: _propTypes["default"].string
|
|
320
305
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/n-conversion-forms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "44.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": {
|