@edx/frontend-app-subscription-learner-dashboard 1.77.0 → 1.79.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"]}
@@ -1,43 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState, useCallback } from 'react';
3
3
  import { Hyperlink, Image } from '@openedx/paragon';
4
- import { getAuthenticatedHttpClient, getSiteConfig, useSiteEvent } from '@openedx/frontend-base';
4
+ import { getSiteConfig, useSiteEvent } from '@openedx/frontend-base';
5
5
  import { useLocation } from 'react-router-dom';
6
6
  import { NON_SUBSCRIPTION_ROUTE_PREFIXES } from '../../constants';
7
- import { getSubsInitApiUrl } from '../../data/services/subs/urls';
8
7
  import edxPlus from '../../assets/edxPlus.svg';
9
8
  import { createEventTracker } from '../../data/services/segment/utils';
10
9
  import eventNames, { categories } from '../../tracking/constants';
11
- import { getCommonTrackingProps, mapSubsInitToTrackingProps, setCommonTrackingProps } from '../../tracking';
10
+ import { getCommonTrackingProps } from '../../tracking';
12
11
  import edXLogo from '../../assets/edXLogo.png';
13
12
  const CHECKOUT_PAYMENT_STATE_CHANGED = 'org.openedx.frontend.event.subscriptionCheckout.paymentStateChanged.v1';
