@edx/frontend-plugin-learner-dashboard 3.3.2 → 3.3.3
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/no-courses-view/index.js +3 -2
- package/dist/no-courses-view/index.js.map +1 -1
- package/dist/tracking/trackers/exploreCourses.js +21 -18
- package/dist/tracking/trackers/exploreCourses.js.map +1 -1
- package/package.json +1 -1
- package/src/no-courses-view/index.jsx +4 -3
- package/src/tracking/trackers/exploreCourses.js +22 -18
|
@@ -26,11 +26,12 @@ const NoCoursesView = () => {
|
|
|
26
26
|
const {
|
|
27
27
|
courseSearchUrl
|
|
28
28
|
} = _hooks.reduxHooks.usePlatformSettingsData();
|
|
29
|
+
const viewCorrelationIdRef = (0, _react.useRef)(window.crypto.randomUUID());
|
|
29
30
|
const handleExploreCoursesViewed = (0, _react.useCallback)(() => {
|
|
30
|
-
(0, _exploreCourses.exploreCoursesViewedCohesion)();
|
|
31
|
+
(0, _exploreCourses.exploreCoursesViewedCohesion)(viewCorrelationIdRef.current);
|
|
31
32
|
}, []);
|
|
32
33
|
const handleExploreCoursesClick = () => {
|
|
33
|
-
(0, _exploreCourses.exploreCoursesClickedCohesion)();
|
|
34
|
+
(0, _exploreCourses.exploreCoursesClickedCohesion)(viewCorrelationIdRef.current);
|
|
34
35
|
};
|
|
35
36
|
(0, _react.useEffect)(() => {
|
|
36
37
|
handleExploreCoursesViewed();
|
|
@@ -1 +1 @@
|
|
|
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,I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EAAAN,CAAA,EAAAK,CAAA,IAAAC,CAAA,CAAAN,CAAA,IAAAH,CAAA,CAAAG,CAAA,WAAAM,CAAA,KAAAT,CAAA,EAAAG,CAAA;AAZtB;;AAcA,MAAMgB,aAAa,GAAGA,CAAA,KAAM;EAC1B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,aAAO,EAAC,CAAC;EACnC,MAAM;IAAEC;EAAgB,CAAC,GAAGC,iBAAU,CAACC,uBAAuB,CAAC,CAAC;
|
|
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","viewCorrelationIdRef","useRef","window","crypto","randomUUID","handleExploreCoursesViewed","useCallback","exploreCoursesViewedCohesion","current","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, useRef } 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 const viewCorrelationIdRef = useRef(window.crypto.randomUUID());\n\n const handleExploreCoursesViewed = useCallback(() => {\n exploreCoursesViewedCohesion(viewCorrelationIdRef.current);\n }, []);\n\n const handleExploreCoursesClick = () => {\n exploreCoursesClickedCohesion(viewCorrelationIdRef.current);\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,CAAAN,OAAA;AACAA,OAAA;AAAsB,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAM,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,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
|
|
5
5
|
});
|
|
6
6
|
exports.exploreCoursesViewedCohesion = exports.exploreCoursesClickedCohesion = void 0;
|
|
7
7
|
var _logging = require("@edx/frontend-platform/logging");
|
|
8
|
+
var _cookie = require("../cookie");
|
|
8
9
|
var _constants = require("../constants");
|
|
9
|
-
const exploreCoursesViewedCohesion =
|
|
10
|
+
const exploreCoursesViewedCohesion = viewCorrelationId => {
|
|
10
11
|
if (window.tagular && typeof window.tagular === 'function') {
|
|
11
12
|
window.tagular?.('beam', {
|
|
12
13
|
'@type': 'redventures.usertracking.v3.ElementViewed',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
viewCorrelationId,
|
|
15
|
+
webElement: {
|
|
16
|
+
elementType: _constants.BUTTON_ELEMENT_TYPE,
|
|
17
|
+
htmlId: _constants.EXPLORE_COURSES_HTML_ID,
|
|
18
|
+
location: _constants.LOCATION_LEARNER_HOME,
|
|
19
|
+
name: _constants.EXPLORE_COURSES_EVENT_NAME,
|
|
20
|
+
text: _constants.EXPLORE_COURSES_EVENT_TEXT,
|
|
21
|
+
position: '1'
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
} else {
|
|
@@ -25,18 +26,20 @@ const exploreCoursesViewedCohesion = () => {
|
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
exports.exploreCoursesViewedCohesion = exploreCoursesViewedCohesion;
|
|
28
|
-
const exploreCoursesClickedCohesion =
|
|
29
|
+
const exploreCoursesClickedCohesion = viewCorrelationId => {
|
|
30
|
+
const correlationId = (0, _cookie.handleCorrelationIDCookie)();
|
|
29
31
|
if (window.tagular && typeof window.tagular === 'function') {
|
|
30
32
|
window.tagular?.('beam', {
|
|
31
33
|
'@type': 'redventures.usertracking.v3.ElementClicked',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
correlationId,
|
|
35
|
+
viewCorrelationId,
|
|
36
|
+
webElement: {
|
|
37
|
+
elementType: _constants.BUTTON_ELEMENT_TYPE,
|
|
38
|
+
htmlId: _constants.EXPLORE_COURSES_HTML_ID,
|
|
39
|
+
location: _constants.LOCATION_LEARNER_HOME,
|
|
40
|
+
name: _constants.EXPLORE_COURSES_EVENT_NAME,
|
|
41
|
+
text: _constants.EXPLORE_COURSES_EVENT_TEXT,
|
|
42
|
+
position: '1'
|
|
40
43
|
}
|
|
41
44
|
});
|
|
42
45
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exploreCourses.js","names":["_logging","require","_constants","exploreCoursesViewedCohesion","
|
|
1
|
+
{"version":3,"file":"exploreCourses.js","names":["_logging","require","_cookie","_constants","exploreCoursesViewedCohesion","viewCorrelationId","window","tagular","webElement","elementType","BUTTON_ELEMENT_TYPE","htmlId","EXPLORE_COURSES_HTML_ID","location","LOCATION_LEARNER_HOME","name","EXPLORE_COURSES_EVENT_NAME","text","EXPLORE_COURSES_EVENT_TEXT","position","logError","exports","exploreCoursesClickedCohesion","correlationId","handleCorrelationIDCookie"],"sources":["../../../src/tracking/trackers/exploreCourses.js"],"sourcesContent":["import { logError } from '@edx/frontend-platform/logging';\nimport { handleCorrelationIDCookie } from '../cookie';\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 = (viewCorrelationId) => {\n if (window.tagular && typeof window.tagular === 'function') {\n window.tagular?.('beam', {\n '@type': 'redventures.usertracking.v3.ElementViewed',\n viewCorrelationId,\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 position: '1',\n },\n });\n } else {\n logError('Cohesion script failed to load before CTA was viewed');\n }\n};\n\nexport const exploreCoursesClickedCohesion = (viewCorrelationId) => {\n const correlationId = handleCorrelationIDCookie();\n\n if (window.tagular && typeof window.tagular === 'function') {\n window.tagular?.('beam', {\n '@type': 'redventures.usertracking.v3.ElementClicked',\n correlationId,\n viewCorrelationId,\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 position: '1',\n },\n });\n } else {\n logError('Cohesion script failed to load before CTA was clicked');\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAQO,MAAMG,4BAA4B,GAAIC,iBAAiB,IAAK;EACjE,IAAIC,MAAM,CAACC,OAAO,IAAI,OAAOD,MAAM,CAACC,OAAO,KAAK,UAAU,EAAE;IAC1DD,MAAM,CAACC,OAAO,GAAG,MAAM,EAAE;MACvB,OAAO,EAAE,2CAA2C;MACpDF,iBAAiB;MACjBG,UAAU,EAAE;QACVC,WAAW,EAAEC,8BAAmB;QAChCC,MAAM,EAAEC,kCAAuB;QAC/BC,QAAQ,EAAEC,gCAAqB;QAC/BC,IAAI,EAAEC,qCAA0B;QAChCC,IAAI,EAAEC,qCAA0B;QAChCC,QAAQ,EAAE;MACZ;IACF,CAAC,CAAC;EACJ,CAAC,MAAM;IACL,IAAAC,iBAAQ,EAAC,sDAAsD,CAAC;EAClE;AACF,CAAC;AAACC,OAAA,CAAAjB,4BAAA,GAAAA,4BAAA;AAEK,MAAMkB,6BAA6B,GAAIjB,iBAAiB,IAAK;EAClE,MAAMkB,aAAa,GAAG,IAAAC,iCAAyB,EAAC,CAAC;EAEjD,IAAIlB,MAAM,CAACC,OAAO,IAAI,OAAOD,MAAM,CAACC,OAAO,KAAK,UAAU,EAAE;IAC1DD,MAAM,CAACC,OAAO,GAAG,MAAM,EAAE;MACvB,OAAO,EAAE,4CAA4C;MACrDgB,aAAa;MACblB,iBAAiB;MACjBG,UAAU,EAAE;QACVC,WAAW,EAAEC,8BAAmB;QAChCC,MAAM,EAAEC,kCAAuB;QAC/BC,QAAQ,EAAEC,gCAAqB;QAC/BC,IAAI,EAAEC,qCAA0B;QAChCC,IAAI,EAAEC,qCAA0B;QAChCC,QAAQ,EAAE;MACZ;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,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-unresolved */
|
|
2
|
-
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { useIntl } from '@edx/frontend-platform/i18n';
|
|
4
4
|
import { Button, Image } from '@openedx/paragon';
|
|
5
5
|
import { Search } from '@openedx/paragon/icons';
|
|
@@ -15,13 +15,14 @@ import './index.scss';
|
|
|
15
15
|
const NoCoursesView = () => {
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
17
|
const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();
|
|
18
|
+
const viewCorrelationIdRef = useRef(window.crypto.randomUUID());
|
|
18
19
|
|
|
19
20
|
const handleExploreCoursesViewed = useCallback(() => {
|
|
20
|
-
exploreCoursesViewedCohesion();
|
|
21
|
+
exploreCoursesViewedCohesion(viewCorrelationIdRef.current);
|
|
21
22
|
}, []);
|
|
22
23
|
|
|
23
24
|
const handleExploreCoursesClick = () => {
|
|
24
|
-
exploreCoursesClickedCohesion();
|
|
25
|
+
exploreCoursesClickedCohesion(viewCorrelationIdRef.current);
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
useEffect(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { logError } from '@edx/frontend-platform/logging';
|
|
2
|
+
import { handleCorrelationIDCookie } from '../cookie';
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
BUTTON_ELEMENT_TYPE,
|
|
@@ -8,18 +9,18 @@ import {
|
|
|
8
9
|
EXPLORE_COURSES_EVENT_TEXT,
|
|
9
10
|
} from '../constants';
|
|
10
11
|
|
|
11
|
-
export const exploreCoursesViewedCohesion = () => {
|
|
12
|
+
export const exploreCoursesViewedCohesion = (viewCorrelationId) => {
|
|
12
13
|
if (window.tagular && typeof window.tagular === 'function') {
|
|
13
14
|
window.tagular?.('beam', {
|
|
14
15
|
'@type': 'redventures.usertracking.v3.ElementViewed',
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
viewCorrelationId,
|
|
17
|
+
webElement: {
|
|
18
|
+
elementType: BUTTON_ELEMENT_TYPE,
|
|
19
|
+
htmlId: EXPLORE_COURSES_HTML_ID,
|
|
20
|
+
location: LOCATION_LEARNER_HOME,
|
|
21
|
+
name: EXPLORE_COURSES_EVENT_NAME,
|
|
22
|
+
text: EXPLORE_COURSES_EVENT_TEXT,
|
|
23
|
+
position: '1',
|
|
23
24
|
},
|
|
24
25
|
});
|
|
25
26
|
} else {
|
|
@@ -27,18 +28,21 @@ export const exploreCoursesViewedCohesion = () => {
|
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
export const exploreCoursesClickedCohesion = () => {
|
|
31
|
+
export const exploreCoursesClickedCohesion = (viewCorrelationId) => {
|
|
32
|
+
const correlationId = handleCorrelationIDCookie();
|
|
33
|
+
|
|
31
34
|
if (window.tagular && typeof window.tagular === 'function') {
|
|
32
35
|
window.tagular?.('beam', {
|
|
33
36
|
'@type': 'redventures.usertracking.v3.ElementClicked',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
correlationId,
|
|
38
|
+
viewCorrelationId,
|
|
39
|
+
webElement: {
|
|
40
|
+
elementType: BUTTON_ELEMENT_TYPE,
|
|
41
|
+
htmlId: EXPLORE_COURSES_HTML_ID,
|
|
42
|
+
location: LOCATION_LEARNER_HOME,
|
|
43
|
+
name: EXPLORE_COURSES_EVENT_NAME,
|
|
44
|
+
text: EXPLORE_COURSES_EVENT_TEXT,
|
|
45
|
+
position: '1',
|
|
42
46
|
},
|
|
43
47
|
});
|
|
44
48
|
} else {
|