@edx/frontend-plugin-learner-dashboard 3.3.0 → 3.3.1

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.
@@ -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.LEARNER_HOME_PAGE_TYPE = 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,12 @@ const eventNames = exports.eventNames = {
16
16
  const categories = exports.categories = {
17
17
  upgrade: 'upgrade'
18
18
  };
19
+
20
+ // Cohesion event properties
21
+ const LEARNER_HOME_PAGE_TYPE = exports.LEARNER_HOME_PAGE_TYPE = 'Learner Home';
22
+ const BUTTON_ELEMENT_TYPE = exports.BUTTON_ELEMENT_TYPE = 'BUTTON';
23
+ const LOCATION_LEARNER_HOME = exports.LOCATION_LEARNER_HOME = 'learner-home-legacy';
24
+ const EXPLORE_COURSES_HTML_ID = exports.EXPLORE_COURSES_HTML_ID = 'explore-courses';
25
+ const EXPLORE_COURSES_EVENT_NAME = exports.EXPLORE_COURSES_EVENT_NAME = 'explore-courses-LD-cta';
26
+ const EXPLORE_COURSES_EVENT_TEXT = exports.EXPLORE_COURSES_EVENT_TEXT = 'Explore courses';
19
27
  //# 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","LEARNER_HOME_PAGE_TYPE","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 LEARNER_HOME_PAGE_TYPE = 'Learner Home';\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,sBAAsB,GAAAT,OAAA,CAAAS,sBAAA,GAAG,cAAc;AAC7C,MAAMC,mBAAmB,GAAAV,OAAA,CAAAU,mBAAA,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAAX,OAAA,CAAAW,qBAAA,GAAG,qBAAqB;AACnD,MAAMC,uBAAuB,GAAAZ,OAAA,CAAAY,uBAAA,GAAG,iBAAiB;AACjD,MAAMC,0BAA0B,GAAAb,OAAA,CAAAa,0BAAA,GAAG,wBAAwB;AAC3D,MAAMC,0BAA0B,GAAAd,OAAA,CAAAc,0BAAA,GAAG,iBAAiB","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.exploreCoursesViewedCohesion = exports.exploreCoursesClickedCohesion = void 0;
7
7
  var _logging = require("@edx/frontend-platform/logging");
8
+ var _constants = require("../constants");
8
9
  const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {
9
10
  if (window.tagular && typeof window.tagular === 'function') {
10
11
  window.tagular?.('beam', {
@@ -13,19 +14,19 @@ const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {
13
14
  page: {
14
15
  title: pageTitle,
15
16
  url: fullUrl,
16
- pageType: 'Learner Home'
17
+ pageType: _constants.LEARNER_HOME_PAGE_TYPE
17
18
  },
18
19
  webElement: {
19
- elementType: 'BUTTON',
20
- htmlId: 'explore-courses',
21
- location: 'recommendation-panel-legacy',
22
- name: 'explore-courses-RD-cta',
23
- text: 'Explore courses'
20
+ elementType: _constants.BUTTON_ELEMENT_TYPE,
21
+ htmlId: _constants.EXPLORE_COURSES_HTML_ID,
22
+ location: _constants.LOCATION_LEARNER_HOME,
23
+ name: _constants.EXPLORE_COURSES_EVENT_NAME,
24
+ text: _constants.EXPLORE_COURSES_EVENT_TEXT
24
25
  }
25
26
  }
26
27
  });
27
28
  } else {
28
- (0, _logging.logError)('Cohesion script failed to load before CTA was shown');
29
+ (0, _logging.logError)('Cohesion script failed to load before CTA was viewed');
29
30
  }
30
31
  };
31
32
  exports.exploreCoursesViewedCohesion = exploreCoursesViewedCohesion;
@@ -37,14 +38,14 @@ const exploreCoursesClickedCohesion = (pageTitle, fullUrl) => {
37
38
  page: {
38
39
  title: pageTitle,
39
40
  url: fullUrl,
40
- pageType: 'Learner Home'
41
+ pageType: _constants.LEARNER_HOME_PAGE_TYPE
41
42
  },
42
43
  webElement: {
43
- elementType: 'BUTTON',
44
- htmlId: 'explore-courses',
45
- location: 'recommendation-panel-legacy',
46
- name: 'explore-courses-RD-cta',
47
- text: 'Explore courses'
44
+ elementType: _constants.BUTTON_ELEMENT_TYPE,
45
+ htmlId: _constants.EXPLORE_COURSES_HTML_ID,
46
+ location: _constants.LOCATION_LEARNER_HOME,
47
+ name: _constants.EXPLORE_COURSES_EVENT_NAME,
48
+ text: _constants.EXPLORE_COURSES_EVENT_TEXT
48
49
  }
49
50
  }
50
51
  });