14
13
  const SiteLogo = () => {
15
14
  const siteConfig = getSiteConfig();
16
15
  const { pathname } = useLocation();
16
+ const getIsSubscriber = () => {
17
+ var _a;
18
+ return (_a = window.__EDX_IS_SUBSCRIBER__) !== null && _a !== void 0 ? _a : getCommonTrackingProps().isSubscriber;
19
+ };
17
20
  const [isPaid, setIsPaid] = useState(false);
18
- const [isSubscriber, setIsSubscriber] = useState(getCommonTrackingProps().isSubscriber);
19
- // Loaders only populate tracking props on subscription routes, so the shared header fetches them.
21
+ const [isSubscriber, setIsSubscriber] = useState(getIsSubscriber());
20
22
  useEffect(() => {
21
- if (isSubscriber !== undefined) {
22
- return undefined;
23
- }
24
- let active = true;
25
- getAuthenticatedHttpClient().get(getSubsInitApiUrl())
26
- .then(({ data }) => {
27
- var _a;
28
- if (!active)
29
- return;
30
- setCommonTrackingProps(mapSubsInitToTrackingProps(data));
31
- setIsSubscriber(((_a = data === null || data === void 0 ? void 0 : data.userSubscription) === null || _a === void 0 ? void 0 : _a.isSubscriber) === true);
32
- })
33
- .catch(() => {
34
- if (active)
35
- setIsSubscriber(false);
36
- });
37
- return () => {
38
- active = false;
39
- };
40
- }, [isSubscriber]);
23
+ setIsSubscriber(getIsSubscriber());
24
+ }, [pathname]);
41
25
  const handlePaymentStateChanged = useCallback((_topic, data) => {
42
26
  setIsPaid((data === null || data === void 0 ? void 0 : data.isPaid) === true);
43
27
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"SiteLogo.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/SiteLogo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,UAAU,EAAE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,KAAK,EAAC,oBAAoB,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAI,EAE9E,KAAC,KAAK,IAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAI,IACrE,GACA,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FC, useEffect, useState, useCallback } from 'react';\nimport { Hyperlink, Image } from '@openedx/paragon';\nimport { getAuthenticatedHttpClient, getSiteConfig, useSiteEvent } from '@openedx/frontend-base';\nimport { useLocation } from 'react-router-dom';\nimport { NON_SUBSCRIPTION_ROUTE_PREFIXES } from '@src/constants';\nimport { getSubsInitApiUrl } from '@src/data/services/subs/urls';\n\nimport edxPlus from '../../assets/edxPlus.svg';\nimport { createEventTracker } from '@src/data/services/segment/utils';\nimport eventNames, { categories } from '@src/tracking/constants';\nimport { getCommonTrackingProps, mapSubsInitToTrackingProps, setCommonTrackingProps } from '@src/tracking';\nimport edXLogo from '../../assets/edXLogo.png';\n\nconst CHECKOUT_PAYMENT_STATE_CHANGED = 'org.openedx.frontend.event.subscriptionCheckout.paymentStateChanged.v1';\n\nconst SiteLogo: FC = () => {\n const siteConfig = getSiteConfig();\n\n const { pathname } = useLocation();\n const [isPaid, setIsPaid] = useState(false);\n const [isSubscriber, setIsSubscriber] = useState<boolean | undefined>(getCommonTrackingProps().isSubscriber);\n\n // Loaders only populate tracking props on subscription routes, so the shared header fetches them.\n useEffect(() => {\n if (isSubscriber !== undefined) {\n return undefined;\n }\n let active = true;\n getAuthenticatedHttpClient().get(getSubsInitApiUrl())\n .then(({ data }) => {\n if (!active) return;\n setCommonTrackingProps(mapSubsInitToTrackingProps(data));\n setIsSubscriber(data?.userSubscription?.isSubscriber === true);\n })\n .catch(() => {\n if (active) setIsSubscriber(false);\n });\n return () => {\n active = false;\n };\n }, [isSubscriber]);\n\n const handlePaymentStateChanged = useCallback(\n (_topic: string, data?: { isPaid: boolean }) => {\n setIsPaid(data?.isPaid === true);\n }, []);\n\n useSiteEvent(CHECKOUT_PAYMENT_STATE_CHANGED, handlePaymentStateChanged);\n\n const dest = isSubscriber ? `${siteConfig?.baseUrl}/subscription-learner-dashboard` : `${siteConfig?.baseUrl}/learner-dashboard`;\n\n const handleLogoClick = () => {\n createEventTracker(\n eventNames.headerLogoClicked,\n { category: categories.header, label: dest }\n )();\n };\n\n const isCheckout = pathname.startsWith('/checkout');\n const isNonSubscriptionRoute = NON_SUBSCRIPTION_ROUTE_PREFIXES.some(prefix => pathname.startsWith(prefix));\n const showEdxLogo\n = !isSubscriber\n && !(isCheckout && isPaid)\n && (isCheckout || isNonSubscriptionRoute);\n\n return (\n <Hyperlink destination={dest} className=\"p-0\" onClick={handleLogoClick}>\n <picture className=\"site-logo\">\n {/* Desktop: adjust min-width values to your breakpoints */}\n <source media=\"(min-width: 1024px)\" srcSet={showEdxLogo ? edXLogo : edxPlus} />\n <source media=\"(min-width: 768px)\" srcSet={showEdxLogo ? edXLogo : edxPlus} />\n {/* fallback/mobile */}\n <Image src={showEdxLogo ? edXLogo : edxPlus} style={{ maxHeight: '2rem' }} />\n </picture>\n </Hyperlink>\n );\n};\n\nexport default SiteLogo;\n"]}
1
+ {"version":3,"file":"SiteLogo.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/SiteLogo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,+BAA+B,EAAE,MAAM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SiteConfig, useSiteEvent } from '@openedx/frontend-base';\nimport { useLocation } from 'react-router-dom';\nimport { NON_SUBSCRIPTION_ROUTE_PREFIXES } from '@src/constants';\n\nimport edxPlus from '../../assets/edxPlus.svg';\nimport { createEventTracker } from '@src/data/services/segment/utils';\nimport eventNames, { categories } from '@src/tracking/constants';\nimport { getCommonTrackingProps } from '@src/tracking';\nimport edXLogo from '../../assets/edXLogo.png';\n\nconst CHECKOUT_PAYMENT_STATE_CHANGED = 'org.openedx.frontend.event.subscriptionCheckout.paymentStateChanged.v1';\n\nconst SiteLogo: FC = () => {\n const siteConfig = getSiteConfig();\n\n const { pathname } = useLocation();\n\n const getIsSubscriber = () =>\n (window as Window & { __EDX_IS_SUBSCRIBER__?: boolean }).__EDX_IS_SUBSCRIBER__\n ?? getCommonTrackingProps().isSubscriber;\n\n const [isPaid, setIsPaid] = useState(false);\n const [isSubscriber, setIsSubscriber] = useState<boolean | undefined>(getIsSubscriber());\n\n useEffect(() => {\n setIsSubscriber(getIsSubscriber());\n }, [pathname]);\n\n const handlePaymentStateChanged = useCallback(\n (_topic: string, data?: { isPaid: boolean }) => {\n setIsPaid(data?.isPaid === true);\n }, []);\n\n useSiteEvent(CHECKOUT_PAYMENT_STATE_CHANGED, handlePaymentStateChanged);\n\n const dest = isSubscriber ? `${siteConfig?.baseUrl}/subscription-learner-dashboard` : `${siteConfig?.baseUrl}/learner-dashboard`;\n\n const handleLogoClick = () => {\n createEventTracker(\n eventNames.headerLogoClicked,\n { category: categories.header, label: dest }\n )();\n };\n\n const isCheckout = pathname.startsWith('/checkout');\n const isNonSubscriptionRoute = NON_SUBSCRIPTION_ROUTE_PREFIXES.some(prefix => pathname.startsWith(prefix));\n const showEdxLogo\n = !isSubscriber\n && !(isCheckout && isPaid)\n && (isCheckout || isNonSubscriptionRoute);\n\n return (\n <Hyperlink destination={dest} className=\"p-0\" onClick={handleLogoClick}>\n <picture className=\"site-logo\">\n {/* Desktop: adjust min-width values to your breakpoints */}\n <source media=\"(min-width: 1024px)\" srcSet={showEdxLogo ? edXLogo : edxPlus} />\n <source media=\"(min-width: 768px)\" srcSet={showEdxLogo ? edXLogo : edxPlus} />\n {/* fallback/mobile */}\n <Image src={showEdxLogo ? edXLogo : edxPlus} style={{ maxHeight: '2rem' }} />\n </picture>\n </Hyperlink>\n );\n};\n\nexport default SiteLogo;\n"]}
@@ -1,4 +1,3 @@
1
- var _a;
2
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
2
  import { useCallback, useState } from 'react';
4
3
  import { LinkMenuItem, WidgetOperationTypes, getAppConfig, useSiteEvent, } from '@openedx/frontend-base';
@@ -16,14 +15,19 @@ import SiteLogo from './SiteLogo';
16
15
  const trackHeaderLinkClick = (url, eventName) => {
17
16
  createEventTracker(eventName, { category: categories.header, label: url })();
18
17
  };
19
- const isSubscriber = (_a = window.__EDX_IS_SUBSCRIBER__) !== null && _a !== void 0 ? _a : getCommonTrackingProps().isSubscriber;
18
+ const getIsSubscriber = () => {
19
+ var _a;
20
+ return (_a = (typeof window !== 'undefined'
21
+ ? window.__EDX_IS_SUBSCRIBER__
22
+ : undefined)) !== null && _a !== void 0 ? _a : getCommonTrackingProps().isSubscriber;
23
+ };
20
24
  const isSubscriptionContext = () => {
21
25
  var _a;
22
26
  if (typeof window === 'undefined') {
23
27
  return false;
24
28
  }
25
29
  const pathname = ((_a = window.location) === null || _a === void 0 ? void 0 : _a.pathname) || '';
26
- return isSubscriber === true
30
+ return getIsSubscriber() === true
27
31
  && SUBSCRIPTION_ROUTE_PREFIXES.some(prefix => pathname.startsWith(prefix));
28
32
  };
29
33
  const SubscribeLink = () => {
@@ -35,12 +39,12 @@ const SubscribeLink = () => {
35
39
  }
36
40
  }, []);
37
41
  useSiteEvent('org.openedx.frontend.event.subscriptionCheckout.paymentStateChanged.v1', handlePaymentStateChanged);
38
- if (isPaid || isSubscriber === true) {
42
+ if (isPaid || getIsSubscriber() === true) {
39
43
  return null;
40
44
  }
41
45
  return (_jsx("div", { className: "d-inline-flex align-items-center text-warning text-decoration-none subscribe-header-navlink px-3", children: _jsx(LinkMenuItem, { label: messages['header.user.menu.subscribe'].defaultMessage, url: "/checkout", variant: "hyperlink" }) }));
42
46
  };
43
- const dashboardURL = isSubscriber === true ? subscriptionDashboardUrlPath : learnerDashboardUrlPath;
47
+ const dashboardURL = getIsSubscriber() === true ? subscriptionDashboardUrlPath : learnerDashboardUrlPath;
44
48
  const app = {
45
49
  appId: 'org.openedx.frontend.app.learnerDashboard.header',
46
50
  slots: [
@@ -92,7 +96,7 @@ const app = {
92
96
  condition: {
93
97
  callback: () => typeof window !== 'undefined'
94
98
  && (window.location.pathname.startsWith('/checkout') || window.location.pathname.startsWith('/aca-') || window.location.pathname.startsWith('/order-'))
95
- && isSubscriber !== true,
99
+ && getIsSubscriber() !== true,
96
100
  },
97
101
  },
98
102
  {
@@ -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,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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O,EAAE,KAAC,gBAAgB,KAAG;YAC7B,SAAS,EAAE;gBACT,aAAa,EAAE,IAAI;aACpB;SACF;QACD;YACE,MAAM,EAAE,iDAAiD;YACzD,EAAE,EAAE,2DAA2D;YAC/D,EAAE,EAAE,oBAAoB,CAAC,OAAO;YAChC,SAAS,EACP,+DAA+D;YACjE,OAAO,EAAE,KAAC,gBAAgB,KAAG;YAC7B,SAAS,EAAE;gBACT,aAAa,EAAE,IAAI;aACpB;SACF;QACD;YACE,MAAM,EAAE,iDAAiD;YACzD,EAAE,EAAE,oEAAoE;YACxE,EAAE,EAAE,oBAAoB,CAAC,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 isSubscriber\n = (window as Window & { __EDX_IS_SUBSCRIBER__?: boolean }).__EDX_IS_SUBSCRIBER__\n ?? getCommonTrackingProps().isSubscriber;\n\nconst isSubscriptionContext = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n const pathname = window.location?.pathname || '';\n\n return isSubscriber === 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 || isSubscriber === 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 = isSubscriber === 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 && isSubscriber !== 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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D;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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-learner-dashboard",
3
- "version": "1.77.0",
3
+ "version": "1.79.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",