@edx/frontend-app-subscription-manage 1.18.2 → 1.20.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.
Files changed (97) hide show
  1. package/dist/components/ActiveSubscription/ActiveSubscription.js +4 -4
  2. package/dist/components/ActiveSubscription/ActiveSubscription.js.map +1 -1
  3. package/dist/components/BecomeSubscriber/BecomeSubscriber.js +3 -3
  4. package/dist/components/BecomeSubscriber/BecomeSubscriber.js.map +1 -1
  5. package/dist/components/CancelConfirmation/CancelConfirmation.js +6 -6
  6. package/dist/components/CancelConfirmation/CancelConfirmation.js.map +1 -1
  7. package/dist/components/CancelSuccess/CancelSuccess.js +3 -3
  8. package/dist/components/CancelSuccess/CancelSuccess.js.map +1 -1
  9. package/dist/components/CanceledSubscription/CanceledSubscription.js +6 -6
  10. package/dist/components/CanceledSubscription/CanceledSubscription.js.map +1 -1
  11. package/dist/components/EnrolledCoursesList/EnrolledCoursesList.js +2 -2
  12. package/dist/components/EnrolledCoursesList/EnrolledCoursesList.js.map +1 -1
  13. package/dist/components/HelpFooter/HelpFooter.js +1 -1
  14. package/dist/components/HelpFooter/HelpFooter.js.map +1 -1
  15. package/dist/components/OrderHistory/OrderHistoryCard.d.ts +11 -0
  16. package/dist/components/OrderHistory/OrderHistoryCard.js +6 -0
  17. package/dist/components/OrderHistory/OrderHistoryCard.js.map +1 -0
  18. package/dist/components/OrderHistory/OrderHistoryDetails.d.ts +2 -0
  19. package/dist/components/OrderHistory/OrderHistoryDetails.js +120 -0
  20. package/dist/components/OrderHistory/OrderHistoryDetails.js.map +1 -0
  21. package/dist/components/OrderHistory/OrderList.d.ts +3 -0
  22. package/dist/components/OrderHistory/OrderList.js +13 -0
  23. package/dist/components/OrderHistory/OrderList.js.map +1 -0
  24. package/dist/components/OrderHistory/OrderPurchases.d.ts +4 -0
  25. package/dist/components/OrderHistory/OrderPurchases.js +44 -0
  26. package/dist/components/OrderHistory/OrderPurchases.js.map +1 -0
  27. package/dist/components/OrderHistory/ProgramItemsTable.d.ts +7 -0
  28. package/dist/components/OrderHistory/ProgramItemsTable.js +49 -0
  29. package/dist/components/OrderHistory/ProgramItemsTable.js.map +1 -0
  30. package/dist/components/OrderHistory/data/receiptRows.d.ts +17 -0
  31. package/dist/components/OrderHistory/data/receiptRows.js +16 -0
  32. package/dist/components/OrderHistory/data/receiptRows.js.map +1 -0
  33. package/dist/components/OrderHistory/messages.d.ts +118 -0
  34. package/dist/components/OrderHistory/messages.js +120 -0
  35. package/dist/components/OrderHistory/messages.js.map +1 -0
  36. package/dist/components/OrderHistoryHeader/OrderHistoryHeader.js +1 -1
  37. package/dist/components/OrderHistoryHeader/OrderHistoryHeader.js.map +1 -1
  38. package/dist/components/PaymentHistory/PaymentHistory.js +5 -5
  39. package/dist/components/PaymentHistory/PaymentHistory.js.map +1 -1
  40. package/dist/components/RefundNotice/RefundNotice.d.ts +3 -0
  41. package/dist/components/RefundNotice/RefundNotice.js +15 -0
  42. package/dist/components/RefundNotice/RefundNotice.js.map +1 -0
  43. package/dist/components/RefundNotice/messages.d.ts +18 -0
  44. package/dist/components/RefundNotice/messages.js +20 -0
  45. package/dist/components/RefundNotice/messages.js.map +1 -0
  46. package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.js +10 -10
  47. package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.js.map +1 -1
  48. package/dist/components/ResubscribeCard/ResubscribeCard.js +5 -5
  49. package/dist/components/ResubscribeCard/ResubscribeCard.js.map +1 -1
  50. package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.js +12 -12
  51. package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.js.map +1 -1
  52. package/dist/components/messages.d.ts +89 -99
  53. package/dist/components/messages.js +182 -192
  54. package/dist/components/messages.js.map +1 -1
  55. package/dist/constants.d.ts +7 -1
  56. package/dist/constants.js +7 -1
  57. package/dist/constants.js.map +1 -1
  58. package/dist/data/hooks/keys.d.ts +5 -0
  59. package/dist/data/hooks/keys.js +5 -0
  60. package/dist/data/hooks/keys.js.map +1 -1
  61. package/dist/data/hooks/useOrderHistoryQueries.d.ts +11 -0
  62. package/dist/data/hooks/useOrderHistoryQueries.js +30 -0
  63. package/dist/data/hooks/useOrderHistoryQueries.js.map +1 -0
  64. package/dist/data/services/orderHistory/orderHistory.d.ts +7 -0
  65. package/dist/data/services/orderHistory/orderHistory.js +40 -0
  66. package/dist/data/services/orderHistory/orderHistory.js.map +1 -0
  67. package/dist/{manageSubscriptionPage → orderHistory}/CancelSubscriptionPage.js +4 -4
  68. package/dist/orderHistory/CancelSubscriptionPage.js.map +1 -0
  69. package/dist/{manageSubscriptionPage → orderHistory}/CancelSuccessPage.js +2 -2
  70. package/dist/orderHistory/CancelSuccessPage.js.map +1 -0
  71. package/dist/orderHistory/OrderHistoryPage.d.ts +3 -0
  72. package/dist/orderHistory/OrderHistoryPage.js +127 -0
  73. package/dist/orderHistory/OrderHistoryPage.js.map +1 -0
  74. package/dist/routes.d.ts +23 -2
  75. package/dist/routes.js +44 -19
  76. package/dist/routes.js.map +1 -1
  77. package/dist/style.scss +1 -1
  78. package/dist/styles/components/{manageSubscription.scss → orderHistory.scss} +60 -24
  79. package/dist/types.d.ts +55 -0
  80. package/dist/types.js.map +1 -1
  81. package/dist/utils/currency.d.ts +6 -0
  82. package/dist/utils/currency.js +6 -0
  83. package/dist/utils/currency.js.map +1 -0
  84. package/dist/utils/queries.d.ts +6 -0
  85. package/dist/utils/queries.js +12 -0
  86. package/dist/utils/queries.js.map +1 -1
  87. package/package.json +1 -1
  88. package/dist/components/SubscriptionTabs/SubscriptionTabs.d.ts +0 -8
  89. package/dist/components/SubscriptionTabs/SubscriptionTabs.js +0 -15
  90. package/dist/components/SubscriptionTabs/SubscriptionTabs.js.map +0 -1
  91. package/dist/manageSubscriptionPage/CancelSubscriptionPage.js.map +0 -1
  92. package/dist/manageSubscriptionPage/CancelSuccessPage.js.map +0 -1
  93. package/dist/manageSubscriptionPage/ManageSubscriptionPage.d.ts +0 -3
  94. package/dist/manageSubscriptionPage/ManageSubscriptionPage.js +0 -88
  95. package/dist/manageSubscriptionPage/ManageSubscriptionPage.js.map +0 -1
  96. /package/dist/{manageSubscriptionPage → orderHistory}/CancelSubscriptionPage.d.ts +0 -0
  97. /package/dist/{manageSubscriptionPage → orderHistory}/CancelSuccessPage.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderHistoryPage.js","sourceRoot":"","sources":["../../src/orderHistory/OrderHistoryPage.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,WAAW,GACZ,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,GAAG,GACJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,kBAAkB,MAAM,qDAAqD,CAAC;AACrF,OAAO,gBAAgB,MAAM,iDAAiD,CAAC;AAC/E,OAAO,oBAAoB,EAAE,EAC3B,WAAW,GACZ,MAAM,yDAAyD,CAAC;AACjE,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,OAAO,kBAAkB,MAAM,qDAAqD,CAAC;AACrF,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,cAAc,MAAM,6CAA6C,CAAC;AACzE,OAAO,sBAAsB,MAAM,6DAA6D,CAAC;AACjG,OAAO,eAAe,MAAM,+CAA+C,CAAC;AAC5E,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,iCAAiC,EACjC,aAAa,EACb,cAAc,GACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,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AAC,SAAS,EAC1C,YAAY,EAAE,kBAAkB,CAAC,OAAO,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,GAChB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React, {\n useEffect,\n useMemo,\n useState,\n useCallback,\n} from 'react';\nimport {\n Alert,\n Container,\n Spinner,\n Tabs,\n Tab,\n} from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useSearchParams } from 'react-router-dom';\n\nimport ActiveSubscription from '../components/ActiveSubscription/ActiveSubscription';\nimport BecomeSubscriber from '../components/BecomeSubscriber/BecomeSubscriber';\nimport CanceledSubscription, {\n RenewBanner,\n} from '../components/CanceledSubscription/CanceledSubscription';\nimport HelpFooter from '../components/HelpFooter/HelpFooter';\nimport OrderHistoryHeader from '../components/OrderHistoryHeader/OrderHistoryHeader';\nimport OrderPurchases from '../components/OrderHistory/OrderPurchases';\nimport PaymentHistory from '../components/PaymentHistory/PaymentHistory';\nimport RenewSubscriptionModal from '../components/RenewSubscriptionModal/RenewSubscriptionModal';\nimport ResubscribeCard from '../components/ResubscribeCard/ResubscribeCard';\nimport messages from '../components/messages';\nimport {\n useBillingPlansQuery,\n useIsSubscriberQuery,\n usePaymentHistoryQuery,\n useReactivateSubscriptionMutation,\n useViaxClient,\n useViaxSession,\n} from '../data/hooks/useManageQueries';\nimport { getPaymentHistorySubscriptionIds } from '../data/services/subscription/getPaymentHistory';\nimport { getPlanPrice } from '../utils/billingDetails';\nimport { formatDisplayDate } from '../utils/formatDate';\nimport {\n resolvePlanLabel,\n resolveSubscriptionView,\n} from '../utils/subscriptionView';\n\nconst OrderHistoryPage: React.FC = () => {\n const { formatMessage } = useIntl();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const [isRenewModalOpen, setIsRenewModalOpen] = useState(false);\n\n // Initialize active tab from URL.\n const [activeTab, setActiveTab] = useState(\n searchParams.get('tab') === 'payment-history'\n ? 'payment-history'\n : 'subscription',\n );\n\n const client = useViaxClient();\n\n const {\n sessionReady,\n isSessionLoading,\n isSessionError,\n } = useViaxSession(client);\n\n const subscriberQuery = useIsSubscriberQuery(client, sessionReady);\n const billingPlansQuery = useBillingPlansQuery(client, sessionReady);\n const reactivateMutation = useReactivateSubscriptionMutation(client);\n\n const subscriptionBiId = subscriberQuery.data?.subscriptionBiId ?? null;\n\n const paymentHistoryQuery = usePaymentHistoryQuery(\n client,\n sessionReady,\n getPaymentHistorySubscriptionIds(subscriberQuery.data),\n );\n\n const subscriber = subscriberQuery.data ?? null;\n\n const planCycle = resolvePlanLabel(subscriber);\n\n const planPrice = getPlanPrice(\n billingPlansQuery.data?.plans ?? [],\n planCycle,\n );\n\n const price = planPrice?.amount ?? null;\n const currency = planPrice?.currency ?? null;\n\n const renewalDate = formatDisplayDate(\n subscriber?.currentPeriodEnd ?? subscriber?.subscriptionEndDate,\n );\n\n const handleOpenRenewModal = useCallback(() => {\n if (!subscriptionBiId) {\n return;\n }\n\n reactivateMutation.reset();\n setIsRenewModalOpen(true);\n }, [subscriptionBiId, reactivateMutation]);\n\n const handleConfirmRenew = useCallback(() => {\n if (!subscriptionBiId || reactivateMutation.isPending) {\n return;\n }\n\n reactivateMutation.mutate(subscriptionBiId);\n }, [subscriptionBiId, reactivateMutation]);\n\n useEffect(() => {\n if (reactivateMutation.isSuccess) {\n setIsRenewModalOpen(false);\n }\n }, [reactivateMutation.isSuccess]);\n\n // Synchronize active tab with URL changes.\n useEffect(() => {\n const tab = searchParams.get('tab');\n\n setActiveTab(\n tab === 'payment-history' ? 'payment-history' : 'subscription',\n );\n }, [searchParams]);\n\n const handleTabSelect = useCallback((tabKey: string | null) => {\n if (tabKey === 'subscription' || tabKey === 'payment-history') {\n setActiveTab(tabKey);\n\n setSearchParams(\n tabKey === 'subscription' ? {} : { tab: tabKey },\n { replace: true },\n );\n }\n }, [setSearchParams]);\n\n const isLoading = isSessionLoading || (sessionReady && subscriberQuery.isPending);\n const isError = isSessionError || subscriberQuery.isError;\n\n const resolvedView = resolveSubscriptionView(subscriber);\n const showRenewBanner = resolvedView === 'canceled_access';\n\n // Resolve subscription panel.\n const subscriptionPanel = useMemo(() => {\n switch (resolvedView) {\n case 'active':\n return <ActiveSubscription subscriber={subscriber} />;\n\n case 'canceled_access':\n return (\n <CanceledSubscription\n subscriber={subscriber}\n onRenew={handleOpenRenewModal}\n />\n );\n\n case 'canceled_expired':\n return (\n <ResubscribeCard\n subscriber={subscriber}\n price={price}\n currency={currency}\n />\n );\n\n case 'none':\n default:\n return (\n <BecomeSubscriber\n price={price}\n currency={currency}\n />\n );\n }\n }, [\n resolvedView,\n subscriber,\n price,\n currency,\n handleOpenRenewModal,\n ]);\n\n // Define tabs dynamically.\n const orderHistoryTabs = useMemo(() => [\n {\n key: 'subscription',\n title: 'Manage subscription',\n panel: (\n <>\n {subscriptionPanel}\n <HelpFooter />\n </>\n ),\n },\n {\n key: 'payment-history',\n title: 'Payment history',\n panel: (\n <>\n <PaymentHistory\n subscriber={subscriber}\n invoices={paymentHistoryQuery.data ?? []}\n isLoading={paymentHistoryQuery.isPending}\n isError={paymentHistoryQuery.isError}\n />\n <OrderPurchases />\n <HelpFooter />\n </>\n ),\n },\n ], [\n subscriptionPanel,\n subscriber,\n paymentHistoryQuery.data,\n paymentHistoryQuery.isPending,\n paymentHistoryQuery.isError,\n ]);\n\n if (isLoading) {\n return (\n <div className=\"manage-page manage-page--loading d-flex justify-content-center align-items-center\">\n <Spinner\n animation=\"border\"\n screenReaderText={formatMessage(messages['order-history.loading'])}\n />\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"manage-page\">\n <Container size=\"lg\" className=\"manage-page__inner px-3 px-md-4 py-5\">\n <Alert variant=\"danger\">\n {formatMessage(messages['order-history.error'])}\n </Alert>\n </Container>\n </div>\n );\n }\n\n return (\n <div className=\"manage-page\">\n {showRenewBanner && (\n <div className=\"manage-renew-banner py-5 mb-2\">\n <Container size=\"lg\" className=\"px-3 px-md-4\">\n <div className=\"manage-renew-banner__inner d-flex flex-column align-items-start\">\n <RenewBanner\n expireDate={renewalDate}\n onRenew={handleOpenRenewModal}\n />\n </div>\n </Container>\n </div>\n )}\n\n <Container size=\"lg\" className=\"manage-page__inner px-3 px-md-4 py-5\">\n <OrderHistoryHeader />\n\n <Tabs\n id=\"order-history-tabs\"\n defaultActiveKey={orderHistoryTabs[0]?.key}\n activeKey={activeTab}\n onSelect={handleTabSelect}\n className=\"mb-4\"\n mountOnEnter\n >\n {orderHistoryTabs.map(tab => (\n <Tab\n eventKey={tab.key}\n title={tab.title}\n key={tab.key}\n >\n {tab.panel}\n </Tab>\n ))}\n </Tabs>\n </Container>\n\n <RenewSubscriptionModal\n isOpen={isRenewModalOpen}\n onClose={() => setIsRenewModalOpen(false)}\n onConfirm={handleConfirmRenew}\n isConfirming={reactivateMutation.isPending}\n confirmError={reactivateMutation.isError}\n subscriptionBiId={subscriptionBiId}\n renewalDate={renewalDate}\n price={price}\n currency={currency}\n cycle={planCycle}\n />\n </div>\n );\n};\n\nexport default OrderHistoryPage;\n"]}
package/dist/routes.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- declare const routes: {
1
+ declare const routes: ({
2
2
  id: string;
3
3
  path: string;
4
4
  loader: (args: any) => Promise<null>;
5
+ shouldRevalidate: ({ currentUrl, nextUrl }: {
6
+ currentUrl: any;
7
+ nextUrl: any;
8
+ }) => boolean;
5
9
  handle: {
6
10
  roles: string[];
7
11
  };
@@ -21,5 +25,22 @@ declare const routes: {
21
25
  }>;
22
26
  index?: undefined;
23
27
  })[];
24
- }[];
28
+ } | {
29
+ id: string;
30
+ path: string;
31
+ loader: (args: any) => Promise<null>;
32
+ handle: {
33
+ roles: string[];
34
+ };
35
+ lazy(): Promise<{
36
+ Component: () => import("react/jsx-runtime").JSX.Element;
37
+ }>;
38
+ children: {
39
+ index: boolean;
40
+ lazy(): Promise<{
41
+ Component: () => import("react/jsx-runtime").JSX.Element;
42
+ }>;
43
+ }[];
44
+ shouldRevalidate?: undefined;
45
+ })[];
25
46
  export default routes;
