@newskit-render/my-account 7.151.2 → 7.151.3-351f40919.8
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/dist/cjs/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.d.ts +2 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js +28 -3
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/cjs/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js +54 -13
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/types.d.ts +29 -4
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.d.ts +22 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js +163 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.d.ts +21 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js +95 -0
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.d.ts +9 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js +38 -0
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js +2 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js.map +1 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js +2 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js.map +1 -0
- package/dist/cjs/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/cjs/Components/Templates/CancellationStepperRender.d.ts +3 -3
- package/dist/cjs/Components/Templates/CancellationStepperRender.js +11 -6
- package/dist/cjs/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/cjs/api/queryHandler.js +24 -13
- package/dist/cjs/api/queryHandler.js.map +1 -1
- package/dist/cjs/context/types.d.ts +9 -3
- package/dist/cjs/context/types.js.map +1 -1
- package/dist/cjs/helpers/cancellationUtils.d.ts +19 -0
- package/dist/cjs/helpers/cancellationUtils.js +65 -1
- package/dist/cjs/helpers/cancellationUtils.js.map +1 -1
- package/dist/cjs/helpers/getQuery.js +2 -3
- package/dist/cjs/helpers/getQuery.js.map +1 -1
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +1 -2
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/helpers/stringUtils.d.ts +1 -0
- package/dist/cjs/helpers/stringUtils.js +9 -0
- package/dist/cjs/helpers/stringUtils.js.map +1 -0
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js +78 -8
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/cjs/queries/getIncentivePreview.d.ts +2 -0
- package/dist/cjs/queries/getIncentivePreview.js +11 -0
- package/dist/cjs/queries/getIncentivePreview.js.map +1 -0
- package/dist/cjs/queries/index.d.ts +1 -0
- package/dist/cjs/queries/index.js +1 -0
- package/dist/cjs/queries/index.js.map +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.d.ts +2 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js +28 -3
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/esm/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js +54 -13
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/types.d.ts +29 -4
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.d.ts +22 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js +133 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.d.ts +21 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js +88 -0
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.d.ts +9 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js +31 -0
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js +2 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js.map +1 -0
- package/dist/esm/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js +2 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js.map +1 -0
- package/dist/esm/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/esm/Components/Templates/CancellationStepperRender.d.ts +3 -3
- package/dist/esm/Components/Templates/CancellationStepperRender.js +11 -6
- package/dist/esm/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/esm/api/queryHandler.js +24 -13
- package/dist/esm/api/queryHandler.js.map +1 -1
- package/dist/esm/context/types.d.ts +9 -3
- package/dist/esm/context/types.js.map +1 -1
- package/dist/esm/helpers/cancellationUtils.d.ts +19 -0
- package/dist/esm/helpers/cancellationUtils.js +62 -0
- package/dist/esm/helpers/cancellationUtils.js.map +1 -1
- package/dist/esm/helpers/getQuery.js +3 -4
- package/dist/esm/helpers/getQuery.js.map +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -2
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/helpers/stringUtils.d.ts +1 -0
- package/dist/esm/helpers/stringUtils.js +5 -0
- package/dist/esm/helpers/stringUtils.js.map +1 -0
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js +79 -9
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/esm/queries/getIncentivePreview.d.ts +2 -0
- package/dist/esm/queries/getIncentivePreview.js +8 -0
- package/dist/esm/queries/getIncentivePreview.js.map +1 -0
- package/dist/esm/queries/index.d.ts +1 -0
- package/dist/esm/queries/index.js +1 -0
- package/dist/esm/queries/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextBlockProps } from 'newskit';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SummaryRowProps {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
labelOverrides?: TextBlockProps;
|
|
7
|
+
valueOverrides?: TextBlockProps;
|
|
8
|
+
}
|
|
9
|
+
export declare const SummaryRow: React.FC<SummaryRowProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.SummaryRow = void 0;
|
|
29
|
+
var newskit_1 = require("newskit");
|
|
30
|
+
var react_1 = __importDefault(require("react"));
|
|
31
|
+
var SummaryRow = function (_a) {
|
|
32
|
+
var label = _a.label, value = _a.value, labelOverrides = _a.labelOverrides, valueOverrides = _a.valueOverrides, rest = __rest(_a, ["label", "value", "labelOverrides", "valueOverrides"]);
|
|
33
|
+
return (react_1.default.createElement(newskit_1.Stack, __assign({ flow: "horizontal-stretch", stackDistribution: "space-between" }, rest),
|
|
34
|
+
react_1.default.createElement(newskit_1.TextBlock, __assign({}, labelOverrides), label),
|
|
35
|
+
react_1.default.createElement(newskit_1.TextBlock, __assign({}, valueOverrides), value)));
|
|
36
|
+
};
|
|
37
|
+
exports.SummaryRow = SummaryRow;
|
|
38
|
+
//# sourceMappingURL=SummaryRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SummaryRow.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/SummaryRow.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA0D;AAC1D,gDAAyB;AAQlB,IAAM,UAAU,GAA8B,UAAC,EAMrD;IALC,IAAA,KAAK,WAAA,EACL,KAAK,WAAA,EACL,cAAc,oBAAA,EACd,cAAc,oBAAA,EACX,IAAI,cAL6C,sDAMrD,CADQ;IAEP,OAAO,CACL,8BAAC,eAAK,aACJ,IAAI,EAAC,oBAAoB,EACzB,iBAAiB,EAAC,eAAe,IAC7B,IAAI;QAER,8BAAC,mBAAS,eAAK,cAAc,GAAG,KAAK,CAAa;QAClD,8BAAC,mBAAS,eAAK,cAAc,GAAG,KAAK,CAAa,CAC5C,CACT,CAAA;AACH,CAAC,CAAA;AAjBY,QAAA,UAAU,cAiBtB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/index.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/OfferPreview/types.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import { InfoPanel, IntroductionProps, ModalProps, ListItemType, InvoiceAndNotic
|
|
|
2
2
|
import { StandaloneLinkPropsOverridable } from '../../Elements/StandaloneLinkComponent';
|
|
3
3
|
import { MQ, ImageProps } from 'newskit';
|
|
4
4
|
import { NewslettersGridOverrides, CancellationItem, CancellationSection } from '../../../context/types';
|
|
5
|
-
import { HandleCardClick,
|
|
5
|
+
import { HandleCardClick, NextStepProps } from '../../Templates/CancellationStepperRender';
|
|
6
6
|
import { UserData } from '../../../pages/types';
|
|
7
7
|
export type BelowContentExtra = {
|
|
8
8
|
type: 'delivery-address' | 'cancel-subscription' | 'no-billing' | 'payment-history' | 'leave-family';
|
|
@@ -34,7 +34,7 @@ export interface BaseSectionProps extends CancellationSection, CancellationItem
|
|
|
34
34
|
}
|
|
35
35
|
export interface GridSectionProps extends CancellationSection {
|
|
36
36
|
baseUrl?: string;
|
|
37
|
-
onNextStep:
|
|
37
|
+
onNextStep: NextStepProps;
|
|
38
38
|
handleCardClick: HandleCardClick;
|
|
39
39
|
eventContext?: EventContext;
|
|
40
40
|
user?: UserData;
|
|
@@ -59,16 +59,16 @@ export declare const componentMap: {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
}, any, any>>;
|
|
62
|
-
offers: ({ baseUrl, header, offersSection, benefits, continueButton, continueButtonContainerOverrides,
|
|
63
|
-
discountPreview: React.FC<import("../Sections/SectionContainer").GridSectionProps>;
|
|
62
|
+
offers: ({ baseUrl, header, offersSection, benefits, continueButton, continueButtonContainerOverrides, setSelectedOffer, selectedOffer, onNextStep, }: import("../Sections/CancellationOffers").CancellationOffersProps) => JSX.Element;
|
|
64
63
|
offerConfirmation: ({ header, user, subscriptionDetails, buttonText, buttonEventContext, buttonUrl, baseUrl, buttonOverrides, }: import("../Sections/ConfirmSubscriptionOffer").ConfirmSubscriptionOfferProps) => JSX.Element | null;
|
|
64
|
+
offerPreview: React.FC<import("../Sections/OfferPreview/OfferPreview").OfferPreviewPops>;
|
|
65
65
|
};
|
|
66
66
|
export type SelectionData = {
|
|
67
67
|
id: string;
|
|
68
68
|
label?: string;
|
|
69
69
|
eventContext?: EventContext;
|
|
70
70
|
};
|
|
71
|
-
export type
|
|
71
|
+
export type NextStepProps = (event: React.MouseEvent, override?: string | null, eventContext?: Record<string, string>) => void;
|
|
72
72
|
export type HandleCardClick = (event: React.MouseEvent, selectionData: SelectionData) => void;
|
|
73
73
|
declare const CancellationStepperRender: React.FC;
|
|
74
74
|
export default CancellationStepperRender;
|
|
@@ -44,19 +44,19 @@ var CancellationReasons_1 = require("../Sections/CancellationReasons");
|
|
|
44
44
|
var CancellationDetails_1 = require("../Sections/CancellationDetails");
|
|
45
45
|
var helpers_1 = require("../../helpers");
|
|
46
46
|
var CancelSubscriptionDowngrade_1 = require("../Sections/CancelSubscriptionDowngrade");
|
|
47
|
-
var CancellationOffers_1 = require("../Sections/CancellationOffers");
|
|
48
47
|
var newskit_1 = require("newskit");
|
|
49
|
-
var SectionContainer_1 = require("../Sections/SectionContainer");
|
|
50
48
|
var ConfirmCancellation_1 = require("../Sections/ConfirmCancellation");
|
|
51
49
|
var ConfirmSubscriptionOffer_1 = require("../Sections/ConfirmSubscriptionOffer");
|
|
50
|
+
var CancellationOffers_1 = require("../Sections/CancellationOffers");
|
|
51
|
+
var OfferPreview_1 = require("../Sections/OfferPreview/OfferPreview");
|
|
52
52
|
exports.componentMap = {
|
|
53
53
|
reason: CancellationReasons_1.CancellationReasons,
|
|
54
54
|
downgrade: CancelSubscriptionDowngrade_1.CancelSubscriptionDowngrade,
|
|
55
55
|
preCancellation: CancellationDetails_1.CancellationDetails,
|
|
56
56
|
confirmCancel: ConfirmCancellation_1.ConfirmCancellationRender,
|
|
57
57
|
offers: CancellationOffers_1.CancellationOffers,
|
|
58
|
-
discountPreview: SectionContainer_1.GridSection,
|
|
59
58
|
offerConfirmation: ConfirmSubscriptionOffer_1.ConfirmSubscriptionOffer,
|
|
59
|
+
offerPreview: OfferPreview_1.OfferPreview,
|
|
60
60
|
};
|
|
61
61
|
var CancellationStepperRender = function () {
|
|
62
62
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -70,7 +70,12 @@ var CancellationStepperRender = function () {
|
|
|
70
70
|
if (!type || !componentSequence[type])
|
|
71
71
|
return null;
|
|
72
72
|
var _l = (0, react_1.useState)(null), selections = _l[0], setSelections = _l[1];
|
|
73
|
-
var pagesInOrder =
|
|
73
|
+
var pagesInOrder = [
|
|
74
|
+
'reason',
|
|
75
|
+
'downgrade',
|
|
76
|
+
'preCancellation',
|
|
77
|
+
'confirmCancel',
|
|
78
|
+
];
|
|
74
79
|
var _m = (0, react_1.useState)(null), overrideComponent = _m[0], setOverrideComponent = _m[1];
|
|
75
80
|
var _o = (0, react_1.useState)([]), filteredPages = _o[0], setFilteredPages = _o[1];
|
|
76
81
|
var _p = (0, react_1.useState)(((_e = (_d = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.serviceCancellationDate) || null), serviceCancellationDate = _p[0], setServiceCancellationDate = _p[1];
|
|
@@ -153,7 +158,7 @@ var CancellationStepperRender = function () {
|
|
|
153
158
|
// track page view event via Optimizely
|
|
154
159
|
(0, helpers_1.trackEvent)({
|
|
155
160
|
eventName: "cancellation_".concat(stepFromUrl.toLocaleLowerCase()),
|
|
156
|
-
cpn: userData
|
|
161
|
+
cpn: 'userData?.cpn',
|
|
157
162
|
subscriptions: (userData === null || userData === void 0 ? void 0 : userData.subscriptions) || [],
|
|
158
163
|
tags: __assign(__assign({}, context), { page_name: context.page_name || "online cancellation: ".concat(stepFromUrl), cancellation_type: ((_b = selections === null || selections === void 0 ? void 0 : selections.eventContext) === null || _b === void 0 ? void 0 : _b.article_parent_name) || '', step: stepFromUrl }),
|
|
159
164
|
});
|
|
@@ -164,7 +169,7 @@ var CancellationStepperRender = function () {
|
|
|
164
169
|
var shouldShowBackButton = (_f = componentProps === null || componentProps === void 0 ? void 0 : componentProps.showBackButton) !== null && _f !== void 0 ? _f : showBackButton;
|
|
165
170
|
return (react_1.default.createElement(shared_components_1.ContentContainer, __assign({ "data-testid": "section-container" }, componentProps === null || componentProps === void 0 ? void 0 : componentProps.contentContainerOverrides),
|
|
166
171
|
shouldShowBackButton && hederBackButtonProps && (react_1.default.createElement(shared_components_1.BackButton, { backButton: __assign(__assign({}, hederBackButtonProps), { href: '' }), backButtonOverrides: header.backButtonOverrides, eventContext: __assign(__assign({}, hederBackButtonProps === null || hederBackButtonProps === void 0 ? void 0 : hederBackButtonProps.eventContext), { page_name: (_g = componentProps === null || componentProps === void 0 ? void 0 : componentProps.tealiumContext) === null || _g === void 0 ? void 0 : _g.context.page_name }), onClick: handleBackBtn })),
|
|
167
|
-
react_1.default.createElement(SectionComponent, __assign({}, componentProps, { baseUrl: baseUrl, onNextStep: stepController, handleCardClick: handleCardClick, user: userData, selectedReason: selections, handleError: handleError, serviceCancellationDate: serviceCancellationDate, setServiceCancellationDate: setServiceCancellationDate, subType: ((_j = (_h = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.type) || '', selectedOffer: selectedOffer,
|
|
172
|
+
react_1.default.createElement(SectionComponent, __assign({}, componentProps, { baseUrl: baseUrl, onNextStep: stepController, handleCardClick: handleCardClick, user: userData, selectedReason: selections, handleError: handleError, serviceCancellationDate: serviceCancellationDate, setServiceCancellationDate: setServiceCancellationDate, subType: ((_j = (_h = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.type) || '', selectedOffer: selectedOffer, setSelectedOffer: setSelectedOffer, featureFlags: featureFlags }))));
|
|
168
173
|
};
|
|
169
174
|
exports.default = CancellationStepperRender;
|
|
170
175
|
//# sourceMappingURL=CancellationStepperRender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancellationStepperRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/CancellationStepperRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2D;AAC3D,uEAK0C;AAC1C,yCAAiD;AACjD,6CAG4B;AAC5B,8CAA4D;AAC5D,uEAAqE;AACrE,uEAAqE;AACrE,yCAA0D;AAC1D,uFAAqF;AACrF,
|
|
1
|
+
{"version":3,"file":"CancellationStepperRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/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,EAC/C,YAAY,wBACP,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,YAAY,KACrC,SAAS,EAAE,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,cAAc,0CAAE,OAAO,CAAC,SAAS,KAE9D,OAAO,EAAE,aAAa,GACtB,CACH;QACD,8BAAC,gBAAgB,eACX,cAAc,IAClB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,cAAc,EAC1B,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,QAAQ,EACd,cAAc,EAAE,UAAU,EAC1B,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,uBAAuB,EAChD,0BAA0B,EAAE,0BAA0B,EACtD,OAAO,EAAE,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,0CAAG,CAAC,CAAC,0CAAE,IAAI,KAAI,EAAE,EACjD,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,IAC1B,CACe,CACpB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,yBAAyB,CAAA"}
|
|
@@ -46,14 +46,26 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
+
t[p] = s[p];
|
|
53
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
+
t[p[i]] = s[p[i]];
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
};
|
|
49
60
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
61
|
exports.queryHandler = void 0;
|
|
51
62
|
var api_1 = require("@newskit-render/api");
|
|
52
63
|
var helpers_1 = require("../helpers");
|
|
64
|
+
var shared_components_1 = require("@newskit-render/shared-components");
|
|
53
65
|
var queryHandler = function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
-
var
|
|
55
|
-
return __generator(this, function (
|
|
56
|
-
switch (
|
|
66
|
+
var parsedData, queryFragment, pageSize, bodyProps, apolloClient, data, query, response, err_1;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
57
69
|
case 0:
|
|
58
70
|
if (req.method !== 'POST') {
|
|
59
71
|
res.status(405);
|
|
@@ -61,26 +73,25 @@ var queryHandler = function (req, res) { return __awaiter(void 0, void 0, void 0
|
|
|
61
73
|
res.end();
|
|
62
74
|
return [2 /*return*/];
|
|
63
75
|
}
|
|
64
|
-
|
|
76
|
+
parsedData = (0, shared_components_1.safeJsonParse)(req.body);
|
|
77
|
+
queryFragment = parsedData.queryFragment, pageSize = parsedData.pageSize, bodyProps = __rest(parsedData, ["queryFragment", "pageSize"]);
|
|
65
78
|
return [4 /*yield*/, (0, api_1.createApolloClient)(api_1.ClientTypes.main, req.headers.cookie)];
|
|
66
79
|
case 1:
|
|
67
|
-
apolloClient =
|
|
68
|
-
|
|
80
|
+
apolloClient = _a.sent();
|
|
81
|
+
_a.label = 2;
|
|
69
82
|
case 2:
|
|
70
|
-
|
|
83
|
+
_a.trys.push([2, 4, , 5]);
|
|
71
84
|
query = (0, helpers_1.getQuery)((0, helpers_1.getQueryByFragment)(queryFragment), queryFragment, pageSize);
|
|
72
85
|
return [4 /*yield*/, apolloClient.query({
|
|
73
86
|
query: query,
|
|
74
|
-
variables: {
|
|
75
|
-
pageSize: pageSize,
|
|
76
|
-
},
|
|
87
|
+
variables: __assign({ pageSize: pageSize }, bodyProps),
|
|
77
88
|
})];
|
|
78
89
|
case 3:
|
|
79
|
-
response =
|
|
80
|
-
data = __assign({}, response.data
|
|
90
|
+
response = _a.sent();
|
|
91
|
+
data = __assign({}, response.data);
|
|
81
92
|
return [3 /*break*/, 5];
|
|
82
93
|
case 4:
|
|
83
|
-
err_1 =
|
|
94
|
+
err_1 = _a.sent();
|
|
84
95
|
(0, helpers_1.handleNewRelicErrorLog)({
|
|
85
96
|
requestName: queryFragment,
|
|
86
97
|
reqError: err_1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryHandler.js","sourceRoot":"","sources":["../../../src/api/queryHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queryHandler.js","sourceRoot":"","sources":["../../../src/api/queryHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAAqE;AACrE,sCAImB;AACnB,uEAAiE;AAE1D,IAAM,YAAY,GAAG,UAC1B,GAAmB,EACnB,GAAoB;;;;;gBAEpB,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;oBAC1B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;oBACf,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,kBAAW,GAAG,CAAC,MAAM,kBAAe,EAAE,CAAC,CAAA;oBAC3D,GAAG,CAAC,GAAG,EAAE,CAAA;oBACT,sBAAM;gBACR,CAAC;gBACK,UAAU,GAAG,IAAA,iCAAa,EAAC,GAAG,CAAC,IAAI,CAAC,CAAA;gBAClC,aAAa,GAA6B,UAAU,cAAvC,EAAE,QAAQ,GAAmB,UAAU,SAA7B,EAAK,SAAS,UAAK,UAAU,EAAtD,6BAAyC,CAAF,CAAe;gBACvC,qBAAM,IAAA,wBAAkB,EAC3C,iBAAW,CAAC,IAAI,EAChB,GAAG,CAAC,OAAO,CAAC,MAAM,CACnB,EAAA;;gBAHK,YAAY,GAAG,SAGpB;;;;gBAIO,KAAK,GAAG,IAAA,kBAAQ,EACpB,IAAA,4BAAkB,EAAC,aAAa,CAAC,EACjC,aAAa,EACb,QAAQ,CACT,CAAA;gBAEgB,qBAAM,YAAY,CAAC,KAAK,CAAC;wBACxC,KAAK,OAAA;wBACL,SAAS,aACP,QAAQ,UAAA,IACL,SAAS,CACb;qBACF,CAAC,EAAA;;gBANI,QAAQ,GAAG,SAMf;gBACF,IAAI,gBACC,QAAQ,CAAC,IAAI,CACjB,CAAA;;;;gBAED,IAAA,gCAAsB,EAAC;oBACrB,WAAW,EAAE,aAAa;oBAC1B,QAAQ,EAAE,KAAG;iBACd,CAAC,CAAA;gBACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBACf,GAAG,CAAC,GAAG,EAAE,CAAA;;;gBAGX,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBACf,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;;;;KAC9B,CAAA;AA9CY,QAAA,YAAY,gBA8CxB"}
|
|
@@ -20,7 +20,7 @@ import { FamilyMemberProps } from '../Components/Sections/Form/InviteFamilyMembe
|
|
|
20
20
|
import { PaymentMethodsMap } from 'Components/Templates';
|
|
21
21
|
import { UserHubItemProps } from '../Components/Elements/UserHubListItem';
|
|
22
22
|
import { CancelSubscriptionProps } from 'Components/Sections/CancelSubscription';
|
|
23
|
-
import { HandleCardClick,
|
|
23
|
+
import { HandleCardClick, NextStepProps } from '../Components/Templates/CancellationStepperRender';
|
|
24
24
|
import { GridLayoutProps } from 'Components/SharedTypes/GridLayoutProps';
|
|
25
25
|
import { CancelSubscriptionDowngradeProps } from '../Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade';
|
|
26
26
|
import { ConfirmCancellationStepProps } from '../Components/Sections/ConfirmCancellation';
|
|
@@ -28,6 +28,7 @@ import { CancellationDetailsContextProps } from '../Components/Sections/Cancella
|
|
|
28
28
|
import { DetailedFlags } from '@newskit-render/feature-flags';
|
|
29
29
|
import { CancellationOffersContextProps } from '../Components/Sections/CancellationOffers';
|
|
30
30
|
import { ConfirmSubscriptionOfferProps } from 'Components/Sections/ConfirmSubscriptionOffer';
|
|
31
|
+
import { OfferPreviewContextProps } from 'Components/Sections/OfferPreview/OfferPreview';
|
|
31
32
|
interface InfoPanel extends InlineMessageProps {
|
|
32
33
|
infoPanelCells?: MQ<number>;
|
|
33
34
|
href?: boolean;
|
|
@@ -305,7 +306,7 @@ export interface BelowItemExtraProps {
|
|
|
305
306
|
};
|
|
306
307
|
baseUrl?: string;
|
|
307
308
|
eventContext?: EventContext;
|
|
308
|
-
onClick?:
|
|
309
|
+
onClick?: NextStepProps;
|
|
309
310
|
buttonOverrides?: BaseFlagOverrides;
|
|
310
311
|
iconOverrides?: NewsKitIconProps['overrides'];
|
|
311
312
|
marginInline?: MQ<string>;
|
|
@@ -325,9 +326,14 @@ export interface ConfirmSubscriptionOfferContextProps extends ConfirmSubscriptio
|
|
|
325
326
|
showBackButton?: boolean;
|
|
326
327
|
tealiumContext?: TealiumEventContext;
|
|
327
328
|
}
|
|
329
|
+
export interface CancellationOfferPreviewContextProps extends OfferPreviewContextProps {
|
|
330
|
+
contentContainerOverrides?: Partial<SharedContentContainerProps>;
|
|
331
|
+
showBackButton?: boolean;
|
|
332
|
+
tealiumContext?: TealiumEventContext;
|
|
333
|
+
}
|
|
328
334
|
export interface CancellationStepperContextOptions extends Partial<InteractiveContextOptions>, Partial<NonInteractiveContextOptions> {
|
|
329
335
|
containerOverrides?: GridLayoutProps;
|
|
330
|
-
components: Record<string, CancellationSection | DowngradeContextProps | ConfirmCancellationContextProps | CancellationDetailsContextProps | CancellationOffersContextProps | ConfirmSubscriptionOfferContextProps>;
|
|
336
|
+
components: Record<string, CancellationSection | DowngradeContextProps | ConfirmCancellationContextProps | CancellationDetailsContextProps | CancellationOffersContextProps | ConfirmSubscriptionOfferContextProps | CancellationOfferPreviewContextProps>;
|
|
331
337
|
componentSequence: Record<string, string[]>;
|
|
332
338
|
showBackButton?: boolean;
|
|
333
339
|
contentContainerOverrides?: Partial<SharedContentContainerProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":";;;AAkNA,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB,kDAAqC,CAAA;IACrC,gEAAmD,CAAA;IACnD,0CAA6B,CAAA;IAC7B,4DAA+C,CAAA;IAC/C,kCAAqB,CAAA;IACrB,sCAAyB,CAAA;IACzB,oCAAuB,CAAA;IACvB,4CAA+B,CAAA;IAC/B,8BAAiB,CAAA;IACjB,gDAAmC,CAAA;IACnC,kDAAqC,CAAA;IACrC,gDAAmC,CAAA;IACnC,sCAAyB,CAAA;IACzB,0CAA6B,CAAA;IAC7B,kDAAqC,CAAA;IACrC,gEAAmD,CAAA;IACnD,gCAAmB,CAAA;IACnB,0CAA6B,CAAA;IAC7B,0DAA6C,CAAA;IAC7C,0DAA6C,CAAA;AAC/C,CAAC,EArBW,WAAW,2BAAX,WAAW,QAqBtB;AAyOD,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,gDAA4B,CAAA;IAC5B,yCAAqB,CAAA;IACrB,8CAA0B,CAAA;AAC5B,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,6CAAyB,CAAA;AAC3B,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAyYD,IAAY,gBA2BX;AA3BD,WAAY,gBAAgB;IAC1B,kCAAgB,CAAA;IAChB,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;IACjB,8BAAY,CAAA;IACZ,oCAAkB,CAAA;IAClB,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,oCAAkB,CAAA;IAClB,gCAAc,CAAA;IACd,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,oCAAkB,CAAA;IAClB,oCAAkB,CAAA;IAClB,iCAAe,CAAA;IACf,oCAAkB,CAAA;IAClB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,kCAAgB,CAAA;IAChB,kCAAgB,CAAA;IAChB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;IACjB,8BAAY,CAAA;IACZ,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;IACnB,kCAAgB,CAAA;AAClB,CAAC,EA3BW,gBAAgB,gCAAhB,gBAAgB,QA2B3B;AA+CD,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,kDAAyB,CAAA;AAC3B,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAqDD,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,4CAA2B,CAAA;AAC7B,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { DateType, ReplaceDateOptions } from './dateUtils';
|
|
2
|
+
import { OfferPreviewDataProps } from '../Components/Sections/CancellationOffers';
|
|
3
|
+
import { UserData } from 'pages/types';
|
|
4
|
+
import { OfferSummaryProps } from 'Components/Sections/OfferPreview/OfferSummary';
|
|
5
|
+
export interface ResponseProps {
|
|
6
|
+
success: boolean;
|
|
7
|
+
errorCode: string | null;
|
|
8
|
+
errorMessage: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface PreviewIncentiveProps extends ResponseProps, OfferPreviewDataProps {
|
|
11
|
+
}
|
|
12
|
+
export interface OfferPreviewDataResponse {
|
|
13
|
+
previewIncentive: PreviewIncentiveProps;
|
|
14
|
+
}
|
|
15
|
+
export interface OfferPreviewBody {
|
|
16
|
+
incentiveCode: string;
|
|
17
|
+
subscriptionCode: string;
|
|
18
|
+
}
|
|
2
19
|
export type GetSubscriptionEndMessage = (messages: {
|
|
3
20
|
daysRemaining: string;
|
|
4
21
|
monthsRemaining: string;
|
|
@@ -7,3 +24,5 @@ export declare const getSubscriptionEndMessage: GetSubscriptionEndMessage;
|
|
|
7
24
|
export declare const replaceRemainingSubscriptionTime: (text: string, billCycleDate: DateType) => string;
|
|
8
25
|
export declare const replaceSubscriptionName: (text: string, subscriptionName: string) => string;
|
|
9
26
|
export declare const cancelSubscription: (subscriptionCode: string, reason: string) => Promise<Response>;
|
|
27
|
+
export declare const getOfferPreviewData: (body: OfferPreviewBody) => Promise<OfferPreviewDataResponse>;
|
|
28
|
+
export declare const populateSubscriptionSummaryData: (previewData: OfferPreviewDataProps, subscriptionSummaryContext: OfferSummaryProps, user: UserData) => OfferSummaryProps;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -39,11 +50,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
51
|
};
|
|
41
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.cancelSubscription = exports.replaceSubscriptionName = exports.replaceRemainingSubscriptionTime = exports.getSubscriptionEndMessage = void 0;
|
|
53
|
+
exports.populateSubscriptionSummaryData = exports.getOfferPreviewData = exports.cancelSubscription = exports.replaceSubscriptionName = exports.replaceRemainingSubscriptionTime = exports.getSubscriptionEndMessage = void 0;
|
|
43
54
|
var cookie_1 = __importDefault(require("cookie"));
|
|
44
55
|
var api_1 = require("@newskit-render/api");
|
|
45
56
|
var dateUtils_1 = require("./dateUtils");
|
|
46
57
|
var shared_components_1 = require("@newskit-render/shared-components");
|
|
58
|
+
var stringUtils_1 = require("./stringUtils");
|
|
59
|
+
var addMonths_1 = require("date-fns/addMonths");
|
|
60
|
+
var format_1 = require("date-fns/format");
|
|
61
|
+
var constants_1 = require("./../constants");
|
|
62
|
+
var dataUtils_1 = require("./dataUtils");
|
|
63
|
+
var subscriptionsUtils_1 = require("./subscriptionsUtils");
|
|
47
64
|
var getSubscriptionEndMessage = function (messages, billCycleDate, options) {
|
|
48
65
|
if (options === void 0) { options = {}; }
|
|
49
66
|
var dateNow = new Date();
|
|
@@ -94,4 +111,51 @@ var cancelSubscription = function (subscriptionCode, reason) { return __awaiter(
|
|
|
94
111
|
});
|
|
95
112
|
}); };
|
|
96
113
|
exports.cancelSubscription = cancelSubscription;
|
|
114
|
+
var getOfferPreviewData = function (body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
+
var response, result;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0: return [4 /*yield*/, fetch('/api/account/query', {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
body: JSON.stringify(__assign({ queryFragment: 'IncentivePreview' }, body)),
|
|
121
|
+
})];
|
|
122
|
+
case 1:
|
|
123
|
+
response = _a.sent();
|
|
124
|
+
if (!response.ok) {
|
|
125
|
+
throw new Error('Network response was not ok');
|
|
126
|
+
}
|
|
127
|
+
return [4 /*yield*/, response.json()];
|
|
128
|
+
case 2:
|
|
129
|
+
result = _a.sent();
|
|
130
|
+
return [2 /*return*/, result];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); };
|
|
134
|
+
exports.getOfferPreviewData = getOfferPreviewData;
|
|
135
|
+
var populateSubscriptionSummaryData = function (previewData, subscriptionSummaryContext, user) {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
var invoiceMonthlySummaryBreakdown = previewData.invoiceSummary.invoiceMonthlySummaryBreakdown[0];
|
|
138
|
+
var userSubscription = (_a = user.subscriptions) === null || _a === void 0 ? void 0 : _a[0];
|
|
139
|
+
var discountedAmountPerTerm = (0, subscriptionsUtils_1.calculateDiscountedPrice)(userSubscription.price, previewData.discountPercentage);
|
|
140
|
+
return __assign(__assign(__assign({ sectionTitle: subscriptionSummaryContext.sectionTitle, offerTitle: previewData.currentPropositionName, discountName: (0, stringUtils_1.replacePlaceholder)(previewData.incentiveName, (0, dataUtils_1.formatPrice)(discountedAmountPerTerm, userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency)), discountPercentage: previewData.discountPercentage, discountStartDate: (0, stringUtils_1.replacePlaceholder)(subscriptionSummaryContext.discountStartDate, (0, format_1.format)(new Date(invoiceMonthlySummaryBreakdown.fromDate), 'dd MMM yyyy')), fullPriceSubscriptionPrice: (0, stringUtils_1.replacePlaceholder)(subscriptionSummaryContext.fullPriceSubscriptionPrice, (0, dataUtils_1.formatPrice)(userSubscription.price, userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency)), fullPriceSubscriptionStartDate: (0, stringUtils_1.replacePlaceholder)(subscriptionSummaryContext.fullPriceSubscriptionStartDate, (0, format_1.format)((0, addMonths_1.addMonths)(new Date(invoiceMonthlySummaryBreakdown.fromDate), previewData.term), 'dd MMM yyyy')) }, ((subscriptionSummaryContext === null || subscriptionSummaryContext === void 0 ? void 0 : subscriptionSummaryContext.paymentBreakdown) &&
|
|
141
|
+
Number(invoiceMonthlySummaryBreakdown.creditBalance
|
|
142
|
+
.beforeApplyingSubscriptionCharges)
|
|
143
|
+
? {
|
|
144
|
+
paymentBreakdown: {
|
|
145
|
+
title: (0, stringUtils_1.replacePlaceholder)((_b = subscriptionSummaryContext === null || subscriptionSummaryContext === void 0 ? void 0 : subscriptionSummaryContext.paymentBreakdown) === null || _b === void 0 ? void 0 : _b.title, (0, format_1.format)(new Date(invoiceMonthlySummaryBreakdown.fromDate), 'dd MMM yyyy')),
|
|
146
|
+
accountCreditRow: __assign(__assign({}, subscriptionSummaryContext.paymentBreakdown.accountCreditRow), { value: (0, dataUtils_1.formatPrice)(invoiceMonthlySummaryBreakdown.creditBalance
|
|
147
|
+
.beforeApplyingSubscriptionCharges, userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency) }),
|
|
148
|
+
},
|
|
149
|
+
}
|
|
150
|
+
: {})), { nextPaymentRow: __assign(__assign({}, subscriptionSummaryContext.nextPaymentRow), { value: invoiceMonthlySummaryBreakdown.totalAmountToPay }) }), (subscriptionSummaryContext.remainingCredit &&
|
|
151
|
+
(Number(invoiceMonthlySummaryBreakdown.creditBalance
|
|
152
|
+
.afterApplyingSubscriptionCharges)
|
|
153
|
+
? {
|
|
154
|
+
remainingCredit: __assign(__assign({}, subscriptionSummaryContext.remainingCredit), { value: constants_1.CURRENCY_MAP[userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency] +
|
|
155
|
+
invoiceMonthlySummaryBreakdown.creditBalance
|
|
156
|
+
.afterApplyingSubscriptionCharges }),
|
|
157
|
+
}
|
|
158
|
+
: {})));
|
|
159
|
+
};
|
|
160
|
+
exports.populateSubscriptionSummaryData = populateSubscriptionSummaryData;
|
|
97
161
|
//# sourceMappingURL=cancellationUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellationUtils.js","sourceRoot":"","sources":["../../../src/helpers/cancellationUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cancellationUtils.js","sourceRoot":"","sources":["../../../src/helpers/cancellationUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA2B;AAC3B,2CAAoD;AACpD,yCAKoB;AACpB,uEAAoE;AAGpE,6CAAkD;AAClD,gDAA8C;AAC9C,0CAAwC;AACxC,4CAA6C;AAE7C,yCAAyC;AACzC,2DAA+D;AA6BxD,IAAM,yBAAyB,GAA8B,UAClE,QAAQ,EACR,aAAa,EACb,OAAY;IAAZ,wBAAA,EAAA,YAAY;IAEZ,IAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAA;IAC1B,OAAO,IAAA,sBAAU,EAAC,aAAa,EAAE,OAAO,CAAC;QACvC,CAAC,CAAC,QAAQ,CAAC,eAAe;QAC1B,CAAC,CAAC,IAAA,uBAAW,EAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,CAAA;AACjE,CAAC,CAAA;AATY,QAAA,yBAAyB,6BASrC;AAEM,IAAM,gCAAgC,GAAG,UAC9C,IAAY,EACZ,aAAuB;IAEvB,IAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAA;IAC1B,IAAM,aAAa,GAAG,IAAA,oCAAgB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAA;IAE9D,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;QACxB,2FAA2F;QAC3F,IAAM,aAAa,GAAG,GAAG,CAAA;QACzB,IAAM,UAAU,GAAG,OAAO,CAAA;QAE1B,OAAO,IAAI;aACR,OAAO,CAAC,oBAAoB,EAAE,aAAa,CAAC;aAC5C,OAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,C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C;wBACxC,8BAA8B,CAAC,aAAa;6BACzC,gCAAgC,GACtC;aACF;YACH,CAAC,CAAC,EAAE,CAAC,CAAC,EACX;AACH,CAAC,CAAA;AAtFY,QAAA,+BAA+B,mCAsF3C"}
|
|
@@ -8,9 +8,7 @@ exports.getQueryByFragment = exports.getQuery = void 0;
|
|
|
8
8
|
var client_1 = require("@apollo/client");
|
|
9
9
|
var queries_1 = require("../queries");
|
|
10
10
|
var getQuery = function (fragment, fragmentName, pageSize) {
|
|
11
|
-
return (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n
|
|
12
|
-
? "\n query {\n user {\n ...".concat(fragmentName, "\n }\n }\n ")
|
|
13
|
-
: '');
|
|
11
|
+
return (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), fragment);
|
|
14
12
|
};
|
|
15
13
|
exports.getQuery = getQuery;
|
|
16
14
|
var queryFragmentMap = {
|
|
@@ -18,6 +16,7 @@ var queryFragmentMap = {
|
|
|
18
16
|
UserProfile: queries_1.GET_USER_PROFILE,
|
|
19
17
|
UserSubscription: queries_1.GET_USER_SUBSCRIPTION,
|
|
20
18
|
InvoiceHistory: queries_1.GET_INVOICE_HISTORY,
|
|
19
|
+
IncentivePreview: queries_1.GET_INCENTIVE_PREVIEW,
|
|
21
20
|
};
|
|
22
21
|
var getQueryByFragment = function (fragmentName) {
|
|
23
22
|
var result = queryFragmentMap[fragmentName];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuery.js","sourceRoot":"","sources":["../../../src/helpers/getQuery.ts"],"names":[],"mappings":";;;;;;;AAAA,yCAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"getQuery.js","sourceRoot":"","sources":["../../../src/helpers/getQuery.ts"],"names":[],"mappings":";;;;;;;AAAA,yCAAkD;AAClD,sCAMmB;AAEZ,IAAM,QAAQ,GAAG,UACtB,QAAsB,EACtB,YAAoB,EACpB,QAAiB;IAEjB,WAAO,YAAG,oFAAA,QACN,EAAQ,MACX,KADG,QAAQ,EACX;AACH,CAAC,CAAA;AARY,QAAA,QAAQ,YAQpB;AAED,IAAM,gBAAgB,GAAG;IACvB,eAAe,EAAE,+BAAqB;IACtC,WAAW,EAAE,0BAAgB;IAC7B,gBAAgB,EAAE,+BAAqB;IACvC,cAAc,EAAE,6BAAmB;IACnC,gBAAgB,EAAE,+BAAqB;CACxC,CAAA;AAEM,IAAM,kBAAkB,GAAG,UAAC,YAAoB;IACrD,IAAM,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,oBAAa,YAAY,yFAAsF,CAChH,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AARY,QAAA,kBAAkB,sBAQ9B"}
|
|
@@ -35,6 +35,5 @@ __exportStar(require("./cancellationUtils"), exports);
|
|
|
35
35
|
__exportStar(require("./layoutReflowUtils"), exports);
|
|
36
36
|
__exportStar(require("./entitlementUtils"), exports);
|
|
37
37
|
__exportStar(require("./randomizeReasons"), exports);
|
|
38
|
-
|
|
39
|
-
// export * from './invoiceUtils'
|
|
38
|
+
__exportStar(require("./stringUtils"), exports);
|
|
40
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,kDAA+B;AAC/B,oDAAiC;AACjC,6CAA0B;AAC1B,iDAA8B;AAC9B,iDAA8B;AAC9B,uDAAoC;AACpC,kDAA+B;AAC/B,kDAA+B;AAC/B,iDAA8B;AAC9B,uDAAoC;AACpC,4DAAyC;AACzC,sDAAmC;AACnC,qDAAkC;AAClC,iDAA8B;AAC9B,+CAA4B;AAC5B,8CAA2B;AAC3B,sDAAmC;AACnC,sDAAmC;AACnC,qDAAkC;AAClC,qDAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,kDAA+B;AAC/B,oDAAiC;AACjC,6CAA0B;AAC1B,iDAA8B;AAC9B,iDAA8B;AAC9B,uDAAoC;AACpC,kDAA+B;AAC/B,kDAA+B;AAC/B,iDAA8B;AAC9B,uDAAoC;AACpC,4DAAyC;AACzC,sDAAmC;AACnC,qDAAkC;AAClC,iDAA8B;AAC9B,+CAA4B;AAC5B,8CAA2B;AAC3B,sDAAmC;AACnC,sDAAmC;AACnC,qDAAkC;AAClC,qDAAkC;AAClC,gDAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const replacePlaceholder: (targetString: string, replacementValue?: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replacePlaceholder = void 0;
|
|
4
|
+
var replacePlaceholder = function (targetString, replacementValue) {
|
|
5
|
+
if (replacementValue === void 0) { replacementValue = ''; }
|
|
6
|
+
return targetString.replace(/##.+##/gm, replacementValue);
|
|
7
|
+
};
|
|
8
|
+
exports.replacePlaceholder = replacePlaceholder;
|
|
9
|
+
//# sourceMappingURL=stringUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../../src/helpers/stringUtils.ts"],"names":[],"mappings":";;;AAAO,IAAM,kBAAkB,GAAG,UAChC,YAAoB,EACpB,gBAA6B;IAA7B,iCAAA,EAAA,qBAA6B;IAE7B,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAA;AAC3D,CAAC,CAAA;AALY,QAAA,kBAAkB,sBAK9B"}
|