@edx/frontend-app-alacarte-checkout 1.41.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/{HelpCenter → OrderHistory/HelpCenter}/HelpCenter.js +1 -1
- package/dist/components/OrderHistory/HelpCenter/HelpCenter.js.map +1 -0
- package/dist/components/OrderHistory/HelpCenter/messages.js.map +1 -0
- package/dist/components/OrderHistory/OrderHistory.js +6 -3
- package/dist/components/OrderHistory/OrderHistory.js.map +1 -1
- package/dist/components/OrderHistory/OrderHistoryDetails.js +3 -2
- package/dist/components/OrderHistory/OrderHistoryDetails.js.map +1 -1
- package/dist/components/OrderHistory/OrderHistoryTabDetails/PaymentHistory.d.ts +6 -0
- package/dist/components/OrderHistory/OrderHistoryTabDetails/{CoursePayments.js → PaymentHistory.js} +12 -6
- package/dist/components/OrderHistory/OrderHistoryTabDetails/PaymentHistory.js.map +1 -0
- package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionDetails.d.ts +3 -0
- package/dist/components/OrderHistory/OrderHistoryTabDetails/{SubscriptionPayments.js → SubscriptionDetails.js} +4 -4
- package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionDetails.js.map +1 -0
- package/dist/components/OrderHistory/OrderHistoryTabDetails/messages.d.ts +10 -0
- package/dist/components/OrderHistory/OrderHistoryTabDetails/messages.js +12 -2
- package/dist/components/OrderHistory/OrderHistoryTabDetails/messages.js.map +1 -1
- package/dist/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.d.ts +5 -1
- package/dist/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.js +11 -11
- package/dist/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.js.map +1 -1
- package/dist/components/OrderHistory/ProgramItemsTable.d.ts +8 -0
- package/dist/components/OrderHistory/ProgramItemsTable.js +43 -0
- package/dist/components/OrderHistory/ProgramItemsTable.js.map +1 -0
- package/dist/components/OrderHistory/RefundNotice/RefundNotice.d.ts +3 -0
- package/dist/components/OrderHistory/RefundNotice/RefundNotice.js +15 -0
- package/dist/components/OrderHistory/RefundNotice/RefundNotice.js.map +1 -0
- package/dist/components/OrderHistory/RefundNotice/messages.d.ts +18 -0
- package/dist/components/OrderHistory/RefundNotice/messages.js +20 -0
- package/dist/components/OrderHistory/RefundNotice/messages.js.map +1 -0
- package/dist/components/OrderHistory/data/orderDetailsData.d.ts +15 -1
- package/dist/components/OrderHistory/data/orderDetailsData.js +24 -0
- package/dist/components/OrderHistory/data/orderDetailsData.js.map +1 -1
- package/dist/components/OrderHistory/messages.d.ts +20 -0
- package/dist/components/OrderHistory/messages.js +20 -0
- package/dist/components/OrderHistory/messages.js.map +1 -1
- package/dist/styles/components/orderHistory.scss +29 -0
- package/package.json +1 -1
- package/dist/components/HelpCenter/HelpCenter.js.map +0 -1
- package/dist/components/HelpCenter/messages.js.map +0 -1
- package/dist/components/OrderHistory/OrderHistoryTabDetails/CoursePayments.d.ts +0 -3
- package/dist/components/OrderHistory/OrderHistoryTabDetails/CoursePayments.js.map +0 -1
- package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionPayments.d.ts +0 -3
- package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionPayments.js.map +0 -1
- /package/dist/components/{HelpCenter → OrderHistory/HelpCenter}/HelpCenter.d.ts +0 -0
- /package/dist/components/{HelpCenter → OrderHistory/HelpCenter}/messages.d.ts +0 -0
- /package/dist/components/{HelpCenter → OrderHistory/HelpCenter}/messages.js +0 -0
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import messages from './messages';
|
|
5
|
-
import { LEARNER_HELP_CENTER_URL } from '
|
|
5
|
+
import { LEARNER_HELP_CENTER_URL } from '../../../constants';
|
|
6
6
|
import Icon from '@openedx/paragon/dist/Icon';
|
|
7
7
|
import { Launch } from '@openedx/paragon/icons';
|
|
8
8
|
const HelpCenter = () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpCenter.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/HelpCenter/HelpCenter.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,UAAU,GAAa,GAAG,EAAE;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,cAAK,SAAS,EAAC,kCAAkC,YAC/C,aAAG,SAAS,EAAC,yCAAyC,aACnD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EACpC,GAAG,EACJ,MAAC,IAAI,IAAC,EAAE,EAAE,uBAAuB,EAAE,SAAS,EAAC,qEAAqE,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,aACzJ,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACjC,KAAC,IAAI,IAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAC,gBAAgB,iBAAa,kBAAkB,GAAG,IAC1E,IACL,GACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport messages from './messages';\nimport { LEARNER_HELP_CENTER_URL } from '../../../constants';\nimport Icon from '@openedx/paragon/dist/Icon';\nimport { Launch } from '@openedx/paragon/icons';\n\nconst HelpCenter: React.FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <div className=\"manage-help mt-5 pt-4 border-top\">\n <p className=\"manage-help__text text-black small mb-0\">\n {formatMessage(messages.helpLinkText)}\n {' '}\n <Link to={LEARNER_HELP_CENTER_URL} className=\"manage-help__link text-primary-500 d-inline-flex align-items-center\" target=\"_blank\" rel=\"noopener noreferrer\">\n {formatMessage(messages.helpLink)}\n <Icon src={Launch} className=\"icon mr-1 ml-1\" data-testid=\"help-center-icon\" />\n </Link>\n </p>\n </div>\n );\n};\n\nexport default HelpCenter;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/HelpCenter/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,cAAc,EAAE,2BAA2B;QAC3C,WAAW,EAAE,kCAAkC;KAChD;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,+BAA+B;KAC7C;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n helpLinkText: {\n id: 'helpLinkText',\n defaultMessage: 'Need more help? Visit the',\n description: 'Text before the help center link',\n },\n helpLink: {\n id: 'helpLink',\n defaultMessage: 'Learner Help Center',\n description: 'Text for the help center link',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Container } from '@openedx/paragon';
|
|
3
4
|
import OrderHistoryTabs from './OrderHistoryTabs/OrderHistoryTabs';
|
|
4
5
|
import OrderHistoryHeader from './OrderHistoryHeader';
|
|
5
|
-
import HelpCenter from '
|
|
6
|
+
import HelpCenter from './HelpCenter/HelpCenter';
|
|
7
|
+
import RefundNotice from './RefundNotice/RefundNotice';
|
|
6
8
|
const OrderHistory = () => {
|
|
7
|
-
|
|
9
|
+
const [hasOrders, setHasOrders] = useState(false);
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Container, { className: "orderHistory", fluid: true, size: "xl", children: [_jsx(OrderHistoryHeader, {}), _jsx("div", { children: _jsx(OrderHistoryTabs, { onHasOrdersChange: setHasOrders }) })] }), _jsx(Container, { fluid: true, className: "mt-4 bg-light-300", children: _jsxs(Container, { fluid: true, size: "xl", className: "orderHistory mb-4", children: [hasOrders && _jsx(RefundNotice, {}), _jsx(HelpCenter, {})] }) })] }));
|
|
8
11
|
};
|
|
9
12
|
export default OrderHistory;
|
|
10
13
|
//# sourceMappingURL=OrderHistory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderHistory.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/OrderHistory.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"OrderHistory.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/OrderHistory.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AACnE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,MAAM,YAAY,GAAa,GAAG,EAAE;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,OAAO,CACL,8BACE,MAAC,SAAS,IAAC,SAAS,EAAC,cAAc,EAAC,KAAK,QAAC,IAAI,EAAC,IAAI,aACjD,KAAC,kBAAkB,KAAG,EACtB,wBACE,KAAC,gBAAgB,IAAC,iBAAiB,EAAE,YAAY,GAAI,GACjD,IACI,EACZ,KAAC,SAAS,IAAC,KAAK,QAAC,SAAS,EAAC,mBAAmB,YAC5C,MAAC,SAAS,IAAC,KAAK,QAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,mBAAmB,aACrD,SAAS,IAAI,KAAC,YAAY,KAAG,EAC9B,KAAC,UAAU,KAAG,IACJ,GACF,IACX,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Container } from '@openedx/paragon';\nimport OrderHistoryTabs from './OrderHistoryTabs/OrderHistoryTabs';\nimport OrderHistoryHeader from './OrderHistoryHeader';\nimport HelpCenter from './HelpCenter/HelpCenter';\nimport RefundNotice from './RefundNotice/RefundNotice';\n\nconst OrderHistory: React.FC = () => {\n const [hasOrders, setHasOrders] = useState(false);\n\n return (\n <>\n <Container className=\"orderHistory\" fluid size=\"xl\">\n <OrderHistoryHeader />\n <div>\n <OrderHistoryTabs onHasOrdersChange={setHasOrders} />\n </div>\n </Container>\n <Container fluid className=\"mt-4 bg-light-300\">\n <Container fluid size=\"xl\" className=\"orderHistory mb-4\">\n {hasOrders && <RefundNotice />}\n <HelpCenter />\n </Container>\n </Container>\n </>\n );\n};\n\nexport default OrderHistory;\n"]}
|
|
@@ -6,13 +6,14 @@ import orders from './data/orderDetailsData';
|
|
|
6
6
|
import messages from './messages';
|
|
7
7
|
import { getOrderSummaryRows, getOrderItemRows, } from './data/receiptRows';
|
|
8
8
|
import ALCBreadcrumb from '../Breadcrumb/ALCBreadcrumb';
|
|
9
|
+
import { ProgramItemsTable } from './ProgramItemsTable';
|
|
9
10
|
const formatAmount = (amount, currency) => (`${currency === 'USD' ? '$' : ''}${amount.toFixed(2)} ${currency}`);
|
|
10
11
|
const formatDate = (isoDate) => (new Date(isoDate).toLocaleDateString('en-US', {
|
|
11
12
|
month: 'short',
|
|
12
13
|
day: 'numeric',
|
|
13
14
|
year: 'numeric',
|
|
14
15
|
}));
|
|
15
|
-
const ReceiptRow = ({ label, children }) => (_jsxs("div", { className: "d-flex align-items-baseline mb-2", children: [_jsx("span", { className: "font-weight-bold text-gray-700", children: label }), _jsx("span", { className: "flex-grow-1 mx-2 text-gray-700", style: { borderBottom: '1px dotted
|
|
16
|
+
const ReceiptRow = ({ label, children }) => (_jsxs("div", { className: "d-flex align-items-baseline mb-2", children: [_jsx("span", { className: "font-weight-bold text-gray-700", children: label }), _jsx("span", { className: "flex-grow-1 mx-2 text-gray-700", style: { borderBottom: '1px dotted #B4B1A8' } }), _jsx("span", { children: children })] }));
|
|
16
17
|
const OrderReceipt = ({ order }) => {
|
|
17
18
|
const { formatMessage } = useIntl();
|
|
18
19
|
const orderDate = formatDate(order.purchasedAt);
|
|
@@ -24,7 +25,7 @@ const OrderReceipt = ({ order }) => {
|
|
|
24
25
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-2", children: _jsx(ALCBreadcrumb, { items: [
|
|
25
26
|
{ label: 'Order History', href: '/aca-order-history' },
|
|
26
27
|
{ label: `Order date: ${orderDate}` },
|
|
27
|
-
] }) }), _jsxs("h1", { className: "h1 mb-4 mt-4 text-primary-500 orderHistoryTitle", children: [formatMessage(messages.orderDateTitle), ": ", orderDate] }), _jsx("h3", { className: "h3 font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.orderSummaryTitle) }), renderRows(orderSummaryRows), _jsx("hr", { className: "my-4 divider" }), _jsx("h3", { className: "font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.orderItemsTitle) }), renderRows(orderItemRows), _jsx("hr", { className: "my-4 divider" }), _jsx("h3", { className: "font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.paymentTitle) }), _jsx(ReceiptRow, { label: formatMessage(messages.receiptAmountLabel), children: total })] }));
|
|
28
|
+
] }) }), _jsxs("h1", { className: "h1 mb-4 mt-4 text-primary-500 orderHistoryTitle", children: [formatMessage(messages.orderDateTitle), ": ", orderDate] }), _jsx("h3", { className: "h3 font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.orderSummaryTitle) }), renderRows(orderSummaryRows), _jsx("hr", { className: "my-4 divider" }), _jsx("h3", { className: "font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.orderItemsTitle) }), order.itemType === 'program' ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 text-gray-700 mb-1", children: [_jsx("span", { className: "font-weight-bold", children: formatMessage(messages.receiptNameLabel) }), ' ', _jsx("span", { children: order.name })] }), _jsx(ProgramItemsTable, { courses: order.courses, currency: order.total.currency })] })) : renderRows(orderItemRows), _jsx("hr", { className: "my-4 divider" }), _jsx("h3", { className: "font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.paymentTitle) }), _jsx(ReceiptRow, { label: formatMessage(messages.receiptAmountLabel), children: total })] }));
|
|
28
29
|
};
|
|
29
30
|
const OrderHistoryDetails = () => {
|
|
30
31
|
const { orderId } = useParams();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderHistoryDetails.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/OrderHistoryDetails.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,MAAiC,MAAM,yBAAyB,CAAC;AACxE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CAAC,CACzD,GAA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,CAAC,YAAY,CAAC,GAClC,EACL,KAAC,UAAU,IAAC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,YAC1D,KAAK,GACK,IACZ,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAE5D,OAAO,CACL,KAAC,SAAS,IAAC,KAAK,QAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,mBAAmB,YACrD,KAAK,IAAI,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,GAC9B,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Container } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport orders, { type OrderDetailsData } from './data/orderDetailsData';\nimport messages from './messages';\nimport {\n getOrderSummaryRows,\n getOrderItemRows,\n} from './data/receiptRows';\nimport ALCBreadcrumb from '../Breadcrumb/ALCBreadcrumb';\nimport { ProgramItemsTable } from './ProgramItemsTable';\n\nconst formatAmount = (amount: number, currency: string) => (\n `${currency === 'USD' ? '$' : ''}${amount.toFixed(2)} ${currency}`\n);\n\nconst formatDate = (isoDate: string) => (\n new Date(isoDate).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n);\n\ninterface ReceiptRowProps {\n label: string,\n children: ReactNode,\n}\n\nconst ReceiptRow = ({ label, children }: ReceiptRowProps) => (\n <div className=\"d-flex align-items-baseline mb-2\">\n <span className=\"font-weight-bold text-gray-700\">{label}</span>\n <span\n className=\"flex-grow-1 mx-2 text-gray-700\"\n style={{ borderBottom: '1px dotted #B4B1A8' }}\n />\n <span>{children}</span>\n </div>\n);\n\nconst OrderReceipt = ({ order }: { order: OrderDetailsData }) => {\n const { formatMessage } = useIntl();\n const orderDate = formatDate(order.purchasedAt);\n const total = formatAmount(order.total.amount, order.total.currency);\n const discountAmount = formatAmount(0, order.total.currency);\n\n const orderSummaryRows = getOrderSummaryRows(order, orderDate, total, discountAmount);\n\n const orderItemRows = getOrderItemRows(order, total, discountAmount);\n\n const renderRows = (rows: typeof orderSummaryRows | typeof orderItemRows) =>\n rows.map(({ label, value }) => (\n <ReceiptRow key={label.id} label={formatMessage(label)}>\n {value}\n </ReceiptRow>\n ));\n\n return (\n <>\n <div className=\"my-2\">\n <ALCBreadcrumb\n items={[\n { label: 'Order History', href: '/aca-order-history' },\n { label: `Order date: ${orderDate}` },\n ]}\n />\n </div>\n <h1 className=\"h1 mb-4 mt-4 text-primary-500 orderHistoryTitle\">\n {formatMessage(messages.orderDateTitle)}: {orderDate}\n </h1>\n\n <h3 className=\"h3 font-weight-bold mb-3 text-primary-500\">\n {formatMessage(messages.orderSummaryTitle)}\n </h3>\n {renderRows(orderSummaryRows)}\n\n <hr className=\"my-4 divider\" />\n\n <h3 className=\"font-weight-bold mb-3 text-primary-500\">\n {formatMessage(messages.orderItemsTitle)}\n </h3>\n {order.itemType === 'program' ? (\n <>\n <div className=\"mb-2 text-gray-700 mb-1\">\n <span className=\"font-weight-bold\">{formatMessage(messages.receiptNameLabel)}</span>{' '}\n <span>{order.name}</span>\n </div>\n <ProgramItemsTable courses={order.courses} currency={order.total.currency} />\n </>\n ) : renderRows(orderItemRows)}\n\n <hr className=\"my-4 divider\" />\n\n <h3 className=\"font-weight-bold mb-3 text-primary-500\">\n {formatMessage(messages.paymentTitle)}\n </h3>\n <ReceiptRow label={formatMessage(messages.receiptAmountLabel)}>\n {total}\n </ReceiptRow>\n </>\n );\n};\n\nconst OrderHistoryDetails = () => {\n const { orderId } = useParams();\n const order = orders.find(item => item.orderId === orderId);\n\n return (\n <Container fluid size=\"xl\" className=\"py-4 orderHistory\">\n {order && <OrderReceipt order={order} />}\n </Container>\n );\n};\n\nexport default OrderHistoryDetails;\n"]}
|
package/dist/components/OrderHistory/OrderHistoryTabDetails/{CoursePayments.js → PaymentHistory.js}
RENAMED
|
@@ -16,8 +16,8 @@ import { usePurchaseHistoryQuery } from '../../../data/hooks/useAlacarteQueries'
|
|
|
16
16
|
import { createAlacarteCheckoutClient } from '../../../utils/alacarteCheckout';
|
|
17
17
|
import messages from './messages';
|
|
18
18
|
import OrdersList from '../OrderList';
|
|
19
|
-
const
|
|
20
|
-
var _a
|
|
19
|
+
const PaymentHistory = ({ onHasOrdersChange }) => {
|
|
20
|
+
var _a;
|
|
21
21
|
const { formatMessage } = useIntl();
|
|
22
22
|
const config = getAppConfig(appId);
|
|
23
23
|
const siteConfig = getSiteConfig();
|
|
@@ -47,8 +47,14 @@ const CoursePayments = () => {
|
|
|
47
47
|
console.error('Unable to load payment receipt.', error);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
const orders = (
|
|
51
|
-
|
|
50
|
+
const orders = Array.isArray((_a = purchaseHistoryQuery.data) === null || _a === void 0 ? void 0 : _a.orders)
|
|
51
|
+
? purchaseHistoryQuery.data.orders
|
|
52
|
+
: [];
|
|
53
|
+
const hasOrders = purchaseHistoryQuery.isSuccess && orders.length > 0;
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
onHasOrdersChange(hasOrders);
|
|
56
|
+
}, [hasOrders, onHasOrdersChange]);
|
|
57
|
+
return (_jsxs("section", { className: "pt-4", "aria-labelledby": "payment-history", children: [_jsxs("div", { className: "my-2", children: [_jsx("h2", { id: "payment-history", className: "h5 font-weight-bold text-primary-700 mb-1", children: formatMessage(messages.subscriptionPaymentsTitle) }), _jsx("p", { className: "medium text-gray-700 mb-5", children: formatMessage(messages.subscriptionPaymentsEmptyMessage) }), _jsx("h2", { id: "payment-history", className: "h5 font-weight-bold text-primary-700 mb-1", children: formatMessage(messages.otherPurchasesTitle) }), _jsx("p", { className: "medium text-gray-700 mb-0", children: formatMessage(messages.coursePurchasesEmptyMessage) })] }), _jsx("div", { className: "mt-2", children: _jsx(OrdersList, { orders: orders, onViewReceipt: handleViewReceipt }) })] }));
|
|
52
58
|
};
|
|
53
|
-
export default
|
|
54
|
-
//# sourceMappingURL=
|
|
59
|
+
export default PaymentHistory;
|
|
60
|
+
//# sourceMappingURL=PaymentHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentHistory.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabDetails/PaymentHistory.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AAMtC,MAAM,cAAc,GAAkC,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE;;IAC9E,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,KAAK,aAAa,CAAC;IAC/D,MAAM,MA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AAM,GAAG,KAAK,CAAC,OAAO,CAAC,MAAA,oBAAoB,CAAC,IAAI,0CAAE,MAAM,CAAC;QAC7D,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM;QAClC,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAEtE,SAAS,CAAC,GAAG,EAAE;QACb,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,mBAAS,SAAS,EAAC,MAAM,qBAAiB,iBAAiB,aACzD,eAAK,SAAS,EAAC,MAAM,aACnB,aAAI,EAAE,EAAC,iBAAiB,EAAC,SAAS,EAAC,2CAA2C,YAC3E,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,GAC/C,EACL,YAAG,SAAS,EAAC,2BAA2B,YACrC,aAAa,CAAC,QAAQ,CAAC,gCAAgC,CAAC,GACvD,EACJ,aAAI,EAAE,EAAC,iBAAiB,EAAC,SAAS,EAAC,2CAA2C,YAC3E,aAAa,CAAC,QAAQ,CAAC,mBAAmB,CAAC,GACzC,EACL,YAAG,SAAS,EAAC,2BAA2B,YACrC,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC,GAClD,IACA,EACN,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,GAAI,GAC5D,IACE,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { getAppConfig, getSiteConfig, useIntl } from '@openedx/frontend-base';\nimport { appId } from '../../../constants';\nimport { useViaxSessionQuery } from '../../../data/hooks/useCheckoutQueries';\nimport { usePurchaseHistoryQuery } from '../../../data/hooks/useAlacarteQueries';\nimport { createAlacarteCheckoutClient } from '../../../utils/alacarteCheckout';\nimport type { PurchaseHistoryItem } from '../../../types/orderHistory';\nimport messages from './messages';\nimport OrdersList from '../OrderList';\n\ninterface PaymentHistoryProps {\n onHasOrdersChange: (hasOrders: boolean) => void,\n}\n\nconst PaymentHistory: React.FC<PaymentHistoryProps> = ({ onHasOrdersChange }) => {\n const { formatMessage } = useIntl();\n const config = getAppConfig(appId);\n const siteConfig = getSiteConfig();\n const lmsBaseUrl = siteConfig.lmsBaseUrl.replace(/\\/$/, '');\n const isDevelopment = siteConfig.environment === 'development';\n const apiUrl = config.VIAX_API_URL as string | undefined;\n const edxSessionUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : lmsBaseUrl}/api/edx-session`;\n\n const client = useMemo(\n () => (apiUrl ? createAlacarteCheckoutClient({ apiUrl }) : null),\n [apiUrl],\n );\n const sessionQuery = useViaxSessionQuery(edxSessionUrl);\n\n useEffect(() => {\n if (sessionQuery.data && client) {\n client.setToken(sessionQuery.data.viaxToken);\n }\n }, [client, sessionQuery.data]);\n\n const purchaseHistoryQuery = usePurchaseHistoryQuery(client, !!sessionQuery.data);\n\n const handleViewReceipt = async (order: PurchaseHistoryItem) => {\n if (!client || !order.orderId) {\n return;\n }\n\n try {\n const receiptUrl = await client.getStripePaymentReceipt(order.orderId);\n if (receiptUrl) {\n window.open(receiptUrl, '_blank', 'noopener,noreferrer');\n }\n } catch (error) {\n console.error('Unable to load payment receipt.', error);\n }\n };\n\n const orders = Array.isArray(purchaseHistoryQuery.data?.orders)\n ? purchaseHistoryQuery.data.orders\n : [];\n const hasOrders = purchaseHistoryQuery.isSuccess && orders.length > 0;\n\n useEffect(() => {\n onHasOrdersChange(hasOrders);\n }, [hasOrders, onHasOrdersChange]);\n\n return (\n <section className=\"pt-4\" aria-labelledby=\"payment-history\">\n <div className=\"my-2\">\n <h2 id=\"payment-history\" className=\"h5 font-weight-bold text-primary-700 mb-1\">\n {formatMessage(messages.subscriptionPaymentsTitle)}\n </h2>\n <p className=\"medium text-gray-700 mb-5\">\n {formatMessage(messages.subscriptionPaymentsEmptyMessage)}\n </p>\n <h2 id=\"payment-history\" className=\"h5 font-weight-bold text-primary-700 mb-1\">\n {formatMessage(messages.otherPurchasesTitle)}\n </h2>\n <p className=\"medium text-gray-700 mb-0\">\n {formatMessage(messages.coursePurchasesEmptyMessage)}\n </p>\n </div>\n <div className=\"mt-2\">\n <OrdersList orders={orders} onViewReceipt={handleViewReceipt} />\n </div>\n </section>\n );\n};\n\nexport default PaymentHistory;\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIntl } from '@openedx/frontend-base';
|
|
3
3
|
import messages from './messages';
|
|
4
|
-
const
|
|
4
|
+
const SubscriptionDetails = () => {
|
|
5
5
|
const { formatMessage } = useIntl();
|
|
6
|
-
return (_jsx("section", { className: "pt-4", children: _jsx("p", { className: "medium text-gray-700 mb-0", children: formatMessage(messages.
|
|
6
|
+
return (_jsx("section", { className: "pt-4", children: _jsx("p", { className: "medium text-gray-700 mb-0", children: formatMessage(messages.subscriptionDetailsEmptyMessage) }) }));
|
|
7
7
|
};
|
|
8
|
-
export default
|
|
9
|
-
//# sourceMappingURL=
|
|
8
|
+
export default SubscriptionDetails;
|
|
9
|
+
//# sourceMappingURL=SubscriptionDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionDetails.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabDetails/SubscriptionDetails.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,mBAAmB,GAAa,GAAG,EAAE;IACzC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,kBAAS,SAAS,EAAC,MAAM,YACvB,YAAG,SAAS,EAAC,2BAA2B,YACrC,aAAa,CAAC,QAAQ,CAAC,+BAA+B,CAAC,GACtD,GACI,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import React from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from './messages';\n\nconst SubscriptionDetails: React.FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <section className=\"pt-4\">\n <p className=\"medium text-gray-700 mb-0\">\n {formatMessage(messages.subscriptionDetailsEmptyMessage)}\n </p>\n </section>\n );\n};\n\nexport default SubscriptionDetails;\n"]}
|
|
@@ -9,6 +9,16 @@ declare const messages: {
|
|
|
9
9
|
defaultMessage: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
|
+
subscriptionDetailsEmptyMessage: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
subscriptionPaymentsTitle: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
12
22
|
subscriptionPaymentsEmptyMessage: {
|
|
13
23
|
id: string;
|
|
14
24
|
defaultMessage: string;
|
|
@@ -10,11 +10,21 @@ const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Courses you purchased in the last 180 days will appear here. If possible, please retain receipts for your records.',
|
|
11
11
|
description: 'Message shown when there are no course purchases to display.',
|
|
12
12
|
},
|
|
13
|
+
subscriptionDetailsEmptyMessage: {
|
|
14
|
+
id: 'orderHistory.subscriptionDetails.emptyMessage',
|
|
15
|
+
defaultMessage: 'Subscription details will appear here. If possible, please retain receipts for your records.',
|
|
16
|
+
description: 'Message shown when there are no subscription payments to display.',
|
|
17
|
+
},
|
|
18
|
+
subscriptionPaymentsTitle: {
|
|
19
|
+
id: 'orderHistory.subscriptionPayments.title',
|
|
20
|
+
defaultMessage: 'Subscription payments',
|
|
21
|
+
description: 'Heading above the list of subscription payments.',
|
|
22
|
+
},
|
|
13
23
|
subscriptionPaymentsEmptyMessage: {
|
|
14
24
|
id: 'orderHistory.subscriptionPayments.emptyMessage',
|
|
15
|
-
defaultMessage: '
|
|
25
|
+
defaultMessage: 'Your subscription payments will be logged here.',
|
|
16
26
|
description: 'Message shown when there are no subscription payments to display.',
|
|
17
|
-
}
|
|
27
|
+
}
|
|
18
28
|
});
|
|
19
29
|
export default messages;
|
|
20
30
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabDetails/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,mBAAmB,EAAE;QACnB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,mDAAmD;KACjE;IACD,2BAA2B,EAAE;QAC3B,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,oHAAoH;QACpI,WAAW,EAAE,8DAA8D;KAC5E;IACD,gCAAgC,EAAE;QAChC,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabDetails/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,mBAAmB,EAAE;QACnB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,mDAAmD;KACjE;IACD,2BAA2B,EAAE;QAC3B,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,oHAAoH;QACpI,WAAW,EAAE,8DAA8D;KAC5E;IACD,+BAA+B,EAAE;QAC/B,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,8FAA8F;QAC9G,WAAW,EAAE,mEAAmE;KACjF;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,kDAAkD;KAChE;IACD,gCAAgC,EAAE;QAChC,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,iDAAiD;QACjE,WAAW,EAAE,mEAAmE;KACjF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n otherPurchasesTitle: {\n id: 'orderHistory.coursePayments.otherPurchasesTitle',\n defaultMessage: 'Other purchases',\n description: 'Heading above the list of other course purchases.',\n },\n coursePurchasesEmptyMessage: {\n id: 'orderHistory.coursePayments.emptyMessage',\n defaultMessage: 'Courses you purchased in the last 180 days will appear here. If possible, please retain receipts for your records.',\n description: 'Message shown when there are no course purchases to display.',\n },\n subscriptionDetailsEmptyMessage: {\n id: 'orderHistory.subscriptionDetails.emptyMessage',\n defaultMessage: 'Subscription details will appear here. If possible, please retain receipts for your records.',\n description: 'Message shown when there are no subscription payments to display.',\n },\n subscriptionPaymentsTitle: {\n id: 'orderHistory.subscriptionPayments.title',\n defaultMessage: 'Subscription payments',\n description: 'Heading above the list of subscription payments.',\n },\n subscriptionPaymentsEmptyMessage: {\n id: 'orderHistory.subscriptionPayments.emptyMessage',\n defaultMessage: 'Your subscription payments will be logged here.',\n description: 'Message shown when there are no subscription payments to display.',\n }\n});\n\nexport default messages;\n"]}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface OrderHistoryTabsProps {
|
|
3
|
+
onHasOrdersChange: (hasOrders: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
declare const OrderHistoryTabs: React.FC<OrderHistoryTabsProps>;
|
|
2
6
|
export default OrderHistoryTabs;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState, useCallback } from 'react';
|
|
3
3
|
import { Tabs, Tab } from '@openedx/paragon';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const OrderHistoryTabs = () => {
|
|
4
|
+
import SubscriptionDetails from '../OrderHistoryTabDetails/SubscriptionDetails';
|
|
5
|
+
import PaymentHistory from '../OrderHistoryTabDetails/PaymentHistory';
|
|
6
|
+
const OrderHistoryTabs = ({ onHasOrdersChange }) => {
|
|
7
7
|
var _a;
|
|
8
8
|
const orderHistoryTabs = useMemo(() => {
|
|
9
9
|
const tabs = [
|
|
10
10
|
{
|
|
11
|
-
key: '
|
|
12
|
-
title: 'Subscription
|
|
13
|
-
panel: _jsx(
|
|
11
|
+
key: 'Subscription',
|
|
12
|
+
title: 'Subscription',
|
|
13
|
+
panel: _jsx(SubscriptionDetails, {}),
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
key: '
|
|
17
|
-
title: '
|
|
18
|
-
panel: _jsx(
|
|
16
|
+
key: 'PaymentHistory',
|
|
17
|
+
title: 'Payment history',
|
|
18
|
+
panel: _jsx(PaymentHistory, { onHasOrdersChange: onHasOrdersChange }),
|
|
19
19
|
},
|
|
20
20
|
];
|
|
21
21
|
return tabs;
|
|
22
|
-
}, []);
|
|
22
|
+
}, [onHasOrdersChange]);
|
|
23
23
|
const [activeTab, setActiveTab] = useState(orderHistoryTabs[0].key);
|
|
24
24
|
const handleTabSelect = useCallback((tabKey) => {
|
|
25
25
|
if (tabKey) {
|
|
26
26
|
setActiveTab(tabKey);
|
|
27
27
|
}
|
|
28
28
|
}, []);
|
|
29
|
-
return (_jsx(Tabs, { id: "order-history-tabs", defaultActiveKey: (_a = orderHistoryTabs[0]) === null || _a === void 0 ? void 0 : _a.key, activeKey: activeTab, onSelect: handleTabSelect, className: "mb-4",
|
|
29
|
+
return (_jsx(Tabs, { id: "order-history-tabs", defaultActiveKey: (_a = orderHistoryTabs[0]) === null || _a === void 0 ? void 0 : _a.key, activeKey: activeTab, onSelect: handleTabSelect, className: "mb-4", children: orderHistoryTabs.map(tab => (_jsx(Tab, { eventKey: tab.key, title: tab.title, children: tab.panel }, tab.key))) }));
|
|
30
30
|
};
|
|
31
31
|
export default OrderHistoryTabs;
|
|
32
32
|
//# sourceMappingURL=OrderHistoryTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderHistoryTabs.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"OrderHistoryTabs.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,mBAAmB,MAAM,+CAA+C,CAAC;AAChF,OAAO,cAAc,MAAM,0CAA0C,CAAC;AAMtE,MAAM,gBAAgB,GAAoC,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE;;IAClF,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;QACpC,MAAM,IAAI,GAAG;YACX;gBACE,GAAG,EAAE,cAAc;gBACnB,KAAK,EAAE,cAAc;gBACrB,KAAK,EAAE,KAAC,mBAAmB,KAAG;aAC/B;YACD;gBACE,GAAG,EAAE,gBAAgB;gBACrB,KAAK,EAAE,iBAAiB;gBACxB,KAAK,EAAE,KAAC,cAAc,IAAC,iBAAiB,EAAE,iBAAiB,GAAI;aAChE;SACF,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACpE,MAAM,eAAe,GAAG,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE;QAC7C,IAAI,MAAM,EAAE,CAAC;YACX,YAAY,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,IAAI,IACH,EAAE,EAAC,oBAAoB,EACvB,gBAAgB,EAAE,MAAA,gBAAgB,CAAC,CAAC,CAAC,0CAAE,GAAG,EAC1C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAC,MAAM,YAEf,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAC3B,KAAC,GAAG,IAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,YACrC,GAAG,CAAC,KAAK,IADmC,GAAG,CAAC,GAAG,CAEhD,CACP,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React, { useMemo, useState, useCallback } from 'react';\nimport { Tabs, Tab } from '@openedx/paragon';\nimport SubscriptionDetails from '../OrderHistoryTabDetails/SubscriptionDetails';\nimport PaymentHistory from '../OrderHistoryTabDetails/PaymentHistory';\n\ninterface OrderHistoryTabsProps {\n onHasOrdersChange: (hasOrders: boolean) => void,\n}\n\nconst OrderHistoryTabs: React.FC<OrderHistoryTabsProps> = ({ onHasOrdersChange }) => {\n const orderHistoryTabs = useMemo(() => {\n const tabs = [\n {\n key: 'Subscription',\n title: 'Subscription',\n panel: <SubscriptionDetails />,\n },\n {\n key: 'PaymentHistory',\n title: 'Payment history',\n panel: <PaymentHistory onHasOrdersChange={onHasOrdersChange} />,\n },\n ];\n\n return tabs;\n }, [onHasOrdersChange]);\n\n const [activeTab, setActiveTab] = useState(orderHistoryTabs[0].key);\n const handleTabSelect = useCallback((tabKey) => {\n if (tabKey) {\n setActiveTab(tabKey);\n }\n }, []);\n\n return (\n <Tabs\n id=\"order-history-tabs\"\n defaultActiveKey={orderHistoryTabs[0]?.key}\n activeKey={activeTab}\n onSelect={handleTabSelect}\n className=\"mb-4\"\n >\n {orderHistoryTabs.map(tab => (\n <Tab eventKey={tab.key} title={tab.title} key={tab.key}>\n {tab.panel}\n </Tab>\n ))}\n </Tabs>\n );\n};\n\nexport default OrderHistoryTabs;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type OrderCourseItem } from './data/orderDetailsData';
|
|
2
|
+
export declare const formatAmount: (amount: number, currency: string) => string;
|
|
3
|
+
interface ProgramItemsTableProps {
|
|
4
|
+
courses: OrderCourseItem[];
|
|
5
|
+
currency: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ProgramItemsTable: ({ courses, currency }: ProgramItemsTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ProgramItemsTable;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DataTable } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import messages from './messages';
|
|
5
|
+
export const formatAmount = (amount, currency) => (`${currency === 'USD' ? '$' : ''}${amount.toFixed(2)} ${currency}`);
|
|
6
|
+
export const ProgramItemsTable = ({ courses, currency }) => {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
const data = courses.map(({ courseId, name, price, discountAmount }) => ({
|
|
9
|
+
id: courseId,
|
|
10
|
+
name,
|
|
11
|
+
price: formatAmount(price, currency),
|
|
12
|
+
discountAmount: `-${formatAmount(discountAmount, currency)}`,
|
|
13
|
+
totalAfterDiscount: formatAmount(price - discountAmount, currency),
|
|
14
|
+
}));
|
|
15
|
+
const columns = [
|
|
16
|
+
{
|
|
17
|
+
Header: formatMessage(messages.receiptTableCourseHeader),
|
|
18
|
+
accessor: 'name',
|
|
19
|
+
cellClassName: 'text-left',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
Header: formatMessage(messages.receiptTablePriceHeader),
|
|
23
|
+
accessor: 'price',
|
|
24
|
+
headerClassName: 'text-left',
|
|
25
|
+
cellClassName: 'text-left',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
Header: formatMessage(messages.receiptTableDiscountAmountHeader),
|
|
29
|
+
accessor: 'discountAmount',
|
|
30
|
+
headerClassName: 'text-left',
|
|
31
|
+
cellClassName: 'text-left',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
Header: formatMessage(messages.receiptTableTotalAfterDiscountHeader),
|
|
35
|
+
accessor: 'totalAfterDiscount',
|
|
36
|
+
headerClassName: 'text-left',
|
|
37
|
+
cellClassName: 'text-left',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
return (_jsx("div", { className: "table-responsive mb-2 programItemsTable", children: _jsx(DataTable, { itemCount: data.length, data: data, columns: columns, children: _jsx(DataTable.Table, {}) }) }));
|
|
41
|
+
};
|
|
42
|
+
export default ProgramItemsTable;
|
|
43
|
+
//# sourceMappingURL=ProgramItemsTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgramItemsTable.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/ProgramItemsTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,QAA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B,eAAe,EAAE,WAAW;YAC5B,aAAa,EAAE,WAAW;SAC3B;KACF,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAC,yCAAyC,YACtD,KAAC,SAAS,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,YAC7D,KAAC,SAAS,CAAC,KAAK,KAAG,GACT,GACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { DataTable } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { type OrderCourseItem } from './data/orderDetailsData';\nimport messages from './messages';\n\nexport const formatAmount = (amount: number, currency: string) => (\n `${currency === 'USD' ? '$' : ''}${amount.toFixed(2)} ${currency}`\n);\n\ninterface ProgramItemsTableProps {\n courses: OrderCourseItem[],\n currency: string,\n}\n\nexport const ProgramItemsTable = ({ courses, currency }: ProgramItemsTableProps) => {\n const { formatMessage } = useIntl();\n const data = courses.map(({ courseId, name, price, discountAmount }) => ({\n id: courseId,\n name,\n price: formatAmount(price, currency),\n discountAmount: `-${formatAmount(discountAmount, currency)}`,\n totalAfterDiscount: formatAmount(price - discountAmount, currency),\n }));\n const columns = [\n {\n Header: formatMessage(messages.receiptTableCourseHeader),\n accessor: 'name',\n cellClassName: 'text-left',\n },\n {\n Header: formatMessage(messages.receiptTablePriceHeader),\n accessor: 'price',\n headerClassName: 'text-left',\n cellClassName: 'text-left',\n },\n {\n Header: formatMessage(messages.receiptTableDiscountAmountHeader),\n accessor: 'discountAmount',\n headerClassName: 'text-left',\n cellClassName: 'text-left',\n },\n {\n Header: formatMessage(messages.receiptTableTotalAfterDiscountHeader),\n accessor: 'totalAfterDiscount',\n headerClassName: 'text-left',\n cellClassName: 'text-left',\n },\n ];\n\n return (\n <div className=\"table-responsive mb-2 programItemsTable\">\n <DataTable itemCount={data.length} data={data} columns={columns}>\n <DataTable.Table />\n </DataTable>\n </div>\n );\n};\n\nexport default ProgramItemsTable;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getAppConfig, useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import { appId, BILLING_SUPPORT_EMAIL } from '../../../constants';
|
|
4
|
+
import messages from './messages';
|
|
5
|
+
const RefundNotice = () => {
|
|
6
|
+
const { formatMessage } = useIntl();
|
|
7
|
+
const config = getAppConfig(appId);
|
|
8
|
+
const refundPolicyUrl = config.REFUND_POLICY_URL;
|
|
9
|
+
return (_jsxs("section", { className: "refund-notice p-4 mb-1 mt-5", "aria-labelledby": "refund-notice-title", children: [_jsx("h3", { id: "refund-notice-title", className: "h3 font-weight-bold text-primary-700 mb-3 refundTitle", children: formatMessage(messages.title) }), _jsx("p", { className: "lead text-gray-700 mb-0 refundBody", children: formatMessage(messages.body, {
|
|
10
|
+
emailLink: _jsx("a", { href: `mailto:${BILLING_SUPPORT_EMAIL}`, children: BILLING_SUPPORT_EMAIL }),
|
|
11
|
+
refundPolicyLink: (_jsx("a", { href: refundPolicyUrl, target: "_blank", rel: "noopener noreferrer", children: formatMessage(messages.refundPolicyLink) })),
|
|
12
|
+
}) })] }));
|
|
13
|
+
};
|
|
14
|
+
export default RefundNotice;
|
|
15
|
+
//# sourceMappingURL=RefundNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefundNotice.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/RefundNotice/RefundNotice.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,YAAY,GAAa,GAAG,EAAE;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAuC,CAAC;IAEvE,OAAO,CACL,mBAAS,SAAS,EAAC,6BAA6B,qBAAiB,qBAAqB,aACpF,aAAI,EAAE,EAAC,qBAAqB,EAAC,SAAS,EAAC,uDAAuD,YAC3F,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,GAC3B,EACL,YAAG,SAAS,EAAC,oCAAoC,YAC9C,aAAa,CAAC,QAAQ,CAAC,IAAI,EAAE;oBAC5B,SAAS,EAAE,YAAG,IAAI,EAAE,UAAU,qBAAqB,EAAE,YAAG,qBAAqB,GAAK;oBAClF,gBAAgB,EAAE,CAChB,YAAG,IAAI,EAAE,eAAe,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,YAChE,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GACvC,CACL;iBACF,CAAC,GACA,IACI,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React from 'react';\nimport { getAppConfig, useIntl } from '@openedx/frontend-base';\nimport { appId, BILLING_SUPPORT_EMAIL } from '../../../constants';\nimport messages from './messages';\n\nconst RefundNotice: React.FC = () => {\n const { formatMessage } = useIntl();\n const config = getAppConfig(appId);\n const refundPolicyUrl = config.REFUND_POLICY_URL as string | undefined;\n\n return (\n <section className=\"refund-notice p-4 mb-1 mt-5\" aria-labelledby=\"refund-notice-title\">\n <h3 id=\"refund-notice-title\" className=\"h3 font-weight-bold text-primary-700 mb-3 refundTitle\">\n {formatMessage(messages.title)}\n </h3>\n <p className=\"lead text-gray-700 mb-0 refundBody\">\n {formatMessage(messages.body, {\n emailLink: <a href={`mailto:${BILLING_SUPPORT_EMAIL}`}>{BILLING_SUPPORT_EMAIL}</a>,\n refundPolicyLink: (\n <a href={refundPolicyUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n {formatMessage(messages.refundPolicyLink)}\n </a>\n ),\n })}\n </p>\n </section>\n );\n};\n\nexport default RefundNotice;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
title: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
body: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
refundPolicyLink: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default messages;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
title: {
|
|
4
|
+
id: 'orderHistory.refundNotice.title',
|
|
5
|
+
defaultMessage: 'Need a refund?',
|
|
6
|
+
description: 'Heading for the order history refund notice.',
|
|
7
|
+
},
|
|
8
|
+
body: {
|
|
9
|
+
id: 'orderHistory.refundNotice.body',
|
|
10
|
+
defaultMessage: 'For course or program refunds, contact {emailLink}. See our {refundPolicyLink} for details.',
|
|
11
|
+
description: 'Refund support instructions shown to learners with a purchase.',
|
|
12
|
+
},
|
|
13
|
+
refundPolicyLink: {
|
|
14
|
+
id: 'orderHistory.refundNotice.refundPolicyLink',
|
|
15
|
+
defaultMessage: 'Refund Policy',
|
|
16
|
+
description: 'Link text for the refund policy.',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default messages;
|
|
20
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/RefundNotice/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,8CAA8C;KAC5D;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,6FAA6F;QAC7G,WAAW,EAAE,gEAAgE;KAC9E;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,kCAAkC;KAChD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'orderHistory.refundNotice.title',\n defaultMessage: 'Need a refund?',\n description: 'Heading for the order history refund notice.',\n },\n body: {\n id: 'orderHistory.refundNotice.body',\n defaultMessage: 'For course or program refunds, contact {emailLink}. See our {refundPolicyLink} for details.',\n description: 'Refund support instructions shown to learners with a purchase.',\n },\n refundPolicyLink: {\n id: 'orderHistory.refundNotice.refundPolicyLink',\n defaultMessage: 'Refund Policy',\n description: 'Link text for the refund policy.',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface OrderCourseItem {
|
|
2
|
+
courseId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
price: number;
|
|
5
|
+
discountAmount: number;
|
|
6
|
+
}
|
|
7
|
+
interface BaseOrderDetailsData {
|
|
2
8
|
orderId: string;
|
|
3
9
|
orderNumber: string;
|
|
4
10
|
purchasedAt: string;
|
|
@@ -9,5 +15,13 @@ export interface OrderDetailsData {
|
|
|
9
15
|
currency: string;
|
|
10
16
|
};
|
|
11
17
|
}
|
|
18
|
+
export interface CourseOrderDetailsData extends BaseOrderDetailsData {
|
|
19
|
+
itemType: 'course';
|
|
20
|
+
}
|
|
21
|
+
export interface ProgramOrderDetailsData extends BaseOrderDetailsData {
|
|
22
|
+
itemType: 'program';
|
|
23
|
+
courses: OrderCourseItem[];
|
|
24
|
+
}
|
|
25
|
+
export type OrderDetailsData = CourseOrderDetailsData | ProgramOrderDetailsData;
|
|
12
26
|
declare const orderDetailsData: OrderDetailsData[];
|
|
13
27
|
export default orderDetailsData;
|
|
@@ -5,6 +5,7 @@ const orderDetailsData = [
|
|
|
5
5
|
purchasedAt: '2026-10-26T14:37:56.721Z',
|
|
6
6
|
paymentIntentId: 'pi_3UUp24EUxB2SCTmQ1LBPdo4n',
|
|
7
7
|
name: 'A Verified and Audi course or b2c testing 001',
|
|
8
|
+
itemType: 'course',
|
|
8
9
|
total: {
|
|
9
10
|
amount: 90,
|
|
10
11
|
currency: 'USD',
|
|
@@ -16,6 +17,7 @@ const orderDetailsData = [
|
|
|
16
17
|
purchasedAt: '2026-10-24T10:15:30.000Z',
|
|
17
18
|
paymentIntentId: 'pi_3UUp25EUxB2SCTmQ2LBPdo5p',
|
|
18
19
|
name: 'Harvard University CS50 Introduction to Computer Science',
|
|
20
|
+
itemType: 'course',
|
|
19
21
|
total: {
|
|
20
22
|
amount: 219,
|
|
21
23
|
currency: 'USD',
|
|
@@ -27,11 +29,33 @@ const orderDetailsData = [
|
|
|
27
29
|
purchasedAt: '2026-10-20T08:45:12.000Z',
|
|
28
30
|
paymentIntentId: 'pi_3UUp26EUxB2SCTmQ3LBPdo6q',
|
|
29
31
|
name: 'Introduction to Python Programming',
|
|
32
|
+
itemType: 'course',
|
|
30
33
|
total: {
|
|
31
34
|
amount: 49,
|
|
32
35
|
currency: 'USD',
|
|
33
36
|
},
|
|
34
37
|
},
|
|
38
|
+
{
|
|
39
|
+
orderId: 'BI3TZ7XDIOWBAFG',
|
|
40
|
+
orderNumber: '2U-ORD-62638124',
|
|
41
|
+
purchasedAt: '2026-10-28T09:20:00.000Z',
|
|
42
|
+
paymentIntentId: 'pi_3UUp27EUxB2SCTmQ4LBPdo7r',
|
|
43
|
+
name: 'Harvard University, Power Skills for Career Growth',
|
|
44
|
+
itemType: 'program',
|
|
45
|
+
total: {
|
|
46
|
+
amount: 910,
|
|
47
|
+
currency: 'USD',
|
|
48
|
+
},
|
|
49
|
+
courses: [
|
|
50
|
+
{ courseId: 'course-v1:HarvardX+PS101+2026', name: 'Cultivating Power for Positive Impact', price: 175, discountAmount: 45 },
|
|
51
|
+
{ courseId: 'course-v1:HarvardX+PS102+2026', name: 'Building a Winning Mindset: Flexibility and Resiliency at Work', price: 175, discountAmount: 45 },
|
|
52
|
+
{ courseId: 'course-v1:HarvardX+PS103+2026', name: 'Purpose, Perspective, and Persuasion', price: 175, discountAmount: 45 },
|
|
53
|
+
{ courseId: 'course-v1:HarvardX+PS104+2026', name: 'How to Bring the Real You to Work: Authenticity, Connection, and Identity', price: 175, discountAmount: 45 },
|
|
54
|
+
{ courseId: 'course-v1:HarvardX+PS105+2026', name: 'Tech Ethics: Critical Thinking in the Age of Apps, Algorithms, and AI', price: 175, discountAmount: 45 },
|
|
55
|
+
{ courseId: 'course-v1:HarvardX+PS106+2026', name: 'Effective Writing for Greater Impact', price: 175, discountAmount: 45 },
|
|
56
|
+
{ courseId: 'course-v1:HarvardX+PS107+2026', name: 'Disagreeing Productively and Collaboratively Well', price: 175, discountAmount: 45 },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
35
59
|
];
|
|
36
60
|
export default orderDetailsData;
|
|
37
61
|
//# sourceMappingURL=orderDetailsData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderDetailsData.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/data/orderDetailsData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orderDetailsData.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/data/orderDetailsData.ts"],"names":[],"mappings":"AA8BA,MAAM,gBAAgB,GAAuB;IAC3C;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EA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EAAE,QAAQ,EAAE,+BAA+B,EAAE,IAAI,EAAE,2EAA2E,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE;YAChK,EAAE,QAAQ,EAAE,+BAA+B,EAAE,IAAI,EAAE,uEAAuE,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE;YAC5J,EAAE,QAAQ,EAAE,+BAA+B,EAAE,IAAI,EAAE,sCAAsC,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE;YAC3H,EAAE,QAAQ,EAAE,+BAA+B,EAAE,IAAI,EAAE,mDAAmD,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE;SACzI;KACF;CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["export interface OrderCourseItem {\n courseId: string,\n name: string,\n price: number,\n discountAmount: number,\n}\n\ninterface BaseOrderDetailsData {\n orderId: string,\n orderNumber: string,\n purchasedAt: string,\n paymentIntentId: string,\n name: string,\n total: {\n amount: number,\n currency: string,\n },\n}\n\nexport interface CourseOrderDetailsData extends BaseOrderDetailsData {\n itemType: 'course',\n}\n\nexport interface ProgramOrderDetailsData extends BaseOrderDetailsData {\n itemType: 'program',\n courses: OrderCourseItem[],\n}\n\nexport type OrderDetailsData = CourseOrderDetailsData | ProgramOrderDetailsData;\n\nconst orderDetailsData: OrderDetailsData[] = [\n {\n orderId: 'BI0QZ4UAFLTYBCXC',\n orderNumber: '2U-ORD-62638121',\n purchasedAt: '2026-10-26T14:37:56.721Z',\n paymentIntentId: 'pi_3UUp24EUxB2SCTmQ1LBPdo4n',\n name: 'A Verified and Audi course or b2c testing 001',\n itemType: 'course',\n total: {\n amount: 90,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI1RX5VBGMUZCDYD',\n orderNumber: '2U-ORD-62638122',\n purchasedAt: '2026-10-24T10:15:30.000Z',\n paymentIntentId: 'pi_3UUp25EUxB2SCTmQ2LBPdo5p',\n name: 'Harvard University CS50 Introduction to Computer Science',\n itemType: 'course',\n total: {\n amount: 219,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI2SY6WCHNVAEZE',\n orderNumber: '2U-ORD-62638123',\n purchasedAt: '2026-10-20T08:45:12.000Z',\n paymentIntentId: 'pi_3UUp26EUxB2SCTmQ3LBPdo6q',\n name: 'Introduction to Python Programming',\n itemType: 'course',\n total: {\n amount: 49,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI3TZ7XDIOWBAFG',\n orderNumber: '2U-ORD-62638124',\n purchasedAt: '2026-10-28T09:20:00.000Z',\n paymentIntentId: 'pi_3UUp27EUxB2SCTmQ4LBPdo7r',\n name: 'Harvard University, Power Skills for Career Growth',\n itemType: 'program',\n total: {\n amount: 910,\n currency: 'USD',\n },\n courses: [\n { courseId: 'course-v1:HarvardX+PS101+2026', name: 'Cultivating Power for Positive Impact', price: 175, discountAmount: 45 },\n { courseId: 'course-v1:HarvardX+PS102+2026', name: 'Building a Winning Mindset: Flexibility and Resiliency at Work', price: 175, discountAmount: 45 },\n { courseId: 'course-v1:HarvardX+PS103+2026', name: 'Purpose, Perspective, and Persuasion', price: 175, discountAmount: 45 },\n { courseId: 'course-v1:HarvardX+PS104+2026', name: 'How to Bring the Real You to Work: Authenticity, Connection, and Identity', price: 175, discountAmount: 45 },\n { courseId: 'course-v1:HarvardX+PS105+2026', name: 'Tech Ethics: Critical Thinking in the Age of Apps, Algorithms, and AI', price: 175, discountAmount: 45 },\n { courseId: 'course-v1:HarvardX+PS106+2026', name: 'Effective Writing for Greater Impact', price: 175, discountAmount: 45 },\n { courseId: 'course-v1:HarvardX+PS107+2026', name: 'Disagreeing Productively and Collaboratively Well', price: 175, discountAmount: 45 },\n ],\n },\n];\n\nexport default orderDetailsData;\n"]}
|
|
@@ -84,5 +84,25 @@ declare const messages: {
|
|
|
84
84
|
defaultMessage: string;
|
|
85
85
|
description: string;
|
|
86
86
|
};
|
|
87
|
+
receiptTableCourseHeader: {
|
|
88
|
+
id: string;
|
|
89
|
+
defaultMessage: string;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
receiptTablePriceHeader: {
|
|
93
|
+
id: string;
|
|
94
|
+
defaultMessage: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
receiptTableDiscountAmountHeader: {
|
|
98
|
+
id: string;
|
|
99
|
+
defaultMessage: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
receiptTableTotalAfterDiscountHeader: {
|
|
103
|
+
id: string;
|
|
104
|
+
defaultMessage: string;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
87
107
|
};
|
|
88
108
|
export default messages;
|
|
@@ -85,6 +85,26 @@ const messages = defineMessages({
|
|
|
85
85
|
defaultMessage: 'Amount:',
|
|
86
86
|
description: 'Receipt label for the payment amount',
|
|
87
87
|
},
|
|
88
|
+
receiptTableCourseHeader: {
|
|
89
|
+
id: 'receiptTableCourseHeader',
|
|
90
|
+
defaultMessage: 'Course',
|
|
91
|
+
description: 'Program order items table header for the course name column',
|
|
92
|
+
},
|
|
93
|
+
receiptTablePriceHeader: {
|
|
94
|
+
id: 'receiptTablePriceHeader',
|
|
95
|
+
defaultMessage: 'Price',
|
|
96
|
+
description: 'Program order items table header for the course price column',
|
|
97
|
+
},
|
|
98
|
+
receiptTableDiscountAmountHeader: {
|
|
99
|
+
id: 'receiptTableDiscountAmountHeader',
|
|
100
|
+
defaultMessage: 'Discount amount',
|
|
101
|
+
description: 'Program order items table header for the discount amount column',
|
|
102
|
+
},
|
|
103
|
+
receiptTableTotalAfterDiscountHeader: {
|
|
104
|
+
id: 'receiptTableTotalAfterDiscountHeader',
|
|
105
|
+
defaultMessage: 'Total after discount',
|
|
106
|
+
description: 'Program order items table header for the total after discount column',
|
|
107
|
+
},
|
|
88
108
|
});
|
|
89
109
|
export default messages;
|
|
90
110
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2BAA2B;KACzC;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sBAAsB;QAC1B,cAAc,EAAE,wDAAwD;QACxE,WAAW,EAAE,mCAAmC;KACjD;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,iCAAiC;KAC/C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,2BAA2B;KACzC;IACD,cAAc,EAAE;QACd,EAAE,EAAE,gBAAgB;QACpB,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,sBAAsB;KACpC;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,mCAAmC;KACjD;IACD,eAAe,EAAE;QACf,EAAE,EAAE,iBAAiB;QACrB,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,iCAAiC;KAC/C;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,6BAA6B;KAC3C;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oCAAoC;KAClD;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,uBAAuB;QAC3B,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,kCAAkC;KAChD;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sBAAsB;QAC1B,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,uCAAuC;KACrD;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,0BAA0B;QAC9B,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,qCAAqC;KACnD;IACD,0BAA0B,EAAE;QAC1B,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,uCAAuC;KACrD;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,kBAAkB;QACtB,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,iCAAiC;KAC/C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,kCAAkC;KAChD;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,oBAAoB;QACxB,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,sCAAsC;KACpD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderHistoryTitle: {\n id: 'orderHistoryTitle',\n defaultMessage: 'Order History',\n description: 'Heading for order history',\n },\n orderHistorySubTitle: {\n id: 'orderHistorySubTitle',\n defaultMessage: 'View previous purchases and manage your subscription. ',\n description: 'Page subtitle under Order History',\n },\n subscriptionPaymentsTab: {\n id: 'subscriptionPaymentsTab',\n defaultMessage: 'Subscription payments',\n description: 'Subscription payments tab label',\n },\n coursePaymentsTab: {\n id: 'coursePaymentsTab',\n defaultMessage: 'Course payments',\n description: 'Course payments tab label',\n },\n orderDateTitle: {\n id: 'orderDateTitle',\n defaultMessage: 'Order date',\n description: 'Label for order date',\n },\n orderSummaryTitle: {\n id: 'orderSummaryTitle',\n defaultMessage: 'Order summary',\n description: 'Heading for order summary section',\n },\n orderItemsTitle: {\n id: 'orderItemsTitle',\n defaultMessage: 'Order items',\n description: 'Heading for order items section',\n },\n paymentTitle: {\n id: 'paymentTitle',\n defaultMessage: 'Payment',\n description: 'Heading for payment section',\n },\n receiptOrderNumberLabel: {\n id: 'receiptOrderNumberLabel',\n defaultMessage: 'Order number:',\n description: 'Receipt label for the order number',\n },\n receiptOrderDateLabel: {\n id: 'receiptOrderDateLabel',\n defaultMessage: 'Order date:',\n description: 'Receipt label for the order date',\n },\n receiptSubtotalLabel: {\n id: 'receiptSubtotalLabel',\n defaultMessage: 'Subtotal:',\n description: 'Receipt label for the subtotal amount',\n },\n receiptDiscountCodeLabel: {\n id: 'receiptDiscountCodeLabel',\n defaultMessage: 'Discount code:',\n description: 'Receipt label for the discount code',\n },\n receiptDiscountAmountLabel: {\n id: 'receiptDiscountAmountLabel',\n defaultMessage: 'Discount amount:',\n description: 'Receipt label for the discount amount',\n },\n receiptTotalAfterDiscountLabel: {\n id: 'receiptTotalAfterDiscountLabel',\n defaultMessage: 'Total after discount:',\n description: 'Receipt label for the total after discount',\n },\n receiptNameLabel: {\n id: 'receiptNameLabel',\n defaultMessage: 'Name:',\n description: 'Receipt label for the item name',\n },\n receiptPriceLabel: {\n id: 'receiptPriceLabel',\n defaultMessage: 'Price:',\n description: 'Receipt label for the item price',\n },\n receiptAmountLabel: {\n id: 'receiptAmountLabel',\n defaultMessage: 'Amount:',\n description: 'Receipt label for the payment amount',\n },\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2BAA2B;KAC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AE,uCAAuC;KACrD;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,kBAAkB;QACtB,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,iCAAiC;KAC/C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,kCAAkC;KAChD;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,oBAAoB;QACxB,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,sCAAsC;KACpD;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,0BAA0B;QAC9B,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,6DAA6D;KAC3E;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,8DAA8D;KAC5E;IACD,gCAAgC,EAAE;QAChC,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,iEAAiE;KAC/E;IACD,oCAAoC,EAAE;QACpC,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,sEAAsE;KACpF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderHistoryTitle: {\n id: 'orderHistoryTitle',\n defaultMessage: 'Order History',\n description: 'Heading for order history',\n },\n orderHistorySubTitle: {\n id: 'orderHistorySubTitle',\n defaultMessage: 'View previous purchases and manage your subscription. ',\n description: 'Page subtitle under Order History',\n },\n subscriptionPaymentsTab: {\n id: 'subscriptionPaymentsTab',\n defaultMessage: 'Subscription payments',\n description: 'Subscription payments tab label',\n },\n coursePaymentsTab: {\n id: 'coursePaymentsTab',\n defaultMessage: 'Course payments',\n description: 'Course payments tab label',\n },\n orderDateTitle: {\n id: 'orderDateTitle',\n defaultMessage: 'Order date',\n description: 'Label for order date',\n },\n orderSummaryTitle: {\n id: 'orderSummaryTitle',\n defaultMessage: 'Order summary',\n description: 'Heading for order summary section',\n },\n orderItemsTitle: {\n id: 'orderItemsTitle',\n defaultMessage: 'Order items',\n description: 'Heading for order items section',\n },\n paymentTitle: {\n id: 'paymentTitle',\n defaultMessage: 'Payment',\n description: 'Heading for payment section',\n },\n receiptOrderNumberLabel: {\n id: 'receiptOrderNumberLabel',\n defaultMessage: 'Order number:',\n description: 'Receipt label for the order number',\n },\n receiptOrderDateLabel: {\n id: 'receiptOrderDateLabel',\n defaultMessage: 'Order date:',\n description: 'Receipt label for the order date',\n },\n receiptSubtotalLabel: {\n id: 'receiptSubtotalLabel',\n defaultMessage: 'Subtotal:',\n description: 'Receipt label for the subtotal amount',\n },\n receiptDiscountCodeLabel: {\n id: 'receiptDiscountCodeLabel',\n defaultMessage: 'Discount code:',\n description: 'Receipt label for the discount code',\n },\n receiptDiscountAmountLabel: {\n id: 'receiptDiscountAmountLabel',\n defaultMessage: 'Discount amount:',\n description: 'Receipt label for the discount amount',\n },\n receiptTotalAfterDiscountLabel: {\n id: 'receiptTotalAfterDiscountLabel',\n defaultMessage: 'Total after discount:',\n description: 'Receipt label for the total after discount',\n },\n receiptNameLabel: {\n id: 'receiptNameLabel',\n defaultMessage: 'Name:',\n description: 'Receipt label for the item name',\n },\n receiptPriceLabel: {\n id: 'receiptPriceLabel',\n defaultMessage: 'Price:',\n description: 'Receipt label for the item price',\n },\n receiptAmountLabel: {\n id: 'receiptAmountLabel',\n defaultMessage: 'Amount:',\n description: 'Receipt label for the payment amount',\n },\n receiptTableCourseHeader: {\n id: 'receiptTableCourseHeader',\n defaultMessage: 'Course',\n description: 'Program order items table header for the course name column',\n },\n receiptTablePriceHeader: {\n id: 'receiptTablePriceHeader',\n defaultMessage: 'Price',\n description: 'Program order items table header for the course price column',\n },\n receiptTableDiscountAmountHeader: {\n id: 'receiptTableDiscountAmountHeader',\n defaultMessage: 'Discount amount',\n description: 'Program order items table header for the discount amount column',\n },\n receiptTableTotalAfterDiscountHeader: {\n id: 'receiptTableTotalAfterDiscountHeader',\n defaultMessage: 'Total after discount',\n description: 'Program order items table header for the total after discount column',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -14,6 +14,20 @@
|
|
|
14
14
|
font-weight: 800;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.refund-notice {
|
|
18
|
+
background-color: #fff;
|
|
19
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.15);
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.refundTitle {
|
|
24
|
+
font-size: 22px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.refundBody {
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
}
|
|
30
|
+
|
|
17
31
|
.orderHistoryCard {
|
|
18
32
|
|
|
19
33
|
&__details {
|
|
@@ -25,6 +39,21 @@
|
|
|
25
39
|
}
|
|
26
40
|
}
|
|
27
41
|
|
|
42
|
+
.programItemsTable {
|
|
43
|
+
.pgn__data-table thead th {
|
|
44
|
+
background-color: #F2F0EF;
|
|
45
|
+
color: #000000;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pgn__data-table tbody tr:nth-child(even) {
|
|
49
|
+
background-color: #FBFAF9;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pgn__data-table tbody tr {
|
|
53
|
+
color: #000000;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
28
57
|
.divider {
|
|
29
58
|
border-top: 1px solid #002B2B;
|
|
30
59
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HelpCenter.js","sourceRoot":"","sources":["../../../src/components/HelpCenter/HelpCenter.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,UAAU,GAAa,GAAG,EAAE;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,cAAK,SAAS,EAAC,kCAAkC,YAC/C,aAAG,SAAS,EAAC,yCAAyC,aACnD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EACpC,GAAG,EACJ,MAAC,IAAI,IAAC,EAAE,EAAE,uBAAuB,EAAE,SAAS,EAAC,qEAAqE,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,aACzJ,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACjC,KAAC,IAAI,IAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAC,gBAAgB,iBAAa,kBAAkB,GAAG,IAC1E,IACL,GACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport messages from './messages';\nimport { LEARNER_HELP_CENTER_URL } from '../../constants';\nimport Icon from '@openedx/paragon/dist/Icon';\nimport { Launch } from '@openedx/paragon/icons';\n\nconst HelpCenter: React.FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <div className=\"manage-help mt-5 pt-4 border-top\">\n <p className=\"manage-help__text text-black small mb-0\">\n {formatMessage(messages.helpLinkText)}\n {' '}\n <Link to={LEARNER_HELP_CENTER_URL} className=\"manage-help__link text-primary-500 d-inline-flex align-items-center\" target=\"_blank\" rel=\"noopener noreferrer\">\n {formatMessage(messages.helpLink)}\n <Icon src={Launch} className=\"icon mr-1 ml-1\" data-testid=\"help-center-icon\" />\n </Link>\n </p>\n </div>\n );\n};\n\nexport default HelpCenter;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/components/HelpCenter/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,cAAc,EAAE,2BAA2B;QAC3C,WAAW,EAAE,kCAAkC;KAChD;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,+BAA+B;KAC7C;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n helpLinkText: {\n id: 'helpLinkText',\n defaultMessage: 'Need more help? Visit the',\n description: 'Text before the help center link',\n },\n helpLink: {\n id: 'helpLink',\n defaultMessage: 'Learner Help Center',\n description: 'Text for the help center link',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoursePayments.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabDetails/CoursePayments.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC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IAAI,CAAC,CAAC;IAElF,MAAM,iBAAiB,GAAG,CAAO,KAA0B,EAAE,EAAE;QAC7D,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC9B,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACvE,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAA,CAAC;IAEF,MAAM,MAAM,GAAG,MAAA,MAAA,oBAAoB,CAAC,IAAI,0CAAE,MAAM,mCAAI,EAAE,CAAC;IAEvD,OAAO,CACL,mBAAS,SAAS,EAAC,MAAM,qBAAiB,+BAA+B,aACvE,eAAK,SAAS,EAAC,MAAM,aACnB,aAAI,EAAE,EAAC,+BAA+B,EAAC,SAAS,EAAC,2CAA2C,YACzF,aAAa,CAAC,QAAQ,CAAC,mBAAmB,CAAC,GACzC,EACL,YAAG,SAAS,EAAC,2BAA2B,YACrC,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC,GAClD,IACA,EACN,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,GAAI,GAC5D,IACE,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { getAppConfig, getSiteConfig, useIntl } from '@openedx/frontend-base';\nimport { appId } from '../../../constants';\nimport { useViaxSessionQuery } from '../../../data/hooks/useCheckoutQueries';\nimport { usePurchaseHistoryQuery } from '../../../data/hooks/useAlacarteQueries';\nimport { createAlacarteCheckoutClient } from '../../../utils/alacarteCheckout';\nimport type { PurchaseHistoryItem } from '../../../types/orderHistory';\nimport messages from './messages';\nimport OrdersList from '../OrderList';\n\nconst CoursePayments: React.FC = () => {\n const { formatMessage } = useIntl();\n const config = getAppConfig(appId);\n const siteConfig = getSiteConfig();\n const lmsBaseUrl = siteConfig.lmsBaseUrl.replace(/\\/$/, '');\n const isDevelopment = siteConfig.environment === 'development';\n const apiUrl = config.VIAX_API_URL as string | undefined;\n const edxSessionUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : lmsBaseUrl}/api/edx-session`;\n\n const client = useMemo(\n () => (apiUrl ? createAlacarteCheckoutClient({ apiUrl }) : null),\n [apiUrl],\n );\n const sessionQuery = useViaxSessionQuery(edxSessionUrl);\n\n useEffect(() => {\n if (sessionQuery.data && client) {\n client.setToken(sessionQuery.data.viaxToken);\n }\n }, [client, sessionQuery.data]);\n\n const purchaseHistoryQuery = usePurchaseHistoryQuery(client, !!sessionQuery.data);\n\n const handleViewReceipt = async (order: PurchaseHistoryItem) => {\n if (!client || !order.orderId) {\n return;\n }\n\n try {\n const receiptUrl = await client.getStripePaymentReceipt(order.orderId);\n if (receiptUrl) {\n window.open(receiptUrl, '_blank', 'noopener,noreferrer');\n }\n } catch (error) {\n console.error('Unable to load payment receipt.', error);\n }\n };\n\n const orders = purchaseHistoryQuery.data?.orders ?? [];\n\n return (\n <section className=\"pt-4\" aria-labelledby=\"course-payments-empty-heading\">\n <div className=\"my-2\">\n <h2 id=\"course-payments-empty-heading\" className=\"h5 font-weight-bold text-primary-700 mb-1\">\n {formatMessage(messages.otherPurchasesTitle)}\n </h2>\n <p className=\"medium text-gray-700 mb-0\">\n {formatMessage(messages.coursePurchasesEmptyMessage)}\n </p>\n </div>\n <div className=\"mt-2\">\n <OrdersList orders={orders} onViewReceipt={handleViewReceipt} />\n </div>\n </section>\n );\n};\n\nexport default CoursePayments;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionPayments.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/OrderHistoryTabDetails/SubscriptionPayments.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,oBAAoB,GAAa,GAAG,EAAE;IAC1C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,kBAAS,SAAS,EAAC,MAAM,YACvB,YAAG,SAAS,EAAC,2BAA2B,YACrC,aAAa,CAAC,QAAQ,CAAC,gCAAgC,CAAC,GACvD,GACI,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from './messages';\n\nconst SubscriptionPayments: React.FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <section className=\"pt-4\">\n <p className=\"medium text-gray-700 mb-0\">\n {formatMessage(messages.subscriptionPaymentsEmptyMessage)}\n </p>\n </section>\n );\n};\n\nexport default SubscriptionPayments;\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|