@@ -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,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]}
1
+ {"version":3,"file":"exploreCourses.js","names":["_logging","require","_constants","exploreCoursesViewedCohesion","pageTitle","fullUrl","window","tagular","metadata","page","title","url","pageType","LEARNER_HOME_PAGE_TYPE","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 LEARNER_HOME_PAGE_TYPE,\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 = (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_PAGE_TYPE,\n },\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 = (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_PAGE_TYPE,\n },\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;AASO,MAAME,4BAA4B,GAAGA,CAACC,SAAS,EAAEC,OAAO,KAAK;EAClE,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,IAAI,EAAE;UACJC,KAAK,EAAEN,SAAS;UAChBO,GAAG,EAAEN,OAAO;UACZO,QAAQ,EAAEC;QACZ,CAAC;QACDC,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,CAAAvB,4BAAA,GAAAA,4BAAA;AAEK,MAAMwB,6BAA6B,GAAGA,CAACvB,SAAS,EAAEC,OAAO,KAAK;EACnE,IAAIC,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,IAAI,EAAE;UACJC,KAAK,EAAEN,SAAS;UAChBO,GAAG,EAAEN,OAAO;UACZO,QAAQ,EAAEC;QACZ,CAAC;QACDC,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.1",
4
4
  "description": "Repository for Learner Dashboard MFE frontend plugins",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -12,3 +12,11 @@ export const eventNames = {
12
12
  export const categories = {
13
13
  upgrade: 'upgrade',
14
14
  };
15
+
16
+ // Cohesion event properties
17
+ export const LEARNER_HOME_PAGE_TYPE = 'Learner Home';
18
+ export const BUTTON_ELEMENT_TYPE = 'BUTTON';
19
+ export const LOCATION_LEARNER_HOME = 'learner-home-legacy';
20
+ export const EXPLORE_COURSES_HTML_ID = 'explore-courses';
21
+ export const EXPLORE_COURSES_EVENT_NAME = 'explore-courses-LD-cta';
22
+ export const EXPLORE_COURSES_EVENT_TEXT = 'Explore courses';
@@ -1,5 +1,14 @@
1
1
  import { logError } from '@edx/frontend-platform/logging';
2
2
 
3
+ import {
4
+ LEARNER_HOME_PAGE_TYPE,
5
+ BUTTON_ELEMENT_TYPE,
6
+ LOCATION_LEARNER_HOME,
7
+ EXPLORE_COURSES_HTML_ID,
8
+ EXPLORE_COURSES_EVENT_NAME,
9
+ EXPLORE_COURSES_EVENT_TEXT,
10
+ } from '../constants';
11
+
3
12
  export const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {
4
13
  if (window.tagular && typeof window.tagular === 'function') {
5
14
  window.tagular?.('beam', {
@@ -8,19 +17,19 @@ export const exploreCoursesViewedCohesion = (pageTitle, fullUrl) => {
8
17
  page: {
9
18
  title: pageTitle,
10
19
  url: fullUrl,
11
- pageType: 'Learner Home',
20
+ pageType: LEARNER_HOME_PAGE_TYPE,
12
21
  },
13
22
  webElement: {
14
- elementType: 'BUTTON',
15
- htmlId: 'explore-courses',
16
- location: 'recommendation-panel-legacy',
17
- name: 'explore-courses-RD-cta',
18
- text: 'Explore courses',
23
+ elementType: BUTTON_ELEMENT_TYPE,
24
+ htmlId: EXPLORE_COURSES_HTML_ID,
25
+ location: LOCATION_LEARNER_HOME,
26
+ name: EXPLORE_COURSES_EVENT_NAME,
27
+ text: EXPLORE_COURSES_EVENT_TEXT,
19
28
  },
20
29
  },
21
30
  });
22
31
  } else {
23
- logError('Cohesion script failed to load before CTA was shown');
32
+ logError('Cohesion script failed to load before CTA was viewed');
24
33
  }
25
34
  };
26
35
 
@@ -32,14 +41,14 @@ export const exploreCoursesClickedCohesion = (pageTitle, fullUrl) => {
32
41
  page: {
33
42
  title: pageTitle,
34
43
  url: fullUrl,
35
- pageType: 'Learner Home',
44
+ pageType: LEARNER_HOME_PAGE_TYPE,
36
45
  },
37
46
  webElement: {
38
- elementType: 'BUTTON',
39
- htmlId: 'explore-courses',
40
- location: 'recommendation-panel-legacy',
41
- name: 'explore-courses-RD-cta',
42
- text: 'Explore courses',
47
+ elementType: BUTTON_ELEMENT_TYPE,
48
+ htmlId: EXPLORE_COURSES_HTML_ID,
49
+ location: LOCATION_LEARNER_HOME,
50
+ name: EXPLORE_COURSES_EVENT_NAME,
51
+ text: EXPLORE_COURSES_EVENT_TEXT,
43
52
  },
44
53
  },
45
54
  });