package/dist/routes.js CHANGED
@@ -8,39 +8,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { authenticatedLoader, getAuthenticatedHttpClient, } from '@openedx/frontend-base';
11
- import { redirect } from 'react-router-dom';
12
11
  import { getSubsInitApiUrl } from './data/services/subs/urls';
13
12
  import { subscriptionManageRole } from './constants';
14
13
  import { setCommonTrackingProps, mapSubsInitToTrackingProps } from './tracking/trackingContext';
15
- // loader to check if the user has subscription access
16
- const subscriptionAccessLoader = () => __awaiter(void 0, void 0, void 0, function* () {
14
+ // loader to set common tracking props from subscription init data
15
+ let trackingInitialized = false;
16
+ const subscriptionTrackingLoader = () => __awaiter(void 0, void 0, void 0, function* () {
17
+ if (trackingInitialized) {
18
+ return null;
19
+ }
17
20
  try {
18
21
  const { data } = yield getAuthenticatedHttpClient().get(getSubsInitApiUrl());
19
- if (!(data === null || data === void 0 ? void 0 : data.userSubscription) || !data.userSubscription.isSubscriber) {
20
- throw redirect('/learner-dashboard'); // redirect to learner dashboard if user does not have subscription access
21
- }
22
22
  setCommonTrackingProps(mapSubsInitToTrackingProps(data));
23
- return null;
23
+ trackingInitialized = true;
24
24
  }
25
- catch (error) {
26
- // Let redirect responses bubble up
27
- if (error instanceof Response) {
28
- throw error;
29
- }
30
- throw redirect('/learner-dashboard'); // redirect to learner dashboard if an error occurs
25
+ catch (_a) {
26
+ // Tracking failures must not block page load
31
27
  }
28
+ return null;
32
29
  });
33
- // composed loader that checks for authentication and subscription access
30
+ // composed loader that checks for authentication and sets tracking props
34
31
  const protectedLoader = (args) => __awaiter(void 0, void 0, void 0, function* () {
35
32
  yield authenticatedLoader(args);
36
- yield subscriptionAccessLoader();
33
+ yield subscriptionTrackingLoader();
37
34
  return null;
38
35
  });
39
36
  const routes = [
40
37
  {
41
38
  id: 'org.openedx.frontend.route.subscription.manage.main',
42
- path: 'manage-subscription',
39
+ path: 'order-history',
43
40
  loader: protectedLoader,
41
+ shouldRevalidate: ({ currentUrl, nextUrl }) => currentUrl.pathname !== nextUrl.pathname,
44
42
  handle: {
45
43
  roles: [subscriptionManageRole],
46
44
  },
@@ -57,7 +55,7 @@ const routes = [
57
55
  lazy() {
58
56
  return __awaiter(this, void 0, void 0, function* () {
59
57
  const module = yield import(
60
- /* webpackChunkName: "ManageSubscriptionPage" */ './manageSubscriptionPage/ManageSubscriptionPage');
58
+ /* webpackChunkName: "OrderHistory" */ './orderHistory/OrderHistoryPage');
61
59
  return { Component: module.default };
62
60
  });
63
61
  },
@@ -67,7 +65,7 @@ const routes = [
67
65
  lazy() {
68
66
  return __awaiter(this, void 0, void 0, function* () {
69
67
  const module = yield import(
70
- /* webpackChunkName: "CancelSubscriptionPage" */ './manageSubscriptionPage/CancelSubscriptionPage');
68
+ /* webpackChunkName: "CancelSubscriptionPage" */ './orderHistory/CancelSubscriptionPage');
71
69
  return { Component: module.default };
72
70
  });
73
71
  },
@@ -77,7 +75,34 @@ const routes = [
77
75
  lazy() {
78
76
  return __awaiter(this, void 0, void 0, function* () {
79
77
  const module = yield import(
80
- /* webpackChunkName: "CancelSuccessPage" */ './manageSubscriptionPage/CancelSuccessPage');
78
+ /* webpackChunkName: "CancelSuccessPage" */ './orderHistory/CancelSuccessPage');
79
+ return { Component: module.default };
80
+ });
81
+ },
82
+ },
83
+ ],
84
+ },
85
+ {
86
+ id: 'org.openedx.frontend.route.subscription.manage.order-details',
87
+ path: 'order-details/:orderNumber',
88
+ loader: protectedLoader,
89
+ handle: {
90
+ roles: [subscriptionManageRole],
91
+ },
92
+ lazy() {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ const module = yield import(
95
+ /* webpackChunkName: "subscription-manage-main" */ './Main');
96
+ return { Component: module.default };
97
+ });
98
+ },
99
+ children: [
100
+ {
101
+ index: true,
102
+ lazy() {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ const module = yield import(
105
+ /* webpackChunkName: "OrderHistoryDetails" */ './components/OrderHistory/OrderHistoryDetails');
81
106
  return { Component: module.default };
82
107
  });
83
108
  },
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAEhG,sDAAsD;AACtD,MAAM,wBAAwB,GAAG,GAAS,EAAE;IAC1C,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GACV,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAEhE,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;YACnE,MAAM,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,0EAA0E;QAClH,CAAC;QAED,sBAAsB,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,mCAAmC;QACnC,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,mDAAmD;IAC3F,CAAC;AACH,CAAC,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\n authenticatedLoader,\n getAuthenticatedHttpClient,\n} from '@openedx/frontend-base';\nimport { redirect } from 'react-router-dom';\n\nimport { getSubsInitApiUrl } from './data/services/subs/urls';\nimport { subscriptionManageRole } from './constants';\nimport { setCommonTrackingProps, mapSubsInitToTrackingProps } from './tracking/trackingContext';\n\n// loader to check if the user has subscription access\nconst subscriptionAccessLoader = async () => {\n try {\n const { data }\n = await getAuthenticatedHttpClient().get(getSubsInitApiUrl());\n\n if (!data?.userSubscription || !data.userSubscription.isSubscriber) {\n throw redirect('/learner-dashboard'); // redirect to learner dashboard if user does not have subscription access\n }\n\n setCommonTrackingProps(mapSubsInitToTrackingProps(data));\n return null;\n } catch (error) {\n // Let redirect responses bubble up\n if (error instanceof Response) {\n throw error;\n }\n\n throw redirect('/learner-dashboard'); // redirect to learner dashboard if an error occurs\n }\n};\n\n// composed loader that checks for authentication and subscription access\nconst protectedLoader = async (args) => {\n await authenticatedLoader(args);\n await subscriptionAccessLoader();\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.openedx.frontend.route.subscription.manage.main',\n path: 'manage-subscription',\n loader: protectedLoader,\n handle: {\n roles: [subscriptionManageRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"subscription-manage-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"ManageSubscriptionPage\" */ './manageSubscriptionPage/ManageSubscriptionPage'\n );\n return { Component: module.default };\n },\n },\n {\n path: 'cancel',\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"CancelSubscriptionPage\" */ './manageSubscriptionPage/CancelSubscriptionPage'\n );\n return { Component: module.default };\n },\n },\n {\n path: 'cancel/success',\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"CancelSuccessPage\" */ './manageSubscriptionPage/CancelSuccessPage'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n];\n\nexport default routes;\n"]}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","s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C,CAAC,+CAA+C,CAC9F,CAAC;wBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;oBACvC,CAAC;iBAAA;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n authenticatedLoader,\n getAuthenticatedHttpClient,\n} from '@openedx/frontend-base';\n\nimport { getSubsInitApiUrl } from './data/services/subs/urls';\nimport { subscriptionManageRole } from './constants';\nimport { setCommonTrackingProps, mapSubsInitToTrackingProps } from './tracking/trackingContext';\n\n// loader to set common tracking props from subscription init data\nlet trackingInitialized = false;\nconst subscriptionTrackingLoader = async () => {\n if (trackingInitialized) {\n return null;\n }\n try {\n const { data } = await getAuthenticatedHttpClient().get(getSubsInitApiUrl());\n setCommonTrackingProps(mapSubsInitToTrackingProps(data));\n trackingInitialized = true;\n } catch {\n // Tracking failures must not block page load\n }\n\n return null;\n};\n\n// composed loader that checks for authentication and sets tracking props\nconst protectedLoader = async (args) => {\n await authenticatedLoader(args);\n await subscriptionTrackingLoader();\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.openedx.frontend.route.subscription.manage.main',\n path: 'order-history',\n loader: protectedLoader,\n shouldRevalidate: ({ currentUrl, nextUrl }) => currentUrl.pathname !== nextUrl.pathname,\n handle: {\n roles: [subscriptionManageRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"subscription-manage-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"OrderHistory\" */ './orderHistory/OrderHistoryPage'\n );\n return { Component: module.default };\n },\n },\n {\n path: 'cancel',\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"CancelSubscriptionPage\" */ './orderHistory/CancelSubscriptionPage'\n );\n return { Component: module.default };\n },\n },\n {\n path: 'cancel/success',\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"CancelSuccessPage\" */ './orderHistory/CancelSuccessPage'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n {\n id: 'org.openedx.frontend.route.subscription.manage.order-details',\n path: 'order-details/:orderNumber',\n loader: protectedLoader,\n handle: {\n roles: [subscriptionManageRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"subscription-manage-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"OrderHistoryDetails\" */ './components/OrderHistory/OrderHistoryDetails'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n];\n\nexport default routes;\n"]}
package/dist/style.scss CHANGED
@@ -1,4 +1,4 @@
1
- @use "./styles/components/manageSubscription.scss";
1
+ @use "./styles/components/orderHistory.scss";
2
2
 
