@edx/frontend-plugin-learner-dashboard 3.3.0 → 3.3.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.
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _reactRouter = require("react-router");
9
8
  var _i18n = require("@edx/frontend-platform/i18n");
10
9
  var _paragon = require("@openedx/paragon");
11
10
  var _icons = require("@openedx/paragon/icons");
@@ -27,14 +26,11 @@ const NoCoursesView = () => {
27
26
  const {
28
27
  courseSearchUrl
29
28
  } = _hooks.reduxHooks.usePlatformSettingsData();
30
- const location = (0, _reactRouter.useLocation)();
31
- const fullUrl = (0, _urls.baseAppUrl)(location.pathname);
32
- const pageTitle = document.title;
33
29
  const handleExploreCoursesViewed = (0, _react.useCallback)(() => {
34
- (0, _exploreCourses.exploreCoursesViewedCohesion)(pageTitle, fullUrl);
35
- }, [pageTitle, fullUrl]);
30
+ (0, _exploreCourses.exploreCoursesViewedCohesion)();
31
+ }, []);
36
32
  const handleExploreCoursesClick = () => {
37
- (0, _exploreCourses.exploreCoursesClickedCohesion)(pageTitle, fullUrl);
33
+ (0, _exploreCourses.exploreCoursesClickedCohesion)();
38
34
  };
39
35
  (0, _react.useEffect)(() => {
40
36
  handleExploreCoursesViewed();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_reactRouter","_i18n","_paragon","_icons","_urls","_emptyCourse","_interopRequireDefault","_hooks","_exploreCourses","_messages","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NoCoursesView","formatMessage","useIntl","courseSearchUrl","reduxHooks","usePlatformSettingsData","location","useLocation","fullUrl","baseAppUrl","pathname","pageTitle","document","title","handleExploreCoursesViewed","useCallback","exploreCoursesViewedCohesion","handleExploreCoursesClick","exploreCoursesClickedCohesion","useEffect","jsxs","id","className","children","jsx","Image","src","emptyCourseSVG","alt","messages","bannerAlt","lookingForChallengePrompt","exploreCoursesPrompt","Button","variant","as","onClick","href","iconBefore","Search","exploreCoursesButton","_default","exports"],"sources":["../../src/no-courses-view/index.jsx"],"sourcesContent":["/* eslint-disable import/no-unresolved */\nimport React, { useCallback, useEffect } from 'react';\nimport { useLocation } from 'react-router';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport { Button, Image } from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\nimport { baseAppUrl } from 'data/services/lms/urls';\n\nimport emptyCourseSVG from 'assets/empty-course.svg';\nimport { reduxHooks } from 'hooks';\nimport { exploreCoursesViewedCohesion, exploreCoursesClickedCohesion } from '../tracking/trackers/exploreCourses';\n\nimport messages from './messages';\nimport './index.scss';\n\nconst NoCoursesView = () => {\n const { formatMessage } = useIntl();\n const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();\n const location = useLocation();\n const fullUrl = baseAppUrl(location.pathname);\n const pageTitle = document.title;\n\n const handleExploreCoursesViewed = useCallback(() => {\n exploreCoursesViewedCohesion(pageTitle, fullUrl);\n }, [pageTitle, fullUrl]);\n\n const handleExploreCoursesClick = () => {\n exploreCoursesClickedCohesion(pageTitle, fullUrl);\n };\n\n useEffect(() => {\n handleExploreCoursesViewed();\n }, [handleExploreCoursesViewed]);\n\n return (\n <div\n id=\"no-courses-content-view\"\n className=\"d-flex align-items-center justify-content-center mb-4.5\"\n >\n <Image src={emptyCourseSVG} alt={formatMessage(messages.bannerAlt)} />\n <h3 className=\"h1\">\n {formatMessage(messages.lookingForChallengePrompt)}\n </h3>\n <p>\n {formatMessage(messages.exploreCoursesPrompt)}\n </p>\n <Button\n variant=\"brand\"\n as=\"a\"\n onClick={handleExploreCoursesClick}\n href={baseAppUrl(courseSearchUrl)}\n iconBefore={Search}\n >\n {formatMessage(messages.exploreCoursesButton)}\n </Button>\n </div>\n );\n};\n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B,iBAAQ,CAACC,SAAS;IAAE,CAAE,CAAC,eACtE,IAAAlD,WAAA,CAAA4C,GAAA;MAAIF,SAAS,EAAC,IAAI;MAAAC,QAAA,EACftB,aAAa,CAAC4B,iBAAQ,CAACE,yBAAyB;IAAC,CAChD,CAAC,eACL,IAAAnD,WAAA,CAAA4C,GAAA;MAAAD,QAAA,EACGtB,aAAa,CAAC4B,iBAAQ,CAACG,oBAAoB;IAAC,CAC5C,CAAC,eACJ,IAAApD,WAAA,CAAA4C,GAAA,EAACpD,QAAA,CAAA6D,MAAM;MACLC,OAAO,EAAC,OAAO;MACfC,EAAE,EAAC,GAAG;MACNC,OAAO,EAAEnB,yBAA0B;MACnCoB,IAAI,EAAE,IAAA5B,gBAAU,EAACN,eAAe,CAAE;MAClCmC,UAAU,EAAEC,aAAO;MAAAhB,QAAA,EAElBtB,aAAa,CAAC4B,iBAAQ,CAACW,oBAAoB;IAAC,CACvC,CAAC;EAAA,CACN,CAAC;AAEV,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3D,OAAA,GAEaiB,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_i18n","_paragon","_icons","_urls","_emptyCourse","_interopRequireDefault","_hooks","_exploreCourses","_messages","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NoCoursesView","formatMessage","useIntl","courseSearchUrl","reduxHooks","usePlatformSettingsData","handleExploreCoursesViewed","useCallback","exploreCoursesViewedCohesion","handleExploreCoursesClick","exploreCoursesClickedCohesion","useEffect","jsxs","id","className","children","jsx","Image","src","emptyCourseSVG","alt","messages","bannerAlt","lookingForChallengePrompt","exploreCoursesPrompt","Button","variant","as","onClick","href","baseAppUrl","iconBefore","Search","exploreCoursesButton","_default","exports"],"sources":["../../src/no-courses-view/index.jsx"],"sourcesContent":["/* eslint-disable import/no-unresolved */\nimport React, { useCallback, useEffect } from 'react';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport { Button, Image } from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\nimport { baseAppUrl } from 'data/services/lms/urls';\n\nimport emptyCourseSVG from 'assets/empty-course.svg';\nimport { reduxHooks } from 'hooks';\nimport { exploreCoursesViewedCohesion, exploreCoursesClickedCohesion } from '../tracking/trackers/exploreCourses';\n\nimport messages from './messages';\nimport './index.scss';\n\nconst NoCoursesView = () => {\n const { formatMessage } = useIntl();\n const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();\n\n const handleExploreCoursesViewed = useCallback(() => {\n exploreCoursesViewedCohesion();\n }, []);\n\n const handleExploreCoursesClick = () => {\n exploreCoursesClickedCohesion();\n };\n\n useEffect(() => {\n handleExploreCoursesViewed();\n }, [handleExploreCoursesViewed]);\n\n return (\n <div\n id=\"no-courses-content-view\"\n className=\"d-flex align-items-center justify-content-center mb-4.5\"\n >\n <Image src={emptyCourseSVG} alt={formatMessage(messages.bannerAlt)} />\n <h3 className=\"h1\">\n {formatMessage(messages.lookingForChallengePrompt)}\n </h3>\n <p>\n {formatMessage(messages.exploreCoursesPrompt)}\n </p>\n <Button\n variant=\"brand\"\n as=\"a\"\n onClick={handleExploreCoursesClick}\n href={baseAppUrl(courseSearchUrl)}\n iconBefore={Search}\n >\n {formatMessage(messages.exploreCoursesButton)}\n </Button>\n </div>\n );\n};\n\nexport default NoCoursesView;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AAEA,IAAAS,SAAA,GAAAH,sBAAA,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IAAAC,QAAA,GAAAC,OAAA,CAAApD,OAAA,GAEaiB,aAAa","ignoreList":[]}
package/dist/package.json CHANGED
@@ -59,7 +59,6 @@
59
59
  "moment": "^2.30.1",
60
60
  "prop-types": "15.8.1",
61
61
  "react": "^18.3.1",
62
- "react-dom": "^18.3.1",
63
- "react-router": "^6.30.1"
62
+ "react-dom": "^18.3.1"
64
63
  }
65
64
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.eventNames = exports.categories = void 0;
6
+ exports.eventNames = exports.categories = exports.LOCATION_LEARNER_HOME = exports.EXPLORE_COURSES_HTML_ID = exports.EXPLORE_COURSES_EVENT_TEXT = exports.EXPLORE_COURSES_EVENT_NAME = exports.BUTTON_ELEMENT_TYPE = void 0;
7
7
  const learnerPortal = 'edx.ui.enterprise.lms.dashboard.learner_portal_modal';
8
8
  const eventNames = exports.eventNames = {
9
9
  dashboardModalOpened: `${learnerPortal}.opened`,
@@ -16,4 +16,11 @@ const eventNames = exports.eventNames = {
16
16
  const categories = exports.categories = {
17
17
  upgrade: 'upgrade'
18
18
  };
19
+
20
+ // Cohesion event properties
21
+ const BUTTON_ELEMENT_TYPE = exports.BUTTON_ELEMENT_TYPE = 'BUTTON';
22
+ const LOCATION_LEARNER_HOME = exports.LOCATION_LEARNER_HOME = 'learner-home-legacy';
23
+ const EXPLORE_COURSES_HTML_ID = exports.EXPLORE_COURSES_HTML_ID = 'explore-courses';
24
+ const EXPLORE_COURSES_EVENT_NAME = exports.EXPLORE_COURSES_EVENT_NAME = 'explore-courses-LD-cta';
25
+ const EXPLORE_COURSES_EVENT_TEXT = exports.EXPLORE_COURSES_EVENT_TEXT = 'Explore courses';
19
26
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["learnerPortal","eventNames","exports","dashboardModalOpened","dashboardModalCTAClicked","dashboardModalClosed","upgradeButtonClicked","upgradeButtonClickedEnrollment","upgradeButtonClickedUpsell","categories","upgrade"],"sources":["../../src/tracking/constants.js"],"sourcesContent":["const learnerPortal = 'edx.ui.enterprise.lms.dashboard.learner_portal_modal';\n\nexport const eventNames = {\n dashboardModalOpened: `${learnerPortal}.opened`,\n dashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`,\n dashboardModalClosed: `${learnerPortal}.closed`,\n upgradeButtonClicked: 'edx.bi.dashboard.upgrade_button.clicked',\n upgradeButtonClickedEnrollment: 'edx.course.enrollment.upgrade.clicked',\n upgradeButtonClickedUpsell: 'edx.bi.ecommerce.upsell_links_clicked',\n};\n\nexport const categories = {\n upgrade: 'upgrade',\n};\n"],"mappings":";;;;;;AAAA,MAAMA,aAAa,GAAG,sDAAsD;AAErE,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,oBAAoB,EAAE,GAAGH,aAAa,SAAS;EAC/CI,wBAAwB,EAAE,GAAGJ,aAAa,wBAAwB;EAClEK,oBAAoB,EAAE,GAAGL,aAAa,SAAS;EAC/CM,oBAAoB,EAAE,yCAAyC;EAC/DC,8BAA8B,EAAE,uCAAuC;EACvEC,0BAA0B,EAAE;AAC9B,CAAC;AAEM,MAAMC,UAAU,GAAAP,OAAA,CAAAO,UAAA,GAAG;EACxBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["learnerPortal","eventNames","exports","dashboardModalOpened","dashboardModalCTAClicked","dashboardModalClosed","upgradeButtonClicked","upgradeButtonClickedEnrollment","upgradeButtonClickedUpsell","categories","upgrade","BUTTON_ELEMENT_TYPE","LOCATION_LEARNER_HOME","EXPLORE_COURSES_HTML_ID","EXPLORE_COURSES_EVENT_NAME","EXPLORE_COURSES_EVENT_TEXT"],"sources":["../../src/tracking/constants.js"],"sourcesContent":["const learnerPortal = 'edx.ui.enterprise.lms.dashboard.learner_portal_modal';\n\nexport const eventNames = {\n dashboardModalOpened: `${learnerPortal}.opened`,\n dashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`,\n dashboardModalClosed: `${learnerPortal}.closed`,\n upgradeButtonClicked: 'edx.bi.dashboard.upgrade_button.clicked',\n upgradeButtonClickedEnrollment: 'edx.course.enrollment.upgrade.clicked',\n upgradeButtonClickedUpsell: 'edx.bi.ecommerce.upsell_links_clicked',\n};\n\nexport const categories = {\n upgrade: 'upgrade',\n};\n\n// Cohesion event properties\nexport const BUTTON_ELEMENT_TYPE = 'BUTTON';\nexport const LOCATION_LEARNER_HOME = 'learner-home-legacy';\nexport const EXPLORE_COURSES_HTML_ID = 'explore-courses';\nexport const EXPLORE_COURSES_EVENT_NAME = 'explore-courses-LD-cta';\nexport const EXPLORE_COURSES_EVENT_TEXT = 'Explore courses';\n"],"mappings":";;;;;;AAAA,MAAMA,aAAa,GAAG,sDAAsD;AAErE,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,oBAAoB,EAAE,GAAGH,aAAa,SAAS;EAC/CI,wBAAwB,EAAE,GAAGJ,aAAa,wBAAwB;EAClEK,oBAAoB,EAAE,GAAGL,aAAa,SAAS;EAC/CM,oBAAoB,EAAE,yCAAyC;EAC/DC,8BAA8B,EAAE,uCAAuC;EACvEC,0BAA0B,EAAE;AAC9B,CAAC;AAEM,MAAMC,UAAU,GAAAP,OAAA,CAAAO,UAAA,GAAG;EACxBC,OAAO,EAAE;AACX,CAAC;;AAED;AACO,MAAMC,mBAAmB,GAAAT,OAAA,CAAAS,mBAAA,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAAV,OAAA,CAAAU,qBAAA,GAAG,qBAAqB;AACnD,MAAMC,uBAAuB,GAAAX,OAAA,CAAAW,uBAAA,GAAG,iBAAiB;AACjD,MAAMC,0BAA0B,GAAAZ,OAAA,CAAAY,0BAAA,GAAG,wBAAwB;AAC3D,MAAMC,0BAA0B,GAAAb,OAAA,CAAAa,0BAAA,GAAG,iBAAiB","ignoreList":[]}
@@ -5,46 +5,37 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.exploreCoursesViewedCohesion = exports.exploreCoursesClickedCohesion = void 0;
7
7
  var _logging = require("@edx/frontend-platform/logging");
8
- const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {
8
+ var _constants = require("../constants");
9
+ const exploreCoursesViewedCohesion = () => {
9
10
  if (window.tagular && typeof window.tagular === 'function') {
10
11
  window.tagular?.('beam', {
11
12
  '@type': 'redventures.usertracking.v3.ElementViewed',
12
13
  metadata: {
13
- page: {
14
- title: pageTitle,
15
- url: fullUrl,
16
- pageType: 'Learner Home'
17
- },
18
14
  webElement: {
19
- elementType: 'BUTTON',
20
- htmlId: 'explore-courses',
21
- location: 'recommendation-panel-legacy',
22
- name: 'explore-courses-RD-cta',
23
- text: 'Explore courses'
15
+ elementType: _constants.BUTTON_ELEMENT_TYPE,
16
+ htmlId: _constants.EXPLORE_COURSES_HTML_ID,
17
+ location: _constants.LOCATION_LEARNER_HOME,
18
+ name: _constants.EXPLORE_COURSES_EVENT_NAME,
19
+ text: _constants.EXPLORE_COURSES_EVENT_TEXT
24
20
  }
25
21
  }
26
22
  });
27
23
  } else {
28
- (0, _logging.logError)('Cohesion script failed to load before CTA was shown');
24
+ (0, _logging.logError)('Cohesion script failed to load before CTA was viewed');
29
25
  }
30
26
  };
31
27
  exports.exploreCoursesViewedCohesion = exploreCoursesViewedCohesion;
32
- const exploreCoursesClickedCohesion = (pageTitle, fullUrl) => {
28
+ const exploreCoursesClickedCohesion = () => {
33
29
  if (window.tagular && typeof window.tagular === 'function') {
34
30
  window.tagular?.('beam', {
35
31
  '@type': 'redventures.usertracking.v3.ElementClicked',
36
32
  metadata: {
37
- page: {
38
- title: pageTitle,
39
- url: fullUrl,
40
- pageType: 'Learner Home'
41
- },
42
33
  webElement: {
43
- elementType: 'BUTTON',
44
- htmlId: 'explore-courses',
45
- location: 'recommendation-panel-legacy',
46
- name: 'explore-courses-RD-cta',
47
- text: 'Explore courses'
34
+ elementType: _constants.BUTTON_ELEMENT_TYPE,
35
+ htmlId: _constants.EXPLORE_COURSES_HTML_ID,
36
+ location: _constants.LOCATION_LEARNER_HOME,
37
+ name: _constants.EXPLORE_COURSES_EVENT_NAME,
38
+ text: _constants.EXPLORE_COURSES_EVENT_TEXT
48
39
  }
49
40
  }
50
41
  });
@@ -1 +1 @@
1
- {"version":3,"file":"exploreCourses.js","names":["_logging","require","exploreCoursesViewedCohesion","pageTitle","fullUrl","window","tagular","metadata","page","title","url","pageType","webElement","elementType","htmlId","location","name","text","logError","exports","exploreCoursesClickedCohesion"],"sources":["../../../src/tracking/trackers/exploreCourses.js"],"sourcesContent":["import { logError } from '@edx/frontend-platform/logging';\n\nexport const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {\n if (window.tagular && typeof window.tagular === 'function') {\n window.tagular?.('beam', {\n '@type': 'redventures.usertracking.v3.ElementViewed',\n metadata: {\n page: {\n title: pageTitle,\n url: fullUrl,\n pageType: 'Learner Home',\n },\n webElement: {\n elementType: 'BUTTON',\n htmlId: 'explore-courses',\n location: 'recommendation-panel-legacy',\n name: 'explore-courses-RD-cta',\n text: 'Explore courses',\n },\n },\n });\n } else {\n logError('Cohesion script failed to load before CTA was shown');\n }\n};\n\nexport const exploreCoursesClickedCohesion = (pageTitle, fullUrl) => {\n if (window.tagular && typeof window.tagular === 'function') {\n window.tagular?.('beam', {\n '@type': 'redventures.usertracking.v3.ElementClicked',\n metadata: {\n page: {\n title: pageTitle,\n url: fullUrl,\n pageType: 'Learner Home',\n },\n webElement: {\n elementType: 'BUTTON',\n htmlId: 'explore-courses',\n location: 'recommendation-panel-legacy',\n name: 'explore-courses-RD-cta',\n text: 'Explore courses',\n },\n },\n });\n } else {\n logError('Cohesion script failed to load before CTA was clicked');\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,4BAA4B,GAAGA,CAACC,SAAS,EAAEC,OAAO,KAAK;EAClE,IAAIC,MAAM,CAACC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ViewedCohesion","window","tagular","metadata","webElement","elementType","BUTTON_ELEMENT_TYPE","htmlId","EXPLORE_COURSES_HTML_ID","location","LOCATION_LEARNER_HOME","name","EXPLORE_COURSES_EVENT_NAME","text","EXPLORE_COURSES_EVENT_TEXT","logError","exports","exploreCoursesClickedCohesion"],"sources":["../../../src/tracking/trackers/exploreCourses.js"],"sourcesContent":["import { logError } from '@edx/frontend-platform/logging';\n\nimport {\n BUTTON_ELEMENT_TYPE,\n LOCATION_LEARNER_HOME,\n EXPLORE_COURSES_HTML_ID,\n EXPLORE_COURSES_EVENT_NAME,\n EXPLORE_COURSES_EVENT_TEXT,\n} from '../constants';\n\nexport const exploreCoursesViewedCohesion = () => {\n if (window.tagular && typeof window.tagular === 'function') {\n window.tagular?.('beam', {\n '@type': 'redventures.usertracking.v3.ElementViewed',\n metadata: {\n webElement: {\n elementType: BUTTON_ELEMENT_TYPE,\n htmlId: EXPLORE_COURSES_HTML_ID,\n location: LOCATION_LEARNER_HOME,\n name: EXPLORE_COURSES_EVENT_NAME,\n text: EXPLORE_COURSES_EVENT_TEXT,\n },\n },\n });\n } else {\n logError('Cohesion script failed to load before CTA was viewed');\n }\n};\n\nexport const exploreCoursesClickedCohesion = () => {\n if (window.tagular && typeof window.tagular === 'function') {\n window.tagular?.('beam', {\n '@type': 'redventures.usertracking.v3.ElementClicked',\n metadata: {\n webElement: {\n elementType: BUTTON_ELEMENT_TYPE,\n htmlId: EXPLORE_COURSES_HTML_ID,\n location: LOCATION_LEARNER_HOME,\n name: EXPLORE_COURSES_EVENT_NAME,\n text: EXPLORE_COURSES_EVENT_TEXT,\n },\n },\n });\n } else {\n logError('Cohesion script failed to load before CTA was clicked');\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAQO,MAAME,4BAA4B,GAAGA,CAAA,KAAM;EAChD,IAAIC,MAAM,CAACC,OAAO,IAAI,OAAOD,MAAM,CAACC,OAAO,KAAK,UAAU,EAAE;IAC1DD,MAAM,CAACC,OAAO,GAAG,MAAM,EAAE;MACvB,OAAO,EAAE,2CAA2C;MACpDC,QAAQ,EAAE;QACRC,UAAU,EAAE;UACVC,WAAW,EAAEC,8BAAmB;UAChCC,MAAM,EAAEC,kCAAuB;UAC/BC,QAAQ,EAAEC,gCAAqB;UAC/BC,IAAI,EAAEC,qCAA0B;UAChCC,IAAI,EAAEC;QACR;MACF;IACF,CAAC,CAAC;EACJ,CAAC,MAAM;IACL,IAAAC,iBAAQ,EAAC,sDAAsD,CAAC;EAClE;AACF,CAAC;AAACC,OAAA,CAAAhB,4BAAA,GAAAA,4BAAA;AAEK,MAAMiB,6BAA6B,GAAGA,CAAA,KAAM;EACjD,IAAIhB,MAAM,CAACC,OAAO,IAAI,OAAOD,MAAM,CAACC,OAAO,KAAK,UAAU,EAAE;IAC1DD,MAAM,CAACC,OAAO,GAAG,MAAM,EAAE;MACvB,OAAO,EAAE,4CAA4C;MACrDC,QAAQ,EAAE;QACRC,UAAU,EAAE;UACVC,WAAW,EAAEC,8BAAmB;UAChCC,MAAM,EAAEC,kCAAuB;UAC/BC,QAAQ,EAAEC,gCAAqB;UAC/BC,IAAI,EAAEC,qCAA0B;UAChCC,IAAI,EAAEC;QACR;MACF;IACF,CAAC,CAAC;EACJ,CAAC,MAAM;IACL,IAAAC,iBAAQ,EAAC,uDAAuD,CAAC;EACnE;AACF,CAAC;AAACC,OAAA,CAAAC,6BAAA,GAAAA,6BAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-plugin-learner-dashboard",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "Repository for Learner Dashboard MFE frontend plugins",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -59,7 +59,6 @@
59
59
  "moment": "^2.30.1",
60
60
  "prop-types": "15.8.1",
61
61
  "react": "^18.3.1",
62
- "react-dom": "^18.3.1",
63
- "react-router": "^6.30.1"
62
+ "react-dom": "^18.3.1"
64
63
  }
65
64
  }
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable import/no-unresolved */
2
2
  import React, { useCallback, useEffect } from 'react';
3
- import { useLocation } from 'react-router';
4
3
  import { useIntl } from '@edx/frontend-platform/i18n';
5
4
  import { Button, Image } from '@openedx/paragon';
6
5
  import { Search } from '@openedx/paragon/icons';
@@ -16,16 +15,13 @@ import './index.scss';
16
15
  const NoCoursesView = () => {
17
16
  const { formatMessage } = useIntl();
18
17
  const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();
19
- const location = useLocation();
20
- const fullUrl = baseAppUrl(location.pathname);
21
- const pageTitle = document.title;
22
18
 
23
19
  const handleExploreCoursesViewed = useCallback(() => {
24
- exploreCoursesViewedCohesion(pageTitle, fullUrl);
25
- }, [pageTitle, fullUrl]);
20
+ exploreCoursesViewedCohesion();
21
+ }, []);
26
22
 
27
23
  const handleExploreCoursesClick = () => {
28
- exploreCoursesClickedCohesion(pageTitle, fullUrl);
24
+ exploreCoursesClickedCohesion();
29
25
  };
30
26
 
31
27
  useEffect(() => {
@@ -8,12 +8,6 @@ import { exploreCoursesViewedCohesion, exploreCoursesClickedCohesion } from '../
8
8
 
9
9
  const courseSearchUrl = '/course-search-url';
10
10
 
11
- jest.mock('react-router', () => ({
12
- useLocation: jest.fn(() => ({
13
- pathname: 'mock-pathname',
14
- })),
15
- }));
16
-
17
11
  jest.mock('hooks', () => ({
18
12
  reduxHooks: {
19
13
  usePlatformSettingsData: jest.fn(() => ({
@@ -12,3 +12,10 @@ export const eventNames = {
12
12
  export const categories = {
13
13
  upgrade: 'upgrade',
14
14
  };
15
+
16
+ // Cohesion event properties
17
+ export const BUTTON_ELEMENT_TYPE = 'BUTTON';
18
+ export const LOCATION_LEARNER_HOME = 'learner-home-legacy';
19
+ export const EXPLORE_COURSES_HTML_ID = 'explore-courses';
20
+ export const EXPLORE_COURSES_EVENT_NAME = 'explore-courses-LD-cta';
21
+ export const EXPLORE_COURSES_EVENT_TEXT = 'Explore courses';
@@ -1,45 +1,43 @@
1
1
  import { logError } from '@edx/frontend-platform/logging';
2
2
 
3
- export const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {
3
+ import {
4
+ BUTTON_ELEMENT_TYPE,
5
+ LOCATION_LEARNER_HOME,
6
+ EXPLORE_COURSES_HTML_ID,
7
+ EXPLORE_COURSES_EVENT_NAME,
8
+ EXPLORE_COURSES_EVENT_TEXT,
9
+ } from '../constants';
10
+
11
+ export const exploreCoursesViewedCohesion = () => {
4
12
  if (window.tagular && typeof window.tagular === 'function') {
5
13
  window.tagular?.('beam', {
6
14
  '@type': 'redventures.usertracking.v3.ElementViewed',
7
15
  metadata: {
8
- page: {
9
- title: pageTitle,
10
- url: fullUrl,
11
- pageType: 'Learner Home',
12
- },
13
16
  webElement: {
14
- elementType: 'BUTTON',
15
- htmlId: 'explore-courses',
16
- location: 'recommendation-panel-legacy',
17
- name: 'explore-courses-RD-cta',
18
- text: 'Explore courses',
17
+ elementType: BUTTON_ELEMENT_TYPE,
18
+ htmlId: EXPLORE_COURSES_HTML_ID,
19
+ location: LOCATION_LEARNER_HOME,
20
+ name: EXPLORE_COURSES_EVENT_NAME,
21
+ text: EXPLORE_COURSES_EVENT_TEXT,
19
22
  },
20
23
  },
21
24
  });
22
25
  } else {
23
- logError('Cohesion script failed to load before CTA was shown');
26
+ logError('Cohesion script failed to load before CTA was viewed');
24
27
  }
25
28
  };
26
29
 
27
- export const exploreCoursesClickedCohesion = (pageTitle, fullUrl) => {
30
+ export const exploreCoursesClickedCohesion = () => {
28
31
  if (window.tagular && typeof window.tagular === 'function') {
29
32
  window.tagular?.('beam', {
30
33
  '@type': 'redventures.usertracking.v3.ElementClicked',
31
34
  metadata: {
32
- page: {
33
- title: pageTitle,
34
- url: fullUrl,
35
- pageType: 'Learner Home',
36
- },
37
35
  webElement: {
38
- elementType: 'BUTTON',
39
- htmlId: 'explore-courses',
40
- location: 'recommendation-panel-legacy',
41
- name: 'explore-courses-RD-cta',
42
- text: 'Explore courses',
36
+ elementType: BUTTON_ELEMENT_TYPE,
37
+ htmlId: EXPLORE_COURSES_HTML_ID,
38
+ location: LOCATION_LEARNER_HOME,
39
+ name: EXPLORE_COURSES_EVENT_NAME,
40
+ text: EXPLORE_COURSES_EVENT_TEXT,
43
41
  },
44
42
  },
45
43
  });