@edx/frontend-app-subscription-learner-dashboard 1.70.0 → 1.70.2

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/app.js CHANGED
@@ -11,7 +11,7 @@ const app = {
11
11
  LEARNING_BASE_URL: 'http://apps.local.openedx.io:2000',
12
12
  ENABLE_PROGRAMS: false,
13
13
  ECOMMERCE_BASE_URL: '',
14
- ORDER_HISTORY_URL: '',
14
+ ORDER_HISTORY_URL: 'https://learner-home.stage.edx.org/order-history',
15
15
  SUPPORT_URL: 'https://help.edx.org/edxlearner/s/?language=en_US',
16
16
  SHOW_UNENROLL_SURVEY: false,
17
17
  },
package/dist/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,SAAS;IACT,KAAK;IACL,MAAM,EAAE;QACN,iBAAiB,EAAE,mCAAmC;QACtD,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,EAAE;QACtB,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,mDAAmD;QAChE,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from './constants';\nimport routes from './routes';\nimport providers from './providers';\nimport slots from './slots';\n\nconst app: App = {\n appId,\n routes,\n providers,\n slots,\n config: {\n LEARNING_BASE_URL: 'http://apps.local.openedx.io:2000',\n ENABLE_PROGRAMS: false,\n ECOMMERCE_BASE_URL: '',\n ORDER_HISTORY_URL: '',\n SUPPORT_URL: 'https://help.edx.org/edxlearner/s/?language=en_US',\n SHOW_UNENROLL_SURVEY: false,\n },\n};\n\nexport default app;\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,SAAS;IACT,KAAK;IACL,MAAM,EAAE;QACN,iBAAiB,EAAE,mCAAmC;QACtD,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,EAAE;QACtB,iBAAiB,EAAE,kDAAkD;QACrE,WAAW,EAAE,mDAAmD;QAChE,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from './constants';\nimport routes from './routes';\nimport providers from './providers';\nimport slots from './slots';\n\nconst app: App = {\n appId,\n routes,\n providers,\n slots,\n config: {\n LEARNING_BASE_URL: 'http://apps.local.openedx.io:2000',\n ENABLE_PROGRAMS: false,\n ECOMMERCE_BASE_URL: '',\n ORDER_HISTORY_URL: 'https://learner-home.stage.edx.org/order-history',\n SUPPORT_URL: 'https://help.edx.org/edxlearner/s/?language=en_US',\n SHOW_UNENROLL_SURVEY: false,\n },\n};\n\nexport default app;\n"]}
@@ -15,3 +15,4 @@ export declare const subscriptionProgramProgressRole = "org.edx.frontend.subs.ro
15
15
  export declare const subscriptionDashboardUrlPath = "/subscription-learner-dashboard";
16
16
  export declare const SUBSCRIPTION_ROUTE_PREFIXES: string[];
17
17
  export declare const NON_SUBSCRIPTION_ROUTE_PREFIXES: string[];
18
+ export declare const learnerDashboardUrlPath = "/learner-dashboard";
package/dist/constants.js CHANGED
@@ -15,10 +15,11 @@ export const subscriptionDashboardUrlPath = '/subscription-learner-dashboard';
15
15
  export const SUBSCRIPTION_ROUTE_PREFIXES = [
16
16
  '/subscription-',
17
17
  '/checkout',
18
- '/manage-subscription',
18
+ '/order-history',
19
19
  ];
20
20
  export const NON_SUBSCRIPTION_ROUTE_PREFIXES = [
21
21
  '/learner-',
22
22
  '/aca-',
23
23
  ];
24
+ export const learnerDashboardUrlPath = '/learner-dashboard';
24
25
  //# 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,sBAAsB;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW;IACX,OAAO;CACR,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 '/manage-subscription',\n];\n\nexport const NON_SUBSCRIPTION_ROUTE_PREFIXES = [\n '/learner-',\n '/aca-',\n];\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,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW;IACX,OAAO;CACR,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];\n\nexport const learnerDashboardUrlPath = '/learner-dashboard';\n"]}
@@ -2,9 +2,9 @@ export const locationId: string;
2
2
  export const SortKeys: any;
3
3
  export const FilterKeys: any;
4
4
  export const ListPageSize: 6;
5
- export const subscriptionRenewalURL: "/manage-subscription";
5
+ export const subscriptionRenewalURL: "/order-history";
6
6
  export const exploreProgramsUrl: "/explore-programs";
7
- export const manageSubscriptionURL: "/manage-subscription";
7
+ export const manageSubscriptionURL: "/order-history";
8
8
  export const ProgramsListMobilePageSize: 4;
9
9
  export const ProgramPaginationListLabel: "Program List";
10
10
  export const searchPageUrl: "/subscription-search";
@@ -13,9 +13,9 @@ export const FilterKeys = StrictDict({
13
13
  });
14
14
  export const ListPageSize = 6;
15
15
  // TODO : Below URL is temporary and will be removed once the subscription renewal flow is implemented in the app.
16
- export const subscriptionRenewalURL = '/manage-subscription';
16
+ export const subscriptionRenewalURL = '/order-history';
17
17
  export const exploreProgramsUrl = '/explore-programs';
18
- export const manageSubscriptionURL = '/manage-subscription';
18
+ export const manageSubscriptionURL = '/order-history';
19
19
  export const ProgramsListMobilePageSize = 4;
20
20
  export const ProgramPaginationListLabel = 'Program List';
21
21
  export const searchPageUrl = '/subscription-search';
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/data/constants/app.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,kHAAkH;AAClH,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAC7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAC5D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC","sourcesContent":["import { StrictDict } from '../../utils';\nexport const locationId = window.location.pathname.slice(1);\n\nexport const SortKeys = StrictDict({\n enrolled: 'enrolled',\n title: 'title',\n});\n\nexport const FilterKeys = StrictDict({\n inProgress: 'inProgress',\n notStarted: 'notStarted',\n done: 'done',\n notEnrolled: 'notEnrolled',\n upgraded: 'upgraded',\n});\n\nexport const ListPageSize = 6;\n// TODO : Below URL is temporary and will be removed once the subscription renewal flow is implemented in the app.\nexport const subscriptionRenewalURL = '/manage-subscription';\nexport const exploreProgramsUrl = '/explore-programs';\nexport const manageSubscriptionURL = '/manage-subscription';\nexport const ProgramsListMobilePageSize = 4;\nexport const ProgramPaginationListLabel = 'Program List';\nexport const searchPageUrl = '/subscription-search';\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/data/constants/app.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,kHAAkH;AAClH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AACvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AACtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC","sourcesContent":["import { StrictDict } from '../../utils';\nexport const locationId = window.location.pathname.slice(1);\n\nexport const SortKeys = StrictDict({\n enrolled: 'enrolled',\n title: 'title',\n});\n\nexport const FilterKeys = StrictDict({\n inProgress: 'inProgress',\n notStarted: 'notStarted',\n done: 'done',\n notEnrolled: 'notEnrolled',\n upgraded: 'upgraded',\n});\n\nexport const ListPageSize = 6;\n// TODO : Below URL is temporary and will be removed once the subscription renewal flow is implemented in the app.\nexport const subscriptionRenewalURL = '/order-history';\nexport const exploreProgramsUrl = '/explore-programs';\nexport const manageSubscriptionURL = '/order-history';\nexport const ProgramsListMobilePageSize = 4;\nexport const ProgramPaginationListLabel = 'Program List';\nexport const searchPageUrl = '/subscription-search';\n"]}
@@ -57,7 +57,7 @@ export const eventNames = StrictDict({
57
57
  headerSupportLinkClicked: 'edx.bi.header.support_link.clicked',
58
58
  headerOrderHistoryLinkClicked: 'edx.bi.header.order_history_link.clicked',
59
59
  headerDashboardLinkClicked: 'edx.bi.header.dashboard_link.clicked',
60
- headerManageSubscriptionClicked: 'edx.bi.header.manage_subscription.clicked',
60
+ headerOrderHistoryClicked: 'edx.bi.header.order_history.clicked',
61
61
  headerUserSignOut: 'edx.bi.header.menu.sign_out.clicked',
62
62
  });
63
63
  export const linkNames = StrictDict({
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/tracking/constants.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,WAAW;IACtB,cAAc,EAAE,iBAAiB;IACjC,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;IAC/B,uBAAuB,EAAE,yBAAyB;IAClD,kBAAkB,EAAE,oBAAoB;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,4BAA4B,EAAE,8BAA8B;IAC5D,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,qBAAqB;IAC1C,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAChC,yBAAyB,EAAE,2BAA2B;IACtD,oBAAoB,EAAE,sBAAsB;IAC5C,qBAAqB,EAAE,uBAAuB;IAC9C,sBAAsB,EAAE,wBAAwB;IAChD,wBAAwB,EAAE,0BAA0B;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,uBAAuB,EAAE,uDAAuD;IAChF,kBAAkB,EAAE,iDAAiD;IACrE,kBAAkB,EAAE,iDAAiD;IACrE,4BAA4B,EAAE,4DAA4D;IAC1F,oBAAoB,EAAE,oDAAoD;IAC1E,qBAAqB,EAAE,qDAAqD;IAC5E,YAAY,EAAE,0BAA0B;IACxC,sBAAsB,EAAE,oDAAoD;IAC5E,mBAAmB,EAAE,2BAA2B;IAChD,UAAU,EAAE,8BAA8B;IAC1C,aAAa,EAAE,iCAAiC;IAChD,YAAY,EAAE,gCAAgC;IAC9C,cAAc,EAAE,8BAA8B;IAC9C,yBAAyB,EAAE,0CAA0C;IACrE,kBAAkB,EAAE,wDAAwD;IAC5E,cAAc,EAAE,oDAAoD;IACpE,aAAa,EAAE,iCAAiC;IAChD,oBAAoB,EAAE,yCAAyC;IAC/D,iBAAiB,EAAE,4BAA4B;IAC/C,uBAAuB,EAAE,mCAAmC;IAC5D,qBAAqB,EAAE,iCAAiC;IACxD,yBAAyB,EAAE,qCAAqC;IAChE,uBAAuB,EAAE,mCAAmC;IAC5D,wBAAwB,EAAE,wDAAwD;IAClF,iBAAiB,EAAE,4BAA4B;IAC/C,yBAAyB,EAAE,qCAAqC;IAChE,yBAAyB,EAAE,qCAAqC;IAChE,wBAAwB,EAAE,oCAAoC;IAC9D,wBAAwB,EAAE,oCAAoC;IAC9D,6BAA6B,EAAE,0CAA0C;IACzE,0BAA0B,EAAE,sCAAsC;IAClE,+BAA+B,EAAE,2CAA2C;IAC5E,iBAAiB,EAAE,qCAAqC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAClC,qBAAqB,EAAE,0BAA0B;IACjD,6BAA6B,EAAE,mCAAmC;CACnE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC;AAEtC,eAAe,UAAU,CAAC","sourcesContent":["import { StrictDict } from '../utils';\n\nexport const categories = StrictDict({\n dashboard: 'dashboard',\n userEngagement: 'user-engagement',\n searchButton: 'search_button',\n credit: 'credit',\n filter: 'filter',\n footer: 'footer',\n header: 'header',\n});\n\nexport const events = StrictDict({\n courseCardActionClicked: 'courseCardActionClicked',\n courseImageClicked: 'courseImageClicked',\n courseTitleClicked: 'courseTitleClicked',\n courseOptionsDropdownClicked: 'courseOptionsDropdownClicked',\n shareClicked: 'shareClicked',\n userSettingsChanged: 'userSettingsChanged',\n newSession: 'newSession',\n switchSession: 'switchSession',\n leaveSession: 'leaveSession',\n unenrollReason: 'unenrollReason',\n entitlementUnenrollReason: 'entitlementUnenrollReason',\n noCoursesViewClicked: 'noCoursesViewClicked',\n noProgramsViewClicked: 'noProgramsViewClicked',\n courseListPageSelected: 'courseListPageSelected',\n programCardActionClicked: 'programCardActionClicked',\n});\n\nexport const eventNames = StrictDict({\n courseCardActionClicked: 'edx.subscription.dashboard.course_card_action.clicked',\n courseImageClicked: 'edx.subscription.dashboard.course_image.clicked',\n courseTitleClicked: 'edx.subscription.dashboard.course_title.clicked',\n courseOptionsDropdownClicked: 'edx.subscription.dashboard.course_options_dropdown.clicked',\n noCoursesViewClicked: 'edx.subscription.dashboard.no_courses_view.clicked',\n noProgramsViewClicked: 'edx.subscription.dashboard.no_programs_view.clicked',\n shareClicked: 'edx.course.share_clicked',\n courseListPageSelected: 'edx.subscription.learner.course.list.page.selected',\n userSettingsChanged: 'edx.user.settings.changed',\n newSession: 'course-dashboard.new-session',\n switchSession: 'course-dashboard.switch-session',\n leaveSession: 'course-dashboard.leave-session',\n unenrollReason: 'unenrollment_reason.selected',\n entitlementUnenrollReason: 'entitlement_unenrollment_reason.selected',\n findCoursesClicked: 'edx.subscription.dashboard.find_courses_button.clicked',\n purchaseCredit: 'edx.subscription.dashboard.clicked_purchase_credit',\n filterClicked: 'course-dashboard.filter.clicked',\n filterOptionSelected: 'course-dashboard.filter_option.selected',\n footerLogoClicked: 'edx.bi.footer.logo.clicked',\n footerSocialLinkClicked: 'edx.bi.footer.social_link.clicked',\n footerEdxLinksClicked: 'edx.bi.footer.edx_links.clicked',\n footerConnectLinksClicked: 'edx.bi.footer.connect_links.clicked',\n footerLegalLinksClicked: 'edx.bi.footer.legal_links.clicked',\n programCardActionClicked: 'edx.subscription.dashboard.program_card_action.clicked',\n headerLogoClicked: 'edx.bi.header.logo.clicked',\n headerProgramsLinkClicked: 'edx.bi.header.programs_link.clicked',\n headerDiscoverLinkClicked: 'edx.bi.header.discover_link.clicked',\n headerCoursesLinkClicked: 'edx.bi.header.courses_link.clicked',\n headerSupportLinkClicked: 'edx.bi.header.support_link.clicked',\n headerOrderHistoryLinkClicked: 'edx.bi.header.order_history_link.clicked',\n headerDashboardLinkClicked: 'edx.bi.header.dashboard_link.clicked',\n headerManageSubscriptionClicked: 'edx.bi.header.manage_subscription.clicked',\n headerUserSignOut: 'edx.bi.header.menu.sign_out.clicked',\n});\n\nexport const linkNames = StrictDict({\n learnerHomeNavExplore: 'learner_home_nav_explore',\n learnerHomeNavDropdownExplore: 'learner_home_nav_dropdown_explore',\n});\n\nexport const appName = 'learner-home';\n\nexport default eventNames;\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/tracking/constants.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,WAAW;IACtB,cAAc,EAAE,iBAAiB;IACjC,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;IAC/B,uBAAuB,EAAE,yBAAyB;IAClD,kBAAkB,EAAE,oBAAoB;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,4BAA4B,EAAE,8BAA8B;IAC5D,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,qBAAqB;IAC1C,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAChC,yBAAyB,EAAE,2BAA2B;IACtD,oBAAoB,EAAE,sBAAsB;IAC5C,qBAAqB,EAAE,uBAAuB;IAC9C,s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AAM,OAAO,GAAG,cAAc,CAAC;AAEtC,eAAe,UAAU,CAAC","sourcesContent":["import { StrictDict } from '../utils';\n\nexport const categories = StrictDict({\n dashboard: 'dashboard',\n userEngagement: 'user-engagement',\n searchButton: 'search_button',\n credit: 'credit',\n filter: 'filter',\n footer: 'footer',\n header: 'header',\n});\n\nexport const events = StrictDict({\n courseCardActionClicked: 'courseCardActionClicked',\n courseImageClicked: 'courseImageClicked',\n courseTitleClicked: 'courseTitleClicked',\n courseOptionsDropdownClicked: 'courseOptionsDropdownClicked',\n shareClicked: 'shareClicked',\n userSettingsChanged: 'userSettingsChanged',\n newSession: 'newSession',\n switchSession: 'switchSession',\n leaveSession: 'leaveSession',\n unenrollReason: 'unenrollReason',\n entitlementUnenrollReason: 'entitlementUnenrollReason',\n noCoursesViewClicked: 'noCoursesViewClicked',\n noProgramsViewClicked: 'noProgramsViewClicked',\n courseListPageSelected: 'courseListPageSelected',\n programCardActionClicked: 'programCardActionClicked',\n});\n\nexport const eventNames = StrictDict({\n courseCardActionClicked: 'edx.subscription.dashboard.course_card_action.clicked',\n courseImageClicked: 'edx.subscription.dashboard.course_image.clicked',\n courseTitleClicked: 'edx.subscription.dashboard.course_title.clicked',\n courseOptionsDropdownClicked: 'edx.subscription.dashboard.course_options_dropdown.clicked',\n noCoursesViewClicked: 'edx.subscription.dashboard.no_courses_view.clicked',\n noProgramsViewClicked: 'edx.subscription.dashboard.no_programs_view.clicked',\n shareClicked: 'edx.course.share_clicked',\n courseListPageSelected: 'edx.subscription.learner.course.list.page.selected',\n userSettingsChanged: 'edx.user.settings.changed',\n newSession: 'course-dashboard.new-session',\n switchSession: 'course-dashboard.switch-session',\n leaveSession: 'course-dashboard.leave-session',\n unenrollReason: 'unenrollment_reason.selected',\n entitlementUnenrollReason: 'entitlement_unenrollment_reason.selected',\n findCoursesClicked: 'edx.subscription.dashboard.find_courses_button.clicked',\n purchaseCredit: 'edx.subscription.dashboard.clicked_purchase_credit',\n filterClicked: 'course-dashboard.filter.clicked',\n filterOptionSelected: 'course-dashboard.filter_option.selected',\n footerLogoClicked: 'edx.bi.footer.logo.clicked',\n footerSocialLinkClicked: 'edx.bi.footer.social_link.clicked',\n footerEdxLinksClicked: 'edx.bi.footer.edx_links.clicked',\n footerConnectLinksClicked: 'edx.bi.footer.connect_links.clicked',\n footerLegalLinksClicked: 'edx.bi.footer.legal_links.clicked',\n programCardActionClicked: 'edx.subscription.dashboard.program_card_action.clicked',\n headerLogoClicked: 'edx.bi.header.logo.clicked',\n headerProgramsLinkClicked: 'edx.bi.header.programs_link.clicked',\n headerDiscoverLinkClicked: 'edx.bi.header.discover_link.clicked',\n headerCoursesLinkClicked: 'edx.bi.header.courses_link.clicked',\n headerSupportLinkClicked: 'edx.bi.header.support_link.clicked',\n headerOrderHistoryLinkClicked: 'edx.bi.header.order_history_link.clicked',\n headerDashboardLinkClicked: 'edx.bi.header.dashboard_link.clicked',\n headerOrderHistoryClicked: 'edx.bi.header.order_history.clicked',\n headerUserSignOut: 'edx.bi.header.menu.sign_out.clicked',\n});\n\nexport const linkNames = StrictDict({\n learnerHomeNavExplore: 'learner_home_nav_explore',\n learnerHomeNavDropdownExplore: 'learner_home_nav_dropdown_explore',\n});\n\nexport const appName = 'learner-home';\n\nexport default eventNames;\n"]}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from 'react';
3
3
  import { LinkMenuItem, WidgetOperationTypes, getAppConfig, useSiteEvent, } from '@openedx/frontend-base';
4
- import { appId, subscriptionDashboardUrlPath, subscriptionSignoutRole, SUBSCRIPTION_ROUTE_PREFIXES, } from '../../constants';
4
+ import { appId, subscriptionDashboardUrlPath, subscriptionSignoutRole, SUBSCRIPTION_ROUTE_PREFIXES, learnerDashboardUrlPath, } from '../../constants';
5
5
  import { createEventTracker } from '../../data/services/segment/utils';
6
6
  import { categories, eventNames } from '../../tracking/constants';
7
7
  import { getCommonTrackingProps } from '../../tracking';
@@ -38,6 +38,7 @@ const SubscribeLink = () => {
38
38
  }
39
39
  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" }) }));
40
40
  };
41
+ const dashboardURL = getCommonTrackingProps().isSubscriber === true ? subscriptionDashboardUrlPath : learnerDashboardUrlPath;
41
42
  const app = {
42
43
  appId: 'org.openedx.frontend.app.learnerDashboard.header',
43
44
  slots: [
@@ -96,7 +97,7 @@ const app = {
96
97
  slotId: 'org.openedx.frontend.slot.header.desktopRight.v1',
97
98
  id: 'org.edx.frontend.widget.learnerHome.headerLinkDashboard.v1',
98
99
  op: WidgetOperationTypes.PREPEND,
99
- element: (_jsx("div", { className: "px-3 dashboard-header-navlink", onClick: () => trackHeaderLinkClick(subscriptionDashboardUrlPath, eventNames.headerDashboardLinkClicked), children: _jsx(LinkMenuItem, { label: messages['header.user.menu.dashboard'].defaultMessage, url: subscriptionDashboardUrlPath, variant: "hyperlink" }) })),
100
+ element: (_jsx("div", { className: "px-3 dashboard-header-navlink", onClick: () => trackHeaderLinkClick(dashboardURL, eventNames.headerDashboardLinkClicked), children: _jsx(LinkMenuItem, { label: messages['header.user.menu.dashboard'].defaultMessage, url: dashboardURL, variant: "hyperlink" }) })),
100
101
  condition: {
101
102
  callback: () => isSubscriptionContext() || (typeof window !== 'undefined' && window.location.pathname.startsWith('/aca-')),
102
103
  },
@@ -105,7 +106,7 @@ const app = {
105
106
  slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',
106
107
  id: 'org.edx.frontend.widget.header.user.menu.manageSubscription.v1',
107
108
  op: WidgetOperationTypes.APPEND,
108
- element: (_jsx("div", { onClick: () => trackHeaderLinkClick('/manage-subscription', eventNames.headerManageSubscriptionClicked), children: _jsx(LinkMenuItem, { label: messages['header.user.menu.manageSubscription'].defaultMessage, url: "/manage-subscription", variant: "dropdownItem" }) })),
109
+ element: (_jsx("div", { onClick: () => trackHeaderLinkClick('/order-history', eventNames.headerOrderHistoryClicked), children: _jsx(LinkMenuItem, { label: messages['header.user.menu.manageSubscription'].defaultMessage, url: "/order-history", variant: "dropdownItem" }) })),
109
110
  condition: {
110
111
  callback: () => isSubscriptionContext(),
111
112
  },
@@ -120,7 +121,7 @@ const app = {
120
121
  slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',
121
122
  id: 'org.edx.frontend.widget.learnerDashboard.dashboard.v1',
122
123
  op: WidgetOperationTypes.PREPEND,
123
- element: (_jsx("div", { onClick: () => trackHeaderLinkClick(subscriptionDashboardUrlPath, eventNames.headerDashboardLinkClicked), children: _jsx(LinkMenuItem, { label: messages['header.user.menu.dashboard'].defaultMessage, url: subscriptionDashboardUrlPath, variant: "dropdownItem" }) })),
124
+ element: (_jsx("div", { onClick: () => trackHeaderLinkClick(dashboardURL, eventNames.headerDashboardLinkClicked), children: _jsx(LinkMenuItem, { label: messages['header.user.menu.dashboard'].defaultMessage, url: dashboardURL, variant: "dropdownItem" }) })),
124
125
  condition: {
125
126
  callback: () => isSubscriptionContext(),
126
127
  },
@@ -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,GAC5B,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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AAE,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} 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 isSubscriptionContext = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n const pathname = window.location?.pathname || '';\n\n // Add/remove prefixes based on your actual subscription routes\n return SUBSCRIPTION_ROUTE_PREFIXES.some((prefix) =>\n pathname.startsWith(prefix),\n );\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 || getCommonTrackingProps().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 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-'))\n && getCommonTrackingProps().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(subscriptionDashboardUrlPath, eventNames.headerDashboardLinkClicked)}\n >\n <LinkMenuItem\n label={messages['header.user.menu.dashboard'].defaultMessage}\n url={subscriptionDashboardUrlPath}\n variant=\"hyperlink\"\n />\n </div>\n ),\n condition: {\n callback: () => isSubscriptionContext() || (typeof window !== 'undefined' && window.location.pathname.startsWith('/aca-')),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.edx.frontend.widget.header.user.menu.manageSubscription.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('/manage-subscription', eventNames.headerManageSubscriptionClicked)}>\n <LinkMenuItem\n label={messages['header.user.menu.manageSubscription'].defaultMessage}\n url=\"/manage-subscription\"\n variant=\"dropdownItem\"\n />\n </div>\n ),\n condition: {\n callback: () => isSubscriptionContext(),\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(subscriptionDashboardUrlPath, eventNames.headerDashboardLinkClicked)}>\n <LinkMenuItem\n label={messages['header.user.menu.dashboard'].defaultMessage}\n url={subscriptionDashboardUrlPath}\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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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 isSubscriptionContext = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n const pathname = window.location?.pathname || '';\n\n // Add/remove prefixes based on your actual subscription routes\n return SUBSCRIPTION_ROUTE_PREFIXES.some((prefix) =>\n pathname.startsWith(prefix),\n );\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 || getCommonTrackingProps().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 = getCommonTrackingProps().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-'))\n && getCommonTrackingProps().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 condition: {\n callback: () => isSubscriptionContext() || (typeof window !== 'undefined' && window.location.pathname.startsWith('/aca-')),\n },\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.edx.frontend.widget.header.user.menu.manageSubscription.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <div onClick={() => trackHeaderLinkClick('/order-history', eventNames.headerOrderHistoryClicked)}>\n <LinkMenuItem\n label={messages['header.user.menu.manageSubscription'].defaultMessage}\n url=\"/order-history\"\n variant=\"dropdownItem\"\n />\n </div>\n ),\n condition: {\n callback: () => isSubscriptionContext(),\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.70.0",
3
+ "version": "1.70.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",