3
3
  button.btn.btn-outline:has(svg) {
4
4
  display: none !important;
@@ -19,30 +19,6 @@
19
19
  min-height: 50vh;
20
20
  }
21
21
 
22
- /* Tabs — custom 3px underline active state */
23
- .manage-tabs {
24
- gap: 1.5rem;
25
- }
26
-
27
- .manage-tabs__tab {
28
- appearance: none;
29
- background: none;
30
- border: 0;
31
- border-bottom: 3px solid transparent;
32
- color: var(--manage-muted);
33
- cursor: pointer;
34
- font-size: 1rem;
35
- font-weight: 500;
36
- margin-bottom: -1px;
37
- padding: 0.75rem 0;
38
- }
39
-
40
- .manage-tabs__tab--active {
41
- color: var(--manage-title);
42
- font-weight: 700;
43
- border-bottom-color: var(--manage-title);
44
- }
45
-
46
22
  /* Cards — gap only (no gap utility) */
47
23
  .manage-card,
48
24
  .manage-card__actions,
@@ -452,3 +428,63 @@
452
428
  height: 1.125rem;
453
429
  flex-shrink: 0;
454
430
  }
431
+
432
+ .orderHistory {
433
+ padding-inline: 7.5rem;
434
+
435
+ @media (max-width: 1024px) {
436
+ padding-inline: 3rem;
437
+ }
438
+
439
+ @media (max-width: 767px) {
440
+ padding-inline: 1.5rem;
441
+ }
442
+ }
443
+
444
+ .orderHistoryTitle {
445
+ font-weight: 800;
446
+ }
447
+
448
+ .refund-notice {
449
+ background-color: #fff;
450
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.15);
451
+ border-radius: 4px;
452
+ }
453
+
454
+ .refundTitle {
455
+ font-size: 22px;
456
+ }
457
+
458
+ .refundBody {
459
+ font-size: 18px;
460
+ }
461
+
462
+ .orderHistoryCard {
463
+
464
+ &__details {
465
+ font-weight: 700;
466
+ }
467
+
468
+ &__link {
469
+ color: #002B2B;
470
+ }
471
+ }
472
+
473
+ .programItemsTable {
474
+ .pgn__data-table thead th {
475
+ background-color: #F2F0EF;
476
+ color: #000000;
477
+ }
478
+
479
+ .pgn__data-table tbody tr:nth-child(even) {
480
+ background-color: #FBFAF9;
481
+ }
482
+
483
+ .pgn__data-table tbody tr {
484
+ color: #000000;
485
+ }
486
+ }
487
+
488
+ .divider {
489
+ border-top: 1px solid #002B2B;
490
+ }
package/dist/types.d.ts CHANGED
@@ -102,3 +102,58 @@ export interface BillingPlan {
102
102
  export interface BillingPlansResult {
103
103
  plans: BillingPlan[];
104
104
  }
105
+ /** One course line on a program purchase receipt. */
106
+ export interface PurchaseHistoryCourse {
107
+ courseId: string;
108
+ name: string;
109
+ price: number;
110
+ discountAmount: number;
111
+ }
112
+ /** One-off course or program purchase from `tOrderHistory.orders`. */
113
+ export interface PurchaseHistoryItem {
114
+ orderId: string;
115
+ orderNumber: string;
116
+ purchasedAt: string;
117
+ paymentIntentId?: string;
118
+ paymentMethodType?: string;
119
+ name: string;
120
+ total: {
121
+ amount: number;
122
+ currency: string;
123
+ };
124
+ /** Set when the payload reports a program purchase. */
125
+ itemType?: 'course' | 'program';
126
+ courses?: PurchaseHistoryCourse[];
127
+ }
128
+ export interface OrdersListProps {
129
+ orders: PurchaseHistoryItem[];
130
+ onViewReceipt?: (order: PurchaseHistoryItem) => void;
131
+ }
132
+ export interface MoneyAmount {
133
+ amount: number;
134
+ currency: string;
135
+ }
136
+ /** One line on a program order details payload. */
137
+ export interface OrderProgramItem {
138
+ productId?: string;
139
+ courseRunKey?: string;
140
+ name: string;
141
+ price?: MoneyAmount;
142
+ discount?: MoneyAmount;
143
+ total?: MoneyAmount;
144
+ }
145
+ /** Normalized `tOrderDetails` payload for the order details page. */
146
+ export interface OrderDetailsData {
147
+ orderId: string;
148
+ orderNumber: string;
149
+ purchasedAt: string;
150
+ paymentIntentId: string;
151
+ name: string;
152
+ subtotalAmount?: MoneyAmount;
153
+ itemPriceAmount?: MoneyAmount;
154
+ discountCode?: string | null;
155
+ total: MoneyAmount;
156
+ discountAmount?: MoneyAmount;
157
+ itemType: 'course' | 'program';
158
+ items?: OrderProgramItem[];
159
+ }
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Manage Subscription — domain types for Viax subscriber + enrollment data.\n */\n\n/** GraphQL runner used by VIAX fetchers. */\nexport type GqlRunner = (\n query: string,\n variables?: Record<string, unknown>,\n) => Promise<any>;\n\n/** Result of `tIsCurrentUserSubscriber` (JSON scalar). */\nexport interface CurrentUserSubscriberResult {\n /** Has/expects access — drive manage vs upsell messaging. */\n isSubscriber: boolean,\n /** Enrollable right now (ACTIVE / TRIAL_ACTIVE). */\n canEnroll: boolean,\n subscriptionBiId: string | null,\n /**\n * Every subscription the learner has held (all statuses, newest first),\n * e.g. a cancelled Stripe one plus a newer PayPal one. Payment history\n * lists invoices across all of them. Empty until the API returns it.\n */\n subscriptionBiIds?: string[],\n status: string | null,\n currentPeriodEnd: string | null,\n subscriptionStartDate: string | null,\n subscriptionEndDate: string | null,\n /**\n * Billing cycle / plan label used by UI (from `billingFrequency`,\n * `renewalType`, or `planName` on the API payload).\n */\n renewalType?: string | null,\n /** Optional cancel timestamp when present. */\n canceledAt?: string | null,\n /** Optional price display amount when present. */\n amount?: string | null,\n currency?: string | null,\n /**\n * Billing-plan fallback fields used when `renewalType` is missing\n * (e.g. PayPal payloads). See `resolvePlanLabel`.\n */\n billingPlanUid?: string | null,\n interval?: string | null,\n billingInterval?: string | null,\n bipOwnershipModel?: { uid?: string, omName?: string } | null,\n}\n\n/** Normalized enrollment for the cancel confirmation course list. */\nexport interface SubscriptionEnrollment {\n biId: string,\n courseMaId: string | null,\n courseName: string | null,\n courseSlug: string | null,\n /** Course card / thumbnail image. */\n imageUrl: string | null,\n orgName: string | null,\n orgLogoUrl: string | null,\n courseRunKey: string | null,\n /** TwouEnrollment bpStatus.code (ACTIVE, COMPLETED, …). */\n status: string | null,\n /** True when the enrollment has a certificate id and/or URL. */\n hasCertificate: boolean,\n /** Absolute certificate link (`COURSES_BASE_URL` + `tCertificateUrl`). */\n certificateUrl: string | null,\n}\n\nexport type PaymentProcessor = 'stripe' | 'paypal';\n\n/** Normalized invoice row for the Payment history tab. */\nexport interface PaymentHistoryItem {\n biId: string,\n /** Display order number, e.g. EDX-BI3X25N5SY30OSIK */\n orderNumber: string,\n stripeInvoiceId: string | null,\n /** PayPal sale id, or `trial:<PayPal subscription id>` for a $0 trial row. */\n paypalInvoiceId: string | null,\n /** Which processor billed this invoice; null when neither id is set. */\n paymentProcessor: PaymentProcessor | null,\n status: string | null,\n billDate: string | null,\n periodStart: string | null,\n periodEnd: string | null,\n /** Charged amount in major currency units (e.g. 59.00). */\n amount: number,\n currency: string,\n isTrial: boolean,\n}\n\n/** UI view derived from subscriber status. */\nexport type SubscriptionView =\n | 'none'\n | 'active'\n | 'canceled_access'\n | 'canceled_expired';\n\nexport type ManageTab = 'subscription' | 'payment-history';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface BillingPlanOwnershipModel {\n uid: string,\n omName: string,\n}\n\n/** Normalized row from `filterCustomerBillingPlan`. */\nexport interface BillingPlan {\n uid: string,\n stripePriceId: string,\n /** Price amount e.g. \"39.99\" */\n amount: string,\n /** Currency code e.g. \"USD\" */\n currency: string,\n isTemplate: boolean,\n ownershipModel: BillingPlanOwnershipModel,\n}\n\nexport interface BillingPlansResult {\n plans: BillingPlan[],\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Manage Subscription — domain types for Viax subscriber + enrollment data.\n */\n\n/** GraphQL runner used by VIAX fetchers. */\nexport type GqlRunner = (\n query: string,\n variables?: Record<string, unknown>,\n) => Promise<any>;\n\n/** Result of `tIsCurrentUserSubscriber` (JSON scalar). */\nexport interface CurrentUserSubscriberResult {\n /** Has/expects access — drive manage vs upsell messaging. */\n isSubscriber: boolean,\n /** Enrollable right now (ACTIVE / TRIAL_ACTIVE). */\n canEnroll: boolean,\n subscriptionBiId: string | null,\n /**\n * Every subscription the learner has held (all statuses, newest first),\n * e.g. a cancelled Stripe one plus a newer PayPal one. Payment history\n * lists invoices across all of them. Empty until the API returns it.\n */\n subscriptionBiIds?: string[],\n status: string | null,\n currentPeriodEnd: string | null,\n subscriptionStartDate: string | null,\n subscriptionEndDate: string | null,\n /**\n * Billing cycle / plan label used by UI (from `billingFrequency`,\n * `renewalType`, or `planName` on the API payload).\n */\n renewalType?: string | null,\n /** Optional cancel timestamp when present. */\n canceledAt?: string | null,\n /** Optional price display amount when present. */\n amount?: string | null,\n currency?: string | null,\n /**\n * Billing-plan fallback fields used when `renewalType` is missing\n * (e.g. PayPal payloads). See `resolvePlanLabel`.\n */\n billingPlanUid?: string | null,\n interval?: string | null,\n billingInterval?: string | null,\n bipOwnershipModel?: { uid?: string, omName?: string } | null,\n}\n\n/** Normalized enrollment for the cancel confirmation course list. */\nexport interface SubscriptionEnrollment {\n biId: string,\n courseMaId: string | null,\n courseName: string | null,\n courseSlug: string | null,\n /** Course card / thumbnail image. */\n imageUrl: string | null,\n orgName: string | null,\n orgLogoUrl: string | null,\n courseRunKey: string | null,\n /** TwouEnrollment bpStatus.code (ACTIVE, COMPLETED, …). */\n status: string | null,\n /** True when the enrollment has a certificate id and/or URL. */\n hasCertificate: boolean,\n /** Absolute certificate link (`COURSES_BASE_URL` + `tCertificateUrl`). */\n certificateUrl: string | null,\n}\n\nexport type PaymentProcessor = 'stripe' | 'paypal';\n\n/** Normalized invoice row for the Payment history tab. */\nexport interface PaymentHistoryItem {\n biId: string,\n /** Display order number, e.g. EDX-BI3X25N5SY30OSIK */\n orderNumber: string,\n stripeInvoiceId: string | null,\n /** PayPal sale id, or `trial:<PayPal subscription id>` for a $0 trial row. */\n paypalInvoiceId: string | null,\n /** Which processor billed this invoice; null when neither id is set. */\n paymentProcessor: PaymentProcessor | null,\n status: string | null,\n billDate: string | null,\n periodStart: string | null,\n periodEnd: string | null,\n /** Charged amount in major currency units (e.g. 59.00). */\n amount: number,\n currency: string,\n isTrial: boolean,\n}\n\n/** UI view derived from subscriber status. */\nexport type SubscriptionView =\n | 'none'\n | 'active'\n | 'canceled_access'\n | 'canceled_expired';\n\nexport type ManageTab = 'subscription' | 'payment-history';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface BillingPlanOwnershipModel {\n uid: string,\n omName: string,\n}\n\n/** Normalized row from `filterCustomerBillingPlan`. */\nexport interface BillingPlan {\n uid: string,\n stripePriceId: string,\n /** Price amount e.g. \"39.99\" */\n amount: string,\n /** Currency code e.g. \"USD\" */\n currency: string,\n isTemplate: boolean,\n ownershipModel: BillingPlanOwnershipModel,\n}\n\nexport interface BillingPlansResult {\n plans: BillingPlan[],\n}\n\n/** One course line on a program purchase receipt. */\nexport interface PurchaseHistoryCourse {\n courseId: string,\n name: string,\n price: number,\n discountAmount: number,\n}\n\n/** One-off course or program purchase from `tOrderHistory.orders`. */\nexport interface PurchaseHistoryItem {\n orderId: string,\n orderNumber: string,\n purchasedAt: string,\n paymentIntentId?: string,\n paymentMethodType?: string,\n name: string,\n total: {\n amount: number,\n currency: string,\n },\n /** Set when the payload reports a program purchase. */\n itemType?: 'course' | 'program',\n courses?: PurchaseHistoryCourse[],\n}\n\nexport interface OrdersListProps {\n orders: PurchaseHistoryItem[],\n onViewReceipt?: (order: PurchaseHistoryItem) => void,\n}\n\nexport interface MoneyAmount {\n amount: number,\n currency: string,\n}\n\n/** One line on a program order details payload. */\nexport interface OrderProgramItem {\n productId?: string,\n courseRunKey?: string,\n name: string,\n price?: MoneyAmount,\n discount?: MoneyAmount,\n total?: MoneyAmount,\n}\n\n/** Normalized `tOrderDetails` payload for the order details page. */\nexport interface OrderDetailsData {\n orderId: string,\n orderNumber: string,\n purchasedAt: string,\n paymentIntentId: string,\n name: string,\n subtotalAmount?: MoneyAmount,\n itemPriceAmount?: MoneyAmount,\n discountCode?: string | null,\n total: MoneyAmount,\n discountAmount?: MoneyAmount,\n itemType: 'course' | 'program',\n items?: OrderProgramItem[],\n}\n"]}
@@ -0,0 +1,6 @@
1
+ interface OrderTotal {
2
+ amount: number;
3
+ currency: string;
4
+ }
5
+ declare const getFormattedCurrency: ({ amount, currency }: OrderTotal) => string;
6
+ export default getFormattedCurrency;
@@ -0,0 +1,6 @@
1
+ const getFormattedCurrency = ({ amount, currency }) => new Intl.NumberFormat('en-US', {
2
+ style: 'currency',
3
+ currency,
4
+ }).format(amount);
5
+ export default getFormattedCurrency;
6
+ //# sourceMappingURL=currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.js","sourceRoot":"","sources":["../../src/utils/currency.ts"],"names":[],"mappings":"AAKA,MAAM,oBAAoB,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAc,EAAU,EAAE,CACxE,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC7B,KAAK,EAAE,UAAU;IACjB,QAAQ;CACT,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEpB,eAAe,oBAAoB,CAAC","sourcesContent":["interface OrderTotal {\n amount: number,\n currency: string,\n}\n\nconst getFormattedCurrency = ({ amount, currency }: OrderTotal): string =>\n new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n }).format(amount);\n\nexport default getFormattedCurrency;\n"]}
@@ -44,3 +44,9 @@ export declare const VALIDATE_CART_PAYMENT_METHOD = "mutation ValidateCartPaymen
44
44
  * Attach a new Stripe payment method (pm_…) as the subscription default.
45
45
  */
46
46
  export declare const UPDATE_SUBSCRIPTION_PAYMENT_METHOD = "mutation UpdateSubscriptionPaymentMethod(\n $biId: String!\n $tStripePaymentMethodId: String!\n) {\n tUpdateSubscriptionPaymentMethod(\n biId: $biId\n tStripePaymentMethodId: $tStripePaymentMethodId\n )\n}";
47
+ /** One-off course and program purchases for the order history page. */
48
+ export declare const GET_PURCHASE_HISTORY = "query PurchaseHistory {\n tOrderHistory\n}";
49
+ /** Detailed payload for one order, looked up by its public order number. */
50
+ export declare const GET_ORDER_DETAILS = "query OrderDetails($orderNumber: String) {\n tOrderDetails(orderNumber: $orderNumber)\n}";
51
+ /** Stripe receipt URL for one order (biId). */
52
+ export declare const GET_STRIPE_PAYMENT_RECEIPT = "query StripePaymentReceipt($biId: String) {\n tPaymentReceipt(biId: $biId)\n}";
@@ -142,4 +142,16 @@ export const UPDATE_SUBSCRIPTION_PAYMENT_METHOD = `mutation UpdateSubscriptionPa
142
142
  tStripePaymentMethodId: $tStripePaymentMethodId
143
143
  )
144
144
  }`;
145
+ /** One-off course and program purchases for the order history page. */
146
+ export const GET_PURCHASE_HISTORY = `query PurchaseHistory {
147
+ tOrderHistory
148
+ }`;
149
+ /** Detailed payload for one order, looked up by its public order number. */
150
+ export const GET_ORDER_DETAILS = `query OrderDetails($orderNumber: String) {
151
+ tOrderDetails(orderNumber: $orderNumber)
152
+ }`;
153
+ /** Stripe receipt URL for one order (biId). */
154
+ export const GET_STRIPE_PAYMENT_RECEIPT = `query StripePaymentReceipt($biId: String) {
155
+ tPaymentReceipt(biId: $biId)
156
+ }`;
145
157
  //# sourceMappingURL=queries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/utils/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;;EAE5C,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;EAuB1C,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;EAmBjC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;EAEjC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;EAErC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;EAmB7C,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;EAe/B,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;EAQ1C,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;;;;;;;;EAQhD,CAAC","sourcesContent":["/**\n * GraphQL documents for the manage-subscription MFE.\n */\n\n/**\n * tIsCurrentUserSubscriber is a JSON scalar — returns the full object;\n * no subfield selection is allowed.\n */\nexport const GET_IS_CURRENT_USER_SUBSCRIBER = `query IsCurrentUserSubscriber {\n tIsCurrentUserSubscriber\n}`;\n\n/**\n * Enrollments for cancel confirmation.\n * Build `_filter` client-side, e.g. tSubscriptionBiId IN ('BI…', 'BI…').\n */\nexport const GET_SUBSCRIPTION_ENROLLMENTS = `query EnrollmentsForSubscriptions($filter: String!) {\n filterTwouEnrollment(_first: 200, _filter: $filter) {\n edges {\n node {\n biId\n tSubscriptionBiId\n bpStatus { code }\n tCourseRunKey\n tCertificateId\n tCertificateUrl\n tCourse {\n maId\n maName\n imageUrl\n tBrandText\n tSchools {\n tName\n tSortValue\n }\n }\n }\n }\n }\n}`;\n\n/**\n * Invoices for the learner's subscriptions (payment history) — Stripe and PayPal.\n * Filter is inlined client-side, one clause per subscription:\n * biRelatesTo.biId = '<biId>' OR biRelatesTo.biId = '<biId>'.\n */\nexport const GET_PAYMENT_HISTORY = `query PaymentHistory($filter: String!, $first: Int!) {\n filterTwouInvoice(_first: $first, _filter: $filter) {\n edges {\n node {\n biId\n tStripeInvoiceId\n tPaypalInvoiceId\n bpStatus { code name }\n billDate\n billBillingPeriod { start end }\n billFinancialCharges {\n fichAmount {\n amount\n units { code }\n }\n }\n }\n }\n }\n}`;\n\n/**\n * Cancel the learner's subscription (default: at period end).\n * Pass `immediate: true` to end access immediately.\n */\nexport const CANCEL_SUBSCRIPTION = `mutation CancelSubscription($biId: String!, $immediate: Boolean) {\n tCancelSubscription(biId: $biId, immediate: $immediate)\n}`;\n\n/**\n * Resume a cancelled subscription before the period end / cancellation date.\n */\nexport const REACTIVATE_SUBSCRIPTION = `mutation ReactivateSubscription($biId: String!) {\n tReactivateSubscription(biId: $biId)\n}`;\n\n/**\n * Payment method on an existing subscription (for renew / manage display).\n */\nexport const GET_SUBSCRIPTION_PAYMENT_METHOD = `query SubscriptionPaymentMethod($filter: String!) {\n filterTwouSubscription(_first: 1, _filter: $filter) {\n edges {\n node {\n biId\n hiConsistsOf {\n ... on TwouSubscriptionItem {\n paybPayment {\n ... on TwouStripePayment {\n tStripePaymentMethodId\n tPaymentMethodLast4\n tPaymentMethodBrand\n }\n }\n }\n }\n }\n }\n }\n}`;\n\n/**\n * Available customer billing plans (monthly / annual template prices).\n * Same query as frontend-app-subscription-checkout.\n */\nexport const GET_BILLING_PLANS = `query GetBillingPlans {\n filterCustomerBillingPlan(_first: 10) {\n edges {\n node {\n uid\n tStripePriceId\n tStripeAmount {\n amount\n units { code }\n }\n bipIsTemplate\n bipOwnershipModel { uid omName }\n }\n }\n }\n}`;\n\n/**\n * Validate a tokenized card (pm_…) before attaching it to the subscription.\n * Runs after stripe.createPaymentMethod, before UPDATE_SUBSCRIPTION_PAYMENT_METHOD.\n */\nexport const VALIDATE_CART_PAYMENT_METHOD = `mutation ValidateCartPaymentMethod(\n $biId: String!\n $tStripePaymentMethodId: String!\n) {\n tValidateCartPaymentMethod(\n biId: $biId\n tStripePaymentMethodId: $tStripePaymentMethodId\n )\n}`;\n\n/**\n * Attach a new Stripe payment method (pm_…) as the subscription default.\n */\nexport const UPDATE_SUBSCRIPTION_PAYMENT_METHOD = `mutation UpdateSubscriptionPaymentMethod(\n $biId: String!\n $tStripePaymentMethodId: String!\n) {\n tUpdateSubscriptionPaymentMethod(\n biId: $biId\n tStripePaymentMethodId: $tStripePaymentMethodId\n )\n}`;\n"]}
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/utils/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;;EAE5C,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;EAuB1C,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;EAmBjC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;EAEjC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;EAErC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;EAmB7C,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;EAe/B,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;EAQ1C,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;;;;;;;;EAQhD,CAAC;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG;;EAElC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG;;EAE/B,CAAC;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,0BAA0B,GAAG;;EAExC,CAAC","sourcesContent":["/**\n * GraphQL documents for the manage-subscription MFE.\n */\n\n/**\n * tIsCurrentUserSubscriber is a JSON scalar — returns the full object;\n * no subfield selection is allowed.\n */\nexport const GET_IS_CURRENT_USER_SUBSCRIBER = `query IsCurrentUserSubscriber {\n tIsCurrentUserSubscriber\n}`;\n\n/**\n * Enrollments for cancel confirmation.\n * Build `_filter` client-side, e.g. tSubscriptionBiId IN ('BI…', 'BI…').\n */\nexport const GET_SUBSCRIPTION_ENROLLMENTS = `query EnrollmentsForSubscriptions($filter: String!) {\n filterTwouEnrollment(_first: 200, _filter: $filter) {\n edges {\n node {\n biId\n tSubscriptionBiId\n bpStatus { code }\n tCourseRunKey\n tCertificateId\n tCertificateUrl\n tCourse {\n maId\n maName\n imageUrl\n tBrandText\n tSchools {\n tName\n tSortValue\n }\n }\n }\n }\n }\n}`;\n\n/**\n * Invoices for the learner's subscriptions (payment history) — Stripe and PayPal.\n * Filter is inlined client-side, one clause per subscription:\n * biRelatesTo.biId = '<biId>' OR biRelatesTo.biId = '<biId>'.\n */\nexport const GET_PAYMENT_HISTORY = `query PaymentHistory($filter: String!, $first: Int!) {\n filterTwouInvoice(_first: $first, _filter: $filter) {\n edges {\n node {\n biId\n tStripeInvoiceId\n tPaypalInvoiceId\n bpStatus { code name }\n billDate\n billBillingPeriod { start end }\n billFinancialCharges {\n fichAmount {\n amount\n units { code }\n }\n }\n }\n }\n }\n}`;\n\n/**\n * Cancel the learner's subscription (default: at period end).\n * Pass `immediate: true` to end access immediately.\n */\nexport const CANCEL_SUBSCRIPTION = `mutation CancelSubscription($biId: String!, $immediate: Boolean) {\n tCancelSubscription(biId: $biId, immediate: $immediate)\n}`;\n\n/**\n * Resume a cancelled subscription before the period end / cancellation date.\n */\nexport const REACTIVATE_SUBSCRIPTION = `mutation ReactivateSubscription($biId: String!) {\n tReactivateSubscription(biId: $biId)\n}`;\n\n/**\n * Payment method on an existing subscription (for renew / manage display).\n */\nexport const GET_SUBSCRIPTION_PAYMENT_METHOD = `query SubscriptionPaymentMethod($filter: String!) {\n filterTwouSubscription(_first: 1, _filter: $filter) {\n edges {\n node {\n biId\n hiConsistsOf {\n ... on TwouSubscriptionItem {\n paybPayment {\n ... on TwouStripePayment {\n tStripePaymentMethodId\n tPaymentMethodLast4\n tPaymentMethodBrand\n }\n }\n }\n }\n }\n }\n }\n}`;\n\n/**\n * Available customer billing plans (monthly / annual template prices).\n * Same query as frontend-app-subscription-checkout.\n */\nexport const GET_BILLING_PLANS = `query GetBillingPlans {\n filterCustomerBillingPlan(_first: 10) {\n edges {\n node {\n uid\n tStripePriceId\n tStripeAmount {\n amount\n units { code }\n }\n bipIsTemplate\n bipOwnershipModel { uid omName }\n }\n }\n }\n}`;\n\n/**\n * Validate a tokenized card (pm_…) before attaching it to the subscription.\n * Runs after stripe.createPaymentMethod, before UPDATE_SUBSCRIPTION_PAYMENT_METHOD.\n */\nexport const VALIDATE_CART_PAYMENT_METHOD = `mutation ValidateCartPaymentMethod(\n $biId: String!\n $tStripePaymentMethodId: String!\n) {\n tValidateCartPaymentMethod(\n biId: $biId\n tStripePaymentMethodId: $tStripePaymentMethodId\n )\n}`;\n\n/**\n * Attach a new Stripe payment method (pm_…) as the subscription default.\n */\nexport const UPDATE_SUBSCRIPTION_PAYMENT_METHOD = `mutation UpdateSubscriptionPaymentMethod(\n $biId: String!\n $tStripePaymentMethodId: String!\n) {\n tUpdateSubscriptionPaymentMethod(\n biId: $biId\n tStripePaymentMethodId: $tStripePaymentMethodId\n )\n}`;\n\n/** One-off course and program purchases for the order history page. */\nexport const GET_PURCHASE_HISTORY = `query PurchaseHistory {\n tOrderHistory\n}`;\n\n/** Detailed payload for one order, looked up by its public order number. */\nexport const GET_ORDER_DETAILS = `query OrderDetails($orderNumber: String) {\n tOrderDetails(orderNumber: $orderNumber)\n}`;\n\n/** Stripe receipt URL for one order (biId). */\nexport const GET_STRIPE_PAYMENT_RECEIPT = `query StripePaymentReceipt($biId: String) {\n tPaymentReceipt(biId: $biId)\n}`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-manage",
3
- "version": "1.18.2",
3
+ "version": "1.20.0",
4
4
  "description": "Subscription Manage Frontend application",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { ManageTab } from '../../types';
3
- interface SubscriptionTabsProps {
4
- activeTab: ManageTab;
5
- onChange: (tab: ManageTab) => void;
6
- }
7
- declare const SubscriptionTabs: React.FC<SubscriptionTabsProps>;
8
- export default SubscriptionTabs;
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useIntl } from '@openedx/frontend-base';
3
- import { trackManageSubscriptionTabClick } from '../../tracking';
4
- import messages from '../messages';
5
- const SubscriptionTabs = ({ activeTab, onChange }) => {
6
- const { formatMessage } = useIntl();
7
- const handleClick = (tab) => {
8
- // Track tab click event here
9
- trackManageSubscriptionTabClick({ tab });
10
- onChange(tab);
11
- };
12
- return (_jsxs("div", { className: "manage-tabs d-flex border-bottom mt-4", role: "tablist", "aria-label": formatMessage(messages['manage.header.title']), children: [_jsx("button", { type: "button", role: "tab", id: "manage-tab-subscription", "aria-selected": activeTab === 'subscription', "aria-controls": "manage-tabpanel-subscription", className: `manage-tabs__tab${activeTab === 'subscription' ? ' manage-tabs__tab--active' : ''}`, onClick: () => handleClick('subscription'), children: formatMessage(messages['manage.tab.subscription']) }), _jsx("button", { type: "button", role: "tab", id: "manage-tab-payment-history", "aria-selected": activeTab === 'payment-history', "aria-controls": "manage-tabpanel-payment-history", className: `manage-tabs__tab${activeTab === 'payment-history' ? ' manage-tabs__tab--active' : ''}`, onClick: () => handleClick('payment-history'), children: formatMessage(messages['manage.tab.paymentHistory']) })] }));
13
- };
14
- export default SubscriptionTabs;
15
- //# sourceMappingURL=SubscriptionTabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SubscriptionTabs.js","sourceRoot":"","sources":["../../../src/components/SubscriptionTabs/SubscriptionTabs.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAOnC,MAAM,gBAAgB,GAAoC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpF,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,WAAW,GAAG,CAAC,GAAc,EAAE,EAAE;QACrC,6BAA6B;QAC7B,+BAA+B,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACzC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,CACL,eACE,SAAS,EAAC,uCAAuC,EACjD,IAAI,EAAC,SAAS,gBACF,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,aAE1D,iBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,KAAK,EACV,EAAE,EAAC,yBAAyB,mBACb,SAAS,KAAK,cAAc,mBAC7B,8BAA8B,EAC5C,SAAS,EAAE,mBAAmB,SAAS,KAAK,cAAc,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,EAAE,EAC/F,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,YAEzC,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,GAC5C,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,KAAK,EACV,EAAE,EAAC,4BAA4B,mBAChB,SAAS,KAAK,iBAAiB,mBAChC,iCAAiC,EAC/C,SAAS,EAAE,mBAAmB,SAAS,KAAK,iBAAiB,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,EAAE,EAClG,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,YAE5C,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,GAC9C,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { trackManageSubscriptionTabClick } from '@src/tracking';\n\nimport type { ManageTab } from '../../types';\nimport messages from '../messages';\n\ninterface SubscriptionTabsProps {\n activeTab: ManageTab,\n onChange: (tab: ManageTab) => void,\n}\n\nconst SubscriptionTabs: React.FC<SubscriptionTabsProps> = ({ activeTab, onChange }) => {\n const { formatMessage } = useIntl();\n\n const handleClick = (tab: ManageTab) => {\n // Track tab click event here\n trackManageSubscriptionTabClick({ tab });\n onChange(tab);\n };\n\n return (\n <div\n className=\"manage-tabs d-flex border-bottom mt-4\"\n role=\"tablist\"\n aria-label={formatMessage(messages['manage.header.title'])}\n >\n <button\n type=\"button\"\n role=\"tab\"\n id=\"manage-tab-subscription\"\n aria-selected={activeTab === 'subscription'}\n aria-controls=\"manage-tabpanel-subscription\"\n className={`manage-tabs__tab${activeTab === 'subscription' ? ' manage-tabs__tab--active' : ''}`}\n onClick={() => handleClick('subscription')}\n >\n {formatMessage(messages['manage.tab.subscription'])}\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n id=\"manage-tab-payment-history\"\n aria-selected={activeTab === 'payment-history'}\n aria-controls=\"manage-tabpanel-payment-history\"\n className={`manage-tabs__tab${activeTab === 'payment-history' ? ' manage-tabs__tab--active' : ''}`}\n onClick={() => handleClick('payment-history')}\n >\n {formatMessage(messages['manage.tab.paymentHistory'])}\n </button>\n </div>\n );\n};\n\nexport default SubscriptionTabs;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CancelSubscriptionPage.js","sourceRoot":"","sources":["../../src/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C;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import React from 'react';\nimport { Alert, Container, Spinner } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useNavigate } from 'react-router-dom';\n\nimport CancelConfirmation from '../components/CancelConfirmation/CancelConfirmation';\nimport messages from '../components/messages';\nimport { MANAGE_PAGE_PATH } from '../constants';\nimport {\n useCancelSubscriptionMutation,\n useIsSubscriberQuery,\n useSubscriptionEnrollmentsQuery,\n useViaxClient,\n useViaxSession,\n} from '../data/hooks/useManageQueries';\n\nconst CancelSubscriptionPage: React.FC = () => {\n const { formatMessage } = useIntl();\n const navigate = useNavigate();\n const client = useViaxClient();\n const { sessionReady, isSessionLoading, isSessionError } = useViaxSession(client);\n const subscriberQuery = useIsSubscriberQuery(client, sessionReady);\n const subscriptionBiId = subscriberQuery.data?.subscriptionBiId ?? null;\n const enrollmentsQuery = useSubscriptionEnrollmentsQuery(\n client,\n sessionReady,\n subscriptionBiId,\n );\n const cancelMutation = useCancelSubscriptionMutation(client);\n\n const isLoading = isSessionLoading || subscriberQuery.isPending;\n const isError = isSessionError || subscriberQuery.isError;\n\n if (isLoading) {\n return (\n <div className=\"manage-page manage-page--loading d-flex justify-content-center align-items-center\">\n <Spinner\n animation=\"border\"\n screenReaderText={formatMessage(messages['manage.loading'])}\n />\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"manage-page\">\n <Container size=\"lg\" className=\"px-3 px-md-4 py-5\">\n <Alert variant=\"danger\">{formatMessage(messages['manage.error'])}</Alert>\n </Container>\n </div>\n );\n }\n\n const subscriber = subscriberQuery.data ?? null;\n const enrollments = enrollmentsQuery.data ?? [];\n\n const handleConfirmCancel = async () => {\n if (!subscriptionBiId) {\n return;\n }\n\n try {\n await cancelMutation.mutateAsync(subscriptionBiId);\n navigate(`/${MANAGE_PAGE_PATH}/cancel/success`);\n } catch {\n // Error surfaced via cancelMutation.isError\n }\n };\n\n return (\n <div className=\"manage-page\">\n <Container size=\"lg\" className=\"px-3 px-md-4\">\n <CancelConfirmation\n subscriber={subscriber}\n enrollments={enrollments}\n isEnrollmentsLoading={enrollmentsQuery.isPending}\n isCanceling={cancelMutation.isPending}\n cancelError={cancelMutation.isError}\n onConfirmCancel={handleConfirmCancel}\n />\n </Container>\n </div>\n );\n};\n\nexport default CancelSubscriptionPage;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CancelSuccessPage.js","sourceRoot":"","sources":["../../src/manageSubscriptionPage/CancelSuccessPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,aAAa,MAAM,2CAA2C,CAAC;AACtE,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,cAAc,GACf,MAAM,gCAAgC,CAAC;AAExC,MAAM,iBAAiB,GAAa,GAAG,EAAE;;IACvC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAClF,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAEnE,MAAM,SAAS,GAAG,gBAAgB,IAAI,eAAe,CAAC,SAAS,CAAC;IAChE,MAAM,OAAO,GAAG,cAAc,IAAI,eAAe,CAAC,OAAO,CAAC;IAE1D,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,cAAK,SAAS,EAAC,mFAAmF,YAChG,KAAC,OAAO,IACN,SAAS,EAAC,QAAQ,EAClB,gBAAgB,EAAE,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,GAC3D,GACE,CACP,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cAAK,SAAS,EAAC,aAAa,YAC1B,KAAC,SAAS,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,mBAAmB,YAChD,KAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,YAAE,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAS,GAC/D,GACR,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAC,aAAa,YAC1B,KAAC,SAAS,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,cAAc,YAC3C,KAAC,aAAa,IAAC,UAAU,EAAE,MAAA,eAAe,CAAC,IAAI,mCAAI,IAAI,GAAI,GACjD,GACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import React from 'react';\nimport { Alert, Container, Spinner } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport CancelSuccess from '../components/CancelSuccess/CancelSuccess';\nimport messages from '../components/messages';\nimport {\n useIsSubscriberQuery,\n useViaxClient,\n useViaxSession,\n} from '../data/hooks/useManageQueries';\n\nconst CancelSuccessPage: React.FC = () => {\n const { formatMessage } = useIntl();\n const client = useViaxClient();\n const { sessionReady, isSessionLoading, isSessionError } = useViaxSession(client);\n const subscriberQuery = useIsSubscriberQuery(client, sessionReady);\n\n const isLoading = isSessionLoading || subscriberQuery.isPending;\n const isError = isSessionError || subscriberQuery.isError;\n\n if (isLoading) {\n return (\n <div className=\"manage-page manage-page--loading d-flex justify-content-center align-items-center\">\n <Spinner\n animation=\"border\"\n screenReaderText={formatMessage(messages['manage.loading'])}\n />\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"manage-page\">\n <Container size=\"lg\" className=\"px-3 px-md-4 py-5\">\n <Alert variant=\"danger\">{formatMessage(messages['manage.error'])}</Alert>\n </Container>\n </div>\n );\n }\n\n return (\n <div className=\"manage-page\">\n <Container size=\"lg\" className=\"px-3 px-md-4\">\n <CancelSuccess subscriber={subscriberQuery.data ?? null} />\n </Container>\n </div>\n );\n};\n\nexport default CancelSuccessPage;\n"]}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const ManageSubscriptionPage: React.FC;
3
- export default ManageSubscriptionPage;