@edx/frontend-app-subscription-learner-dashboard 1.78.0 → 1.80.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/constants.js CHANGED
@@ -15,12 +15,12 @@ export const subscriptionDashboardUrlPath = '/subscription-learner-dashboard';
15
15
  export const SUBSCRIPTION_ROUTE_PREFIXES = [
16
16
  '/subscription-',
17
17
  '/checkout',
18
- '/order-history',
18
+ '/order-',
19
19
  ];
20
20
  export const NON_SUBSCRIPTION_ROUTE_PREFIXES = [
21
21
  '/learner-',
22
22
  '/aca-',
23
- '/order-history'
23
+ '/order-'
24
24
  ];
25
25
  export const learnerDashboardUrlPath = '/learner-dashboard';
26
26
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,2CAA2C,CAAC;AAEjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,yFAAyF;AACzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAgB,SAAS,CAAC;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAgB,QAAQ,CAAC;AAEzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,sCAAsC,CAAC;AAEhF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,+BAA+B,GAAG,4CAA4C,CAAC;AAE5F,MAAM,CAAC,MAAM,4BAA4B,GAAG,iCAAiC,CAAC;AAE9E,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB;IAChB,WAAW;IACX,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW;IACX,OAAO;IACP,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC","sourcesContent":["import { ProductType } from './types/types';\n\nexport const appId = 'org.openedx.frontend.app.learnerDashboard';\n\nexport const HITS_PER_PAGE_PROGRAMS = 4;\nexport const HITS_PER_PAGE_COURSES = 4;\n\n/** Facet attribute names in ALGOLIA_PRODUCT_INDEX_NAME — update if your index differs */\nexport const FACET_PRODUCT_TYPE = 'product';\nexport const FACET_SUBJECTS = 'subjects';\n\nexport const PRODUCT_TYPE_PROGRAM: ProductType = 'program';\nexport const PRODUCT_TYPE_COURSE: ProductType = 'course';\n\nexport const subscriptionDashboardRole = 'org.edx.frontend.subs.role.dashboard';\n\nexport const subscriptionSignoutRole = 'org.openedx.frontend.role.signOut';\n\nexport const subscriptionAccountRole = 'org.openedx.frontend.role.account';\n\nexport const subscriptionProfileRole = 'org.openedx.frontend.role.profile';\n\nexport const subscriptionProgramProgressRole = 'org.edx.frontend.subs.role.programProgress';\n\nexport const subscriptionDashboardUrlPath = '/subscription-learner-dashboard';\n\nexport const SUBSCRIPTION_ROUTE_PREFIXES = [\n '/subscription-',\n '/checkout',\n '/order-history',\n];\n\nexport const NON_SUBSCRIPTION_ROUTE_PREFIXES = [\n '/learner-',\n '/aca-',\n '/order-history'\n];\n\nexport const learnerDashboardUrlPath = '/learner-dashboard';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,2CAA2C,CAAC;AAEjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,yFAAyF;AACzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAgB,SAAS,CAAC;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAgB,QAAQ,CAAC;AAEzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,sCAAsC,CAAC;AAEhF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AAE3E,MAAM,CAAC,MAAM,+BAA+B,GAAG,4CAA4C,CAAC;AAE5F,MAAM,CAAC,MAAM,4BAA4B,GAAG,iCAAiC,CAAC;AAE9E,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB;IAChB,WAAW;IACX,SAAS;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW;IACX,OAAO;IACP,SAAS;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC","sourcesContent":["import { ProductType } from './types/types';\n\nexport const appId = 'org.openedx.frontend.app.learnerDashboard';\n\nexport const HITS_PER_PAGE_PROGRAMS = 4;\nexport const HITS_PER_PAGE_COURSES = 4;\n\n/** Facet attribute names in ALGOLIA_PRODUCT_INDEX_NAME — update if your index differs */\nexport const FACET_PRODUCT_TYPE = 'product';\nexport const FACET_SUBJECTS = 'subjects';\n\nexport const PRODUCT_TYPE_PROGRAM: ProductType = 'program';\nexport const PRODUCT_TYPE_COURSE: ProductType = 'course';\n\nexport const subscriptionDashboardRole = 'org.edx.frontend.subs.role.dashboard';\n\nexport const subscriptionSignoutRole = 'org.openedx.frontend.role.signOut';\n\nexport const subscriptionAccountRole = 'org.openedx.frontend.role.account';\n\nexport const subscriptionProfileRole = 'org.openedx.frontend.role.profile';\n\nexport const subscriptionProgramProgressRole = 'org.edx.frontend.subs.role.programProgress';\n\nexport const subscriptionDashboardUrlPath = '/subscription-learner-dashboard';\n\nexport const SUBSCRIPTION_ROUTE_PREFIXES = [\n '/subscription-',\n '/checkout',\n '/order-',\n];\n\nexport const NON_SUBSCRIPTION_ROUTE_PREFIXES = [\n '/learner-',\n '/aca-',\n '/order-'\n];\n\nexport const learnerDashboardUrlPath = '/learner-dashboard';\n"]}
@@ -82,10 +82,6 @@ const app = {
82
82
  op: WidgetOperationTypes.INSERT_BEFORE,
83
83
  relatedId: 'org.openedx.frontend.widget.header.desktopAuthenticatedMenuLogout.v1',
84
84
  element: (_jsx("div", { onClick: () => trackHeaderLinkClick('order-history', eventNames.headerOrderHistoryLinkClicked), children: _jsx(OrderHistoryLinkMenuItem, { variant: "navLink" }) })),
85
- condition: {
86
- callback: () => Boolean(getAppConfig(appId).ORDER_HISTORY_URL)
87
- && isSubscriptionContext(),
88
- },
89
85
  },
90
86
  {
91
87
  slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAEL,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,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SAAS;QACT,MAAM;QACN,KAAK;KACN;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport {\n App,\n LinkMenuItem,\n WidgetOperationTypes,\n getAppConfig,\n useSiteEvent,\n} from '@openedx/frontend-base';\n\nimport {\n appId,\n subscriptionDashboardUrlPath,\n subscriptionSignoutRole,\n SUBSCRIPTION_ROUTE_PREFIXES,\n learnerDashboardUrlPath,\n} from '../../constants';\n\nimport { createEventTracker } from '../../data/services/segment/utils';\nimport { categories, eventNames } from '../../tracking/constants';\nimport { getCommonTrackingProps } from '@src/tracking';\n\nimport ConfirmEmailBanner from './ConfirmEmailBanner';\nimport ProgramsLinkMenuItem from './ProgramsLinkMenuItem';\nimport SupportLinkMenuItem from './SupportLinkMenuItem';\nimport OrderHistoryLinkMenuItem from './OrderHistoryLinkMenuItem';\nimport messages from '@src/messages';\nimport CustomAvatarMenu from './CustomAvatarMenu';\nimport SiteLogo from './SiteLogo';\n\nconst trackHeaderLinkClick = (url: string, eventName: string) => {\n createEventTracker(\n eventName,\n { category: categories.header, label: url }\n )();\n};\n\nconst getIsSubscriber = () =>\n (typeof window !== 'undefined'\n ? (window as Window & { __EDX_IS_SUBSCRIBER__?: boolean }).__EDX_IS_SUBSCRIBER__\n : undefined)\n ?? getCommonTrackingProps().isSubscriber;\n\nconst isSubscriptionContext = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n const pathname = window.location?.pathname || '';\n\n return getIsSubscriber() === true\n && SUBSCRIPTION_ROUTE_PREFIXES.some(prefix => pathname.startsWith(prefix));\n};\n\nconst SubscribeLink = () => {\n const [isPaid, setIsPaid] = useState(false);\n const handlePaymentStateChanged = useCallback(\n (_topic: string, data?: { isPaid: boolean }) => {\n // Checkout cleanup must not undo a successful payment.\n if (data?.isPaid === true) {\n setIsPaid(true);\n }\n }, []);\n\n useSiteEvent(\n 'org.openedx.frontend.event.subscriptionCheckout.paymentStateChanged.v1',\n handlePaymentStateChanged,\n );\n\n if (isPaid || getIsSubscriber() === true) {\n return null;\n }\n\n return (\n <div className=\"d-inline-flex align-items-center text-warning text-decoration-none subscribe-header-navlink px-3\">\n <LinkMenuItem\n label={messages['header.user.menu.subscribe'].defaultMessage}\n url=\"/checkout\"\n variant=\"hyperlink\"\n />\n </div>\n );\n};\n\nconst dashboardURL = getIsSubscriber() === true ? subscriptionDashboardUrlPath : learnerDashboardUrlPath;\n\nconst app: App = {\n appId: 'org.openedx.frontend.app.learnerDashboard.header',\n slots: [\n {\n slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerConfirmEmail.v1',\n op: WidgetOperationTypes.PREPEND,\n component: ConfirmEmailBanner,\n condition: {\n callback: () => isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkPrograms.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('programs', eventNames.headerProgramsLinkClicked)}>\n <ProgramsLinkMenuItem variant=\"navLink\" />\n </div>\n ),\n condition: {\n callback: () =>\n getAppConfig(appId).ENABLE_PROGRAMS === true\n && isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkSupport.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('support', eventNames.headerSupportLinkClicked)}>\n <SupportLinkMenuItem variant=\"dropdownItem\" />\n </div>\n ),\n condition: {\n callback: () =>\n Boolean(getAppConfig(appId).SUPPORT_URL) && isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkOrderHistory.v1',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId:\n 'org.openedx.frontend.widget.header.desktopAuthenticatedMenuLogout.v1',\n element: (\n <div onClick={() => trackHeaderLinkClick('order-history', eventNames.headerOrderHistoryLinkClicked)}>\n <OrderHistoryLinkMenuItem variant=\"navLink\" />\n </div>\n ),\n condition: {\n callback: () =>\n Boolean(getAppConfig(appId).ORDER_HISTORY_URL)\n && isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',\n id: 'org.edx.frontend.widget.learnerHome.headerLinkSubscribe.v1',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId: 'org.edx.frontend.widget.learnerHome.headerLinkDashboard.v1',\n element: <SubscribeLink />,\n condition: {\n callback: () =>\n typeof window !== 'undefined'\n && (window.location.pathname.startsWith('/checkout') || window.location.pathname.startsWith('/aca-') || window.location.pathname.startsWith('/order-'))\n && getIsSubscriber() !== true,\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',\n id: 'org.edx.frontend.widget.learnerHome.headerLinkDashboard.v1',\n op: WidgetOperationTypes.PREPEND,\n element: (\n <div\n className=\"px-3 dashboard-header-navlink\"\n onClick={() => trackHeaderLinkClick(dashboardURL, eventNames.headerDashboardLinkClicked)}\n >\n <LinkMenuItem\n label={messages['header.user.menu.dashboard'].defaultMessage}\n url={dashboardURL}\n variant=\"hyperlink\"\n />\n </div>\n ),\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.edx.frontend.widget.learnerDashboard.headerAuthenticatedMenuSignOut.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('', eventNames.headerUserSignOut)}>\n <LinkMenuItem\n label={messages['header.user.menu.signOut'].defaultMessage}\n role={subscriptionSignoutRole}\n variant=\"dropdownItem\"\n />\n </div>\n ),\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.edx.frontend.widget.learnerDashboard.dashboard.v1',\n op: WidgetOperationTypes.PREPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick(dashboardURL, eventNames.headerDashboardLinkClicked)}>\n <LinkMenuItem\n label={messages['header.user.menu.dashboard'].defaultMessage}\n url={dashboardURL}\n variant=\"dropdownItem\"\n />\n </div>\n ),\n condition: {\n callback: () => isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',\n id: 'org.openedx.frontend.widget.header.desktopAuthenticatedMenu.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId:\n 'org.openedx.frontend.widget.header.desktopAuthenticatedMenu.v1',\n element: <CustomAvatarMenu />,\n condition: {\n authenticated: true,\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.mobileRight.v1',\n id: 'org.example.site.widget.header.mobileAuthenticatedMenu.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId:\n 'org.openedx.frontend.widget.header.mobileAuthenticatedMenu.v1',\n element: <CustomAvatarMenu />,\n condition: {\n authenticated: true,\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopLeft.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.header.desktopLogo.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId: 'org.openedx.frontend.widget.header.desktopLogo.v1',\n element: <SiteLogo />,\n },\n {\n slotId: 'org.openedx.frontend.slot.header.mobileLeft.v1',\n id: 'org.example.site.widget.header.mobileLogoLeft.v1',\n op: WidgetOperationTypes.APPEND,\n element: <SiteLogo />,\n },\n {\n slotId: 'org.openedx.frontend.slot.header.mobileCenter.v1',\n id: 'org.example.site.widget.header.mobileLogoCenterReplace.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId: 'org.openedx.frontend.widget.header.mobileLogo.v1',\n element: <></>,\n },\n // {\n // // TO-DO : Resume your last course will be implemented seprately in a different ticket.(Ticket: SUBS-818)\n // // https://2u-internal.atlassian.net/browse/SUBS-818\n // slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n // id: 'org.openedx.frontend.widget.learnerDashboard.headerAuthenticatedMenuLastCourse.v1',\n // op: WidgetOperationTypes.PREPEND,\n // element: (\n // <LinkMenuItem\n // label={messages['header.user.menu.lastCourse'].defaultMessage}\n // url=\"/last-course\"\n // variant=\"dropdownItem\"\n // />\n // )\n // },\n ],\n};\n\nexport default app;\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAEL,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,SAAiB,EAAE,EAAE;IAC9D,kBAAkB,CAChB,SAAS,EACT,EAAE,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAC5C,EAAE,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;;IAC3B,OAAA,MAAA,CAAC,OAAO,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C,OAAO;YAChC,SAAS,EAAE,mDAAmD;YAC9D,OAAO,EAAE,KAAC,QAAQ,KAAG;SACtB;QACD;YACE,MAAM,EAAE,gDAAgD;YACxD,EAAE,EAAE,kDAAkD;YACtD,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,OAAO,EAAE,KAAC,QAAQ,KAAG;SACtB;QACD;YACE,MAAM,EAAE,kDAAkD;YAC1D,EAAE,EAAE,2DAA2D;YAC/D,EAAE,EAAE,oBAAoB,CAAC,OAAO;YAChC,SAAS,EAAE,kDAAkD;YAC7D,OAAO,EAAE,mBAAK;SACf;QACD,IAAI;QACJ,8GAA8G;QAC9G,yDAAyD;QACzD,qEAAqE;QACrE,6FAA6F;QAC7F,sCAAsC;QACtC,eAAe;QACf,oBAAoB;QACpB,uEAAuE;QACvE,2BAA2B;QAC3B,+BAA+B;QAC/B,SAAS;QACT,MAAM;QACN,KAAK;KACN;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport {\n App,\n LinkMenuItem,\n WidgetOperationTypes,\n getAppConfig,\n useSiteEvent,\n} from '@openedx/frontend-base';\n\nimport {\n appId,\n subscriptionDashboardUrlPath,\n subscriptionSignoutRole,\n SUBSCRIPTION_ROUTE_PREFIXES,\n learnerDashboardUrlPath,\n} from '../../constants';\n\nimport { createEventTracker } from '../../data/services/segment/utils';\nimport { categories, eventNames } from '../../tracking/constants';\nimport { getCommonTrackingProps } from '@src/tracking';\n\nimport ConfirmEmailBanner from './ConfirmEmailBanner';\nimport ProgramsLinkMenuItem from './ProgramsLinkMenuItem';\nimport SupportLinkMenuItem from './SupportLinkMenuItem';\nimport OrderHistoryLinkMenuItem from './OrderHistoryLinkMenuItem';\nimport messages from '@src/messages';\nimport CustomAvatarMenu from './CustomAvatarMenu';\nimport SiteLogo from './SiteLogo';\n\nconst trackHeaderLinkClick = (url: string, eventName: string) => {\n createEventTracker(\n eventName,\n { category: categories.header, label: url }\n )();\n};\n\nconst getIsSubscriber = () =>\n (typeof window !== 'undefined'\n ? (window as Window & { __EDX_IS_SUBSCRIBER__?: boolean }).__EDX_IS_SUBSCRIBER__\n : undefined)\n ?? getCommonTrackingProps().isSubscriber;\n\nconst isSubscriptionContext = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n const pathname = window.location?.pathname || '';\n\n return getIsSubscriber() === true\n && SUBSCRIPTION_ROUTE_PREFIXES.some(prefix => pathname.startsWith(prefix));\n};\n\nconst SubscribeLink = () => {\n const [isPaid, setIsPaid] = useState(false);\n const handlePaymentStateChanged = useCallback(\n (_topic: string, data?: { isPaid: boolean }) => {\n // Checkout cleanup must not undo a successful payment.\n if (data?.isPaid === true) {\n setIsPaid(true);\n }\n }, []);\n\n useSiteEvent(\n 'org.openedx.frontend.event.subscriptionCheckout.paymentStateChanged.v1',\n handlePaymentStateChanged,\n );\n\n if (isPaid || getIsSubscriber() === true) {\n return null;\n }\n\n return (\n <div className=\"d-inline-flex align-items-center text-warning text-decoration-none subscribe-header-navlink px-3\">\n <LinkMenuItem\n label={messages['header.user.menu.subscribe'].defaultMessage}\n url=\"/checkout\"\n variant=\"hyperlink\"\n />\n </div>\n );\n};\n\nconst dashboardURL = getIsSubscriber() === true ? subscriptionDashboardUrlPath : learnerDashboardUrlPath;\n\nconst app: App = {\n appId: 'org.openedx.frontend.app.learnerDashboard.header',\n slots: [\n {\n slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerConfirmEmail.v1',\n op: WidgetOperationTypes.PREPEND,\n component: ConfirmEmailBanner,\n condition: {\n callback: () => isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkPrograms.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('programs', eventNames.headerProgramsLinkClicked)}>\n <ProgramsLinkMenuItem variant=\"navLink\" />\n </div>\n ),\n condition: {\n callback: () =>\n getAppConfig(appId).ENABLE_PROGRAMS === true\n && isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkSupport.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('support', eventNames.headerSupportLinkClicked)}>\n <SupportLinkMenuItem variant=\"dropdownItem\" />\n </div>\n ),\n condition: {\n callback: () =>\n Boolean(getAppConfig(appId).SUPPORT_URL) && isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkOrderHistory.v1',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId:\n 'org.openedx.frontend.widget.header.desktopAuthenticatedMenuLogout.v1',\n element: (\n <div onClick={() => trackHeaderLinkClick('order-history', eventNames.headerOrderHistoryLinkClicked)}>\n <OrderHistoryLinkMenuItem variant=\"navLink\" />\n </div>\n ),\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',\n id: 'org.edx.frontend.widget.learnerHome.headerLinkSubscribe.v1',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId: 'org.edx.frontend.widget.learnerHome.headerLinkDashboard.v1',\n element: <SubscribeLink />,\n condition: {\n callback: () =>\n typeof window !== 'undefined'\n && (window.location.pathname.startsWith('/checkout') || window.location.pathname.startsWith('/aca-') || window.location.pathname.startsWith('/order-'))\n && getIsSubscriber() !== true,\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',\n id: 'org.edx.frontend.widget.learnerHome.headerLinkDashboard.v1',\n op: WidgetOperationTypes.PREPEND,\n element: (\n <div\n className=\"px-3 dashboard-header-navlink\"\n onClick={() => trackHeaderLinkClick(dashboardURL, eventNames.headerDashboardLinkClicked)}\n >\n <LinkMenuItem\n label={messages['header.user.menu.dashboard'].defaultMessage}\n url={dashboardURL}\n variant=\"hyperlink\"\n />\n </div>\n ),\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.edx.frontend.widget.learnerDashboard.headerAuthenticatedMenuSignOut.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('', eventNames.headerUserSignOut)}>\n <LinkMenuItem\n label={messages['header.user.menu.signOut'].defaultMessage}\n role={subscriptionSignoutRole}\n variant=\"dropdownItem\"\n />\n </div>\n ),\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.edx.frontend.widget.learnerDashboard.dashboard.v1',\n op: WidgetOperationTypes.PREPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick(dashboardURL, eventNames.headerDashboardLinkClicked)}>\n <LinkMenuItem\n label={messages['header.user.menu.dashboard'].defaultMessage}\n url={dashboardURL}\n variant=\"dropdownItem\"\n />\n </div>\n ),\n condition: {\n callback: () => isSubscriptionContext(),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',\n id: 'org.openedx.frontend.widget.header.desktopAuthenticatedMenu.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId:\n 'org.openedx.frontend.widget.header.desktopAuthenticatedMenu.v1',\n element: <CustomAvatarMenu />,\n condition: {\n authenticated: true,\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.mobileRight.v1',\n id: 'org.example.site.widget.header.mobileAuthenticatedMenu.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId:\n 'org.openedx.frontend.widget.header.mobileAuthenticatedMenu.v1',\n element: <CustomAvatarMenu />,\n condition: {\n authenticated: true,\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.desktopLeft.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.header.desktopLogo.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId: 'org.openedx.frontend.widget.header.desktopLogo.v1',\n element: <SiteLogo />,\n },\n {\n slotId: 'org.openedx.frontend.slot.header.mobileLeft.v1',\n id: 'org.example.site.widget.header.mobileLogoLeft.v1',\n op: WidgetOperationTypes.APPEND,\n element: <SiteLogo />,\n },\n {\n slotId: 'org.openedx.frontend.slot.header.mobileCenter.v1',\n id: 'org.example.site.widget.header.mobileLogoCenterReplace.v1',\n op: WidgetOperationTypes.REPLACE,\n relatedId: 'org.openedx.frontend.widget.header.mobileLogo.v1',\n element: <></>,\n },\n // {\n // // TO-DO : Resume your last course will be implemented seprately in a different ticket.(Ticket: SUBS-818)\n // // https://2u-internal.atlassian.net/browse/SUBS-818\n // slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n // id: 'org.openedx.frontend.widget.learnerDashboard.headerAuthenticatedMenuLastCourse.v1',\n // op: WidgetOperationTypes.PREPEND,\n // element: (\n // <LinkMenuItem\n // label={messages['header.user.menu.lastCourse'].defaultMessage}\n // url=\"/last-course\"\n // variant=\"dropdownItem\"\n // />\n // )\n // },\n ],\n};\n\nexport default app;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-learner-dashboard",
3
- "version": "1.78.0",
3
+ "version": "1.80.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",