@edx/frontend-app-learner-dashboard 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/widgets/LearnerDashboardPlugins/app.js +70 -0
- package/dist/widgets/LearnerDashboardPlugins/app.js.map +1 -1
- package/dist/widgets/LearnerDashboardPlugins/career-menu/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/career-menu/index.js +22 -0
- package/dist/widgets/LearnerDashboardPlugins/career-menu/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/career-menu/messages.d.ts +16 -0
- package/dist/widgets/LearnerDashboardPlugins/career-menu/messages.js +15 -0
- package/dist/widgets/LearnerDashboardPlugins/career-menu/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/HelpChatbot.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/HelpChatbot.js +25 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/HelpChatbot.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/data/five9.d.ts +3 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/data/five9.js +5 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/data/five9.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/index.js +3 -0
- package/dist/widgets/LearnerDashboardPlugins/chatbot/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/cohesion-wrapper/CohesionWrapper.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/cohesion-wrapper/CohesionWrapper.js +33 -0
- package/dist/widgets/LearnerDashboardPlugins/cohesion-wrapper/CohesionWrapper.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/cohesion-wrapper/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/cohesion-wrapper/index.js +3 -0
- package/dist/widgets/LearnerDashboardPlugins/cohesion-wrapper/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/Banner.d.ts +24 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/Banner.js +19 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/Banner.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/CourseBanner.d.ts +10 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/CourseBanner.js +31 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/CourseBanner.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/formatDate.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/formatDate.js +13 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/formatDate.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/index.js +3 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/messages.d.ts +56 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/messages.js +40 -0
- package/dist/widgets/LearnerDashboardPlugins/course-banner/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-menu/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-menu/index.js +23 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-menu/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-menu/messages.d.ts +24 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-menu/messages.js +20 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-menu/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModal.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModal.js +20 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModal.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModalWrapper.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModalWrapper.js +17 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModalWrapper.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/hooks/hooks.d.ts +10 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/hooks/hooks.js +34 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/hooks/hooks.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/index.js +3 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/messages.d.ts +32 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/messages.js +25 -0
- package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/mocks/optimizely/index.d.ts +10 -0
- package/dist/widgets/LearnerDashboardPlugins/mocks/optimizely/index.js +10 -0
- package/dist/widgets/LearnerDashboardPlugins/mocks/optimizely/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/index.js +37 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/index.scss +13 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/messages.d.ts +32 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/messages.js +25 -0
- package/dist/widgets/LearnerDashboardPlugins/no-courses-view/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/api.d.ts +9 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/api.js +32 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/api.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/hooks.d.ts +4 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/hooks.js +32 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/hooks.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/index.d.ts +8 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/index.js +14 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/messages.d.ts +8 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/messages.js +10 -0
- package/dist/widgets/LearnerDashboardPlugins/notices-redirect/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingEntry.d.ts +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingEntry.js +23 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingEntry.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingModal.d.ts +14 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingModal.js +51 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingModal.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/api/service.d.ts +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/api/service.js +35 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/api/service.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/data/progressiveProfilingFields.d.ts +22 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/data/progressiveProfilingFields.js +33 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/data/progressiveProfilingFields.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/field-renderer/FieldRenderer.d.ts +21 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/field-renderer/FieldRenderer.js +29 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/field-renderer/FieldRenderer.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/field-renderer/index.d.ts +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/field-renderer/index.js +2 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/field-renderer/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.d.ts +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.js +10 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.d.ts +11 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.js +50 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.d.ts +3 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.js +8 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/index.js +3 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfiling.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfiling.js +82 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfiling.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfilingPageModal.d.ts +13 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfilingPageModal.js +26 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfilingPageModal.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/LargeLayout.d.ts +19 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/LargeLayout.js +34 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/LargeLayout.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/MediumLayout.d.ts +19 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/MediumLayout.js +35 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/MediumLayout.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/SmallLayout.d.ts +19 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/SmallLayout.js +36 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/SmallLayout.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/index.d.ts +3 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/index.js +4 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/messages.d.ts +33 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/messages.js +35 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/index.d.ts +20 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/index.js +24 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.d.ts +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.js +2 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.scss +269 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/messages.d.ts +58 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/messages.js +62 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/messages.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/service/getThirdPartyAuthContext.d.ts +5 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/service/getThirdPartyAuthContext.js +31 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/progressive-profiling-authn-replica/service/getThirdPartyAuthContext.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/utils/constants.d.ts +5 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/utils/constants.js +6 -0
- package/dist/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/utils/constants.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/enterpriseDashboardModal.d.ts +9 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/enterpriseDashboardModal.js +29 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/enterpriseDashboardModal.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/exploreCourses.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/exploreCourses.js +46 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/exploreCourses.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/progressiveProfiling.d.ts +14 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/progressiveProfiling.js +24 -0
- package/dist/widgets/LearnerDashboardPlugins/tracking/trackers/progressiveProfiling.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/ucl-wrapper/UclWrapper.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/ucl-wrapper/UclWrapper.js +36 -0
- package/dist/widgets/LearnerDashboardPlugins/ucl-wrapper/UclWrapper.js.map +1 -0
- package/dist/widgets/LearnerDashboardPlugins/ucl-wrapper/index.d.ts +2 -0
- package/dist/widgets/LearnerDashboardPlugins/ucl-wrapper/index.js +3 -0
- package/dist/widgets/LearnerDashboardPlugins/ucl-wrapper/index.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default messages;
|
|
2
|
+
declare namespace messages {
|
|
3
|
+
namespace dashboard {
|
|
4
|
+
let id: string;
|
|
5
|
+
let defaultMessage: string;
|
|
6
|
+
let description: string;
|
|
7
|
+
}
|
|
8
|
+
namespace dashboardPersonal {
|
|
9
|
+
let id_1: string;
|
|
10
|
+
export { id_1 as id };
|
|
11
|
+
let defaultMessage_1: string;
|
|
12
|
+
export { defaultMessage_1 as defaultMessage };
|
|
13
|
+
let description_1: string;
|
|
14
|
+
export { description_1 as description };
|
|
15
|
+
}
|
|
16
|
+
namespace dashboardSwitch {
|
|
17
|
+
let id_2: string;
|
|
18
|
+
export { id_2 as id };
|
|
19
|
+
let defaultMessage_2: string;
|
|
20
|
+
export { defaultMessage_2 as defaultMessage };
|
|
21
|
+
let description_2: string;
|
|
22
|
+
export { description_2 as description };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
dashboard: {
|
|
4
|
+
id: 'learnerVariantDashboard.menu.dashboard.label',
|
|
5
|
+
defaultMessage: 'Dashboard',
|
|
6
|
+
description: 'The text for the user menu Dashboard navigation link.',
|
|
7
|
+
},
|
|
8
|
+
dashboardPersonal: {
|
|
9
|
+
id: 'learnerVariantDashboard.menu.dashboardPersonal.label',
|
|
10
|
+
defaultMessage: 'Personal',
|
|
11
|
+
description: 'Link to personal dashboard in user menu',
|
|
12
|
+
},
|
|
13
|
+
dashboardSwitch: {
|
|
14
|
+
id: 'learnerVariantDashboard.menu.dashboardSwitch.label',
|
|
15
|
+
defaultMessage: 'SWITCH DASHBOARD',
|
|
16
|
+
description: 'Switch Dashboard header in the user menu',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default messages;
|
|
20
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/dashboard-menu/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,uDAAuD;KACrE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,yCAAyC;KACvD;IACD,eAAe,EAAE;QACf,EAAE,EAAE,oDAAoD;QACxD,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,0CAA0C;KACxD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n dashboard: {\n id: 'learnerVariantDashboard.menu.dashboard.label',\n defaultMessage: 'Dashboard',\n description: 'The text for the user menu Dashboard navigation link.',\n },\n dashboardPersonal: {\n id: 'learnerVariantDashboard.menu.dashboardPersonal.label',\n defaultMessage: 'Personal',\n description: 'Link to personal dashboard in user menu',\n },\n dashboardSwitch: {\n id: 'learnerVariantDashboard.menu.dashboardSwitch.label',\n defaultMessage: 'SWITCH DASHBOARD',\n description: 'Switch Dashboard header in the user menu',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { ActionRow, AlertModal, Button } from '@openedx/paragon';
|
|
5
|
+
import messages from './messages';
|
|
6
|
+
import { useEnterpriseDashboardModal } from './hooks/hooks';
|
|
7
|
+
export const EnterpriseDashboardModal = () => {
|
|
8
|
+
const { formatMessage } = useIntl();
|
|
9
|
+
const { showModal, handleClose, handleCTAClick, dashboard, } = useEnterpriseDashboardModal();
|
|
10
|
+
if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.label)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return (_jsx(AlertModal, { title: formatMessage(messages.enterpriseDialogHeader, {
|
|
14
|
+
label: dashboard.label,
|
|
15
|
+
}), isBlocking: true, isOpen: showModal, hasCloseButton: false, footerNode: (_jsxs(ActionRow, { children: [_jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage(messages.enterpriseDialogDismissButton) }), _jsx(Button, { href: dashboard.url, onClick: handleCTAClick, children: formatMessage(messages.enterpriseDialogConfirmButton) })] })), children: formatMessage(messages.enterpriseDialogBody, {
|
|
16
|
+
label: dashboard.label,
|
|
17
|
+
}) }));
|
|
18
|
+
};
|
|
19
|
+
export default EnterpriseDashboardModal;
|
|
20
|
+
//# sourceMappingURL=EnterpriseDashboardModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnterpriseDashboardModal.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModal.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EACJ,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,GAClD,GAAG,2BAA2B,EAAE,CAAC;IAClC,IAAI,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAA,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,sBAAsB,EAAE;YACpD,KAAK,EAAE,SAAS,CAAC,KAAK;SACvB,CAAC,EACF,UAAU,QACV,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,KAAK,EACrB,UAAU,EAAE,CACV,MAAC,SAAS,eACR,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,WAAW,YAC5C,aAAa,CAAC,QAAQ,CAAC,6BAA6B,CAAC,GAC/C,EACT,KAAC,MAAM,IAAC,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,cAAc,YACjD,aAAa,CAAC,QAAQ,CAAC,6BAA6B,CAAC,GAC/C,IACC,CACb,YAEA,aAAa,CAAC,QAAQ,CAAC,oBAAoB,EAAE;YAC5C,KAAK,EAAE,SAAS,CAAC,KAAK;SACvB,CAAC,GACS,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import React from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { ActionRow, AlertModal, Button } from '@openedx/paragon';\n\nimport messages from './messages';\nimport { useEnterpriseDashboardModal } from './hooks/hooks';\n\nexport const EnterpriseDashboardModal = () => {\n const { formatMessage } = useIntl();\n const {\n showModal, handleClose, handleCTAClick, dashboard,\n } = useEnterpriseDashboardModal();\n if (!dashboard?.label) {\n return null;\n }\n return (\n <AlertModal\n title={formatMessage(messages.enterpriseDialogHeader, {\n label: dashboard.label,\n })}\n isBlocking\n isOpen={showModal}\n hasCloseButton={false}\n footerNode={(\n <ActionRow>\n <Button variant=\"tertiary\" onClick={handleClose}>\n {formatMessage(messages.enterpriseDialogDismissButton)}\n </Button>\n <Button href={dashboard.url} onClick={handleCTAClick}>\n {formatMessage(messages.enterpriseDialogConfirmButton)}\n </Button>\n </ActionRow>\n )}\n >\n {formatMessage(messages.enterpriseDialogBody, {\n label: dashboard.label,\n })}\n </AlertModal>\n );\n};\n\nexport default EnterpriseDashboardModal;\n"]}
|
package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModalWrapper.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useInitializeLearnerHome } from '../../../data/hooks';
|
|
4
|
+
import { EnterpriseDashboardModal } from './EnterpriseDashboardModal';
|
|
5
|
+
const EnterpriseDashboardModalWrapper = () => {
|
|
6
|
+
var _a;
|
|
7
|
+
const { data } = useInitializeLearnerHome();
|
|
8
|
+
const hasAvailableDashboards = typeof (data === null || data === void 0 ? void 0 : data.hasAvailableDashboards) === 'boolean'
|
|
9
|
+
? data.hasAvailableDashboards
|
|
10
|
+
: ((_a = data === null || data === void 0 ? void 0 : data.enterpriseDashboard) === null || _a === void 0 ? void 0 : _a.isLearnerPortalEnabled) === true;
|
|
11
|
+
if (hasAvailableDashboards) {
|
|
12
|
+
return _jsx(EnterpriseDashboardModal, {});
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
};
|
|
16
|
+
export default EnterpriseDashboardModalWrapper;
|
|
17
|
+
//# sourceMappingURL=EnterpriseDashboardModalWrapper.js.map
|
package/dist/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModalWrapper.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnterpriseDashboardModalWrapper.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/dashboard-modal/EnterpriseDashboardModalWrapper.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,+BAA+B,GAAG,GAAG,EAAE;;IAC3C,MAAM,EAAE,IAAI,EAAE,GAAG,wBAAwB,EAAE,CAAC;IAC5C,MAAM,sBAAsB,GAAG,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,sBAAsB,CAAA,KAAK,SAAS;QAC9E,CAAC,CAAC,IAAI,CAAC,sBAAsB;QAC7B,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,mBAAmB,0CAAE,sBAAsB,MAAK,IAAI,CAAC;IAE/D,IAAI,sBAAsB,EAAE,CAAC;QAC3B,OAAO,KAAC,wBAAwB,KAAG,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["import React from 'react';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport { EnterpriseDashboardModal } from './EnterpriseDashboardModal';\n\nconst EnterpriseDashboardModalWrapper = () => {\n const { data } = useInitializeLearnerHome();\n const hasAvailableDashboards = typeof data?.hasAvailableDashboards === 'boolean'\n ? data.hasAvailableDashboards\n : data?.enterpriseDashboard?.isLearnerPortalEnabled === true;\n\n if (hasAvailableDashboards) {\n return <EnterpriseDashboardModal />;\n }\n return null;\n};\n\nexport default EnterpriseDashboardModalWrapper;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export namespace state {
|
|
2
|
+
function showModal(val: any): [any, React.Dispatch<any>];
|
|
3
|
+
}
|
|
4
|
+
export function useEnterpriseDashboardModal(): {
|
|
5
|
+
showModal: any;
|
|
6
|
+
handleCTAClick: func;
|
|
7
|
+
handleClose: () => void;
|
|
8
|
+
dashboard: any;
|
|
9
|
+
};
|
|
10
|
+
import React from 'react';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useInitializeLearnerHome } from '../../../../data/hooks';
|
|
3
|
+
import { modalOpened, modalCTAClicked, modalClosed } from '../../tracking/trackers/enterpriseDashboardModal';
|
|
4
|
+
export const state = {
|
|
5
|
+
showModal: (val) => React.useState(val), // eslint-disable-line
|
|
6
|
+
};
|
|
7
|
+
export const useEnterpriseDashboardModal = () => {
|
|
8
|
+
var _a;
|
|
9
|
+
const { data } = useInitializeLearnerHome();
|
|
10
|
+
const hasAvailableDashboards = typeof (data === null || data === void 0 ? void 0 : data.hasAvailableDashboards) === 'boolean'
|
|
11
|
+
? data.hasAvailableDashboards
|
|
12
|
+
: ((_a = data === null || data === void 0 ? void 0 : data.enterpriseDashboard) === null || _a === void 0 ? void 0 : _a.isLearnerPortalEnabled) === true;
|
|
13
|
+
const [showModal, setShowModal] = state.showModal(hasAvailableDashboards);
|
|
14
|
+
const dashboard = (data === null || data === void 0 ? void 0 : data.enterpriseDashboard) || {};
|
|
15
|
+
const trackOpened = modalOpened(dashboard.enterpriseUUID);
|
|
16
|
+
const trackClose = modalClosed(dashboard.enterpriseUUID, 'Cancel button');
|
|
17
|
+
const handleCTAClick = modalCTAClicked(dashboard.enterpriseUUID, dashboard.url);
|
|
18
|
+
const handleClose = () => {
|
|
19
|
+
trackClose();
|
|
20
|
+
setShowModal(false);
|
|
21
|
+
};
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (dashboard === null || dashboard === void 0 ? void 0 : dashboard.label) {
|
|
24
|
+
trackOpened();
|
|
25
|
+
}
|
|
26
|
+
}, []); // eslint-disable-line
|
|
27
|
+
return {
|
|
28
|
+
showModal,
|
|
29
|
+
handleCTAClick,
|
|
30
|
+
handleClose,
|
|
31
|
+
dashboard,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../../src/widgets/LearnerDashboardPlugins/dashboard-modal/hooks/hooks.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE7G,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,sBAAsB;CAChE,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;;IAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,wBAAwB,EAAE,CAAC;IAC5C,MAAM,sBAAsB,GAAG,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,sBAAsB,CAAA,KAAK,SAAS;QAC9E,CAAC,CAAC,IAAI,CAAC,sBAAsB;QAC7B,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,mBAAmB,0CAAE,sBAAsB,MAAK,IAAI,CAAC;IAC/D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,mBAAmB,KAAI,EAAE,CAAC;IAElD,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;IAE1E,MAAM,cAAc,GAAG,eAAe,CAAC,SAAS,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAChF,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,UAAU,EAAE,CAAC;QACb,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,EAAE,CAAC;YACrB,WAAW,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB;IAE9B,OAAO;QACL,SAAS;QACT,cAAc;QACd,WAAW;QACX,SAAS;KACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport { modalOpened, modalCTAClicked, modalClosed } from '../../tracking/trackers/enterpriseDashboardModal';\n\nexport const state = {\n showModal: (val) => React.useState(val), // eslint-disable-line\n};\n\nexport const useEnterpriseDashboardModal = () => {\n const { data } = useInitializeLearnerHome();\n const hasAvailableDashboards = typeof data?.hasAvailableDashboards === 'boolean'\n ? data.hasAvailableDashboards\n : data?.enterpriseDashboard?.isLearnerPortalEnabled === true;\n const [showModal, setShowModal] = state.showModal(hasAvailableDashboards);\n const dashboard = data?.enterpriseDashboard || {};\n\n const trackOpened = modalOpened(dashboard.enterpriseUUID);\n const trackClose = modalClosed(dashboard.enterpriseUUID, 'Cancel button');\n\n const handleCTAClick = modalCTAClicked(dashboard.enterpriseUUID, dashboard.url);\n const handleClose = () => {\n trackClose();\n setShowModal(false);\n };\n\n React.useEffect(() => {\n if (dashboard?.label) {\n trackOpened();\n }\n }, []); // eslint-disable-line\n\n return {\n showModal,\n handleCTAClick,\n handleClose,\n dashboard,\n };\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/dashboard-modal/index.jsx"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAEhF,eAAe,+BAA+B,CAAC","sourcesContent":["import EnterpriseDashboardModalWrapper from './EnterpriseDashboardModalWrapper';\n\nexport default EnterpriseDashboardModalWrapper;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default messages;
|
|
2
|
+
declare namespace messages {
|
|
3
|
+
namespace enterpriseDialogHeader {
|
|
4
|
+
let id: string;
|
|
5
|
+
let defaultMessage: string;
|
|
6
|
+
let description: string;
|
|
7
|
+
}
|
|
8
|
+
namespace enterpriseDialogBody {
|
|
9
|
+
let id_1: string;
|
|
10
|
+
export { id_1 as id };
|
|
11
|
+
let defaultMessage_1: string;
|
|
12
|
+
export { defaultMessage_1 as defaultMessage };
|
|
13
|
+
let description_1: string;
|
|
14
|
+
export { description_1 as description };
|
|
15
|
+
}
|
|
16
|
+
namespace enterpriseDialogDismissButton {
|
|
17
|
+
let id_2: string;
|
|
18
|
+
export { id_2 as id };
|
|
19
|
+
let defaultMessage_2: string;
|
|
20
|
+
export { defaultMessage_2 as defaultMessage };
|
|
21
|
+
let description_2: string;
|
|
22
|
+
export { description_2 as description };
|
|
23
|
+
}
|
|
24
|
+
namespace enterpriseDialogConfirmButton {
|
|
25
|
+
let id_3: string;
|
|
26
|
+
export { id_3 as id };
|
|
27
|
+
let defaultMessage_3: string;
|
|
28
|
+
export { defaultMessage_3 as defaultMessage };
|
|
29
|
+
let description_3: string;
|
|
30
|
+
export { description_3 as description };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
enterpriseDialogHeader: {
|
|
4
|
+
id: 'leanerDashboard.enterpriseDialogHeader',
|
|
5
|
+
defaultMessage: 'Start exploring the free courses available to you through the {label} dashboard.',
|
|
6
|
+
description: 'title for enterprise dashboard dialog',
|
|
7
|
+
},
|
|
8
|
+
enterpriseDialogBody: {
|
|
9
|
+
id: 'leanerDashboard.enterpriseDialogBody',
|
|
10
|
+
defaultMessage: 'You have access to a range of free courses. To explore and start learning, simply click "Go to dashboard" now.',
|
|
11
|
+
description: 'Body text for enterprise dashboard dialog',
|
|
12
|
+
},
|
|
13
|
+
enterpriseDialogDismissButton: {
|
|
14
|
+
id: 'leanerDashboard.enterpriseDialogDismissButton',
|
|
15
|
+
defaultMessage: 'Dismiss',
|
|
16
|
+
description: 'Dismiss button to cancel visiting dashboard',
|
|
17
|
+
},
|
|
18
|
+
enterpriseDialogConfirmButton: {
|
|
19
|
+
id: 'leanerDashboard.enterpriseDialogConfirmButton',
|
|
20
|
+
defaultMessage: 'Go to dashboard',
|
|
21
|
+
description: 'Confirm button to go to the dashboard url',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export default messages;
|
|
25
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/dashboard-modal/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,sBAAsB,EAAE;QACtB,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,kFAAkF;QAClG,WAAW,EAAE,uCAAuC;KACrD;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,gHAAgH;QAChI,WAAW,EAAE,2CAA2C;KACzD;IACD,6BAA6B,EAAE;QAC7B,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,6CAA6C;KAC3D;IACD,6BAA6B,EAAE;QAC7B,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,2CAA2C;KACzD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n enterpriseDialogHeader: {\n id: 'leanerDashboard.enterpriseDialogHeader',\n defaultMessage: 'Start exploring the free courses available to you through the {label} dashboard.',\n description: 'title for enterprise dashboard dialog',\n },\n enterpriseDialogBody: {\n id: 'leanerDashboard.enterpriseDialogBody',\n defaultMessage: 'You have access to a range of free courses. To explore and start learning, simply click \"Go to dashboard\" now.',\n description: 'Body text for enterprise dashboard dialog',\n },\n enterpriseDialogDismissButton: {\n id: 'leanerDashboard.enterpriseDialogDismissButton',\n defaultMessage: 'Dismiss',\n description: 'Dismiss button to cancel visiting dashboard',\n },\n enterpriseDialogConfirmButton: {\n id: 'leanerDashboard.enterpriseDialogConfirmButton',\n defaultMessage: 'Go to dashboard',\n description: 'Confirm button to go to the dashboard url',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function createInstance(args: any): boolean;
|
|
2
|
+
export function useDecision(experimentKey: any): (boolean | {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
variationKey: string;
|
|
5
|
+
})[];
|
|
6
|
+
export function OptimizelyProvider({ optimizely, user, children }: {
|
|
7
|
+
optimizely: any;
|
|
8
|
+
user: any;
|
|
9
|
+
children?: null | undefined;
|
|
10
|
+
}): null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/* eslint-disable react/prop-types */
|
|
3
|
+
const useDecision = (experimentKey) => (
|
|
4
|
+
// to modify toggle between experiments, fill in the variation key for the desired variation
|
|
5
|
+
// if several optimizely experimentKeys exist, add a condition to select which experiment you are testing
|
|
6
|
+
[{ enabled: true, variationKey: 'fill_in_this_section' }, true]);
|
|
7
|
+
const OptimizelyProvider = ({ optimizely, user, children = null }) => children;
|
|
8
|
+
const createInstance = (args) => (true);
|
|
9
|
+
export { createInstance, useDecision, OptimizelyProvider };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/widgets/LearnerDashboardPlugins/mocks/optimizely/index.jsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,qCAAqC;AAErC,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC;AACrC,4FAA4F;AAC5F,yGAAyG;AACzG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,sBAAsB,EAAE,EAAE,IAAI,CAAC,CAChE,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC;AAE/E,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["/* eslint-disable no-unused-vars */\n/* eslint-disable react/prop-types */\n\nconst useDecision = (experimentKey) => (\n // to modify toggle between experiments, fill in the variation key for the desired variation\n // if several optimizely experimentKeys exist, add a condition to select which experiment you are testing\n [{ enabled: true, variationKey: 'fill_in_this_section' }, true]\n);\n\nconst OptimizelyProvider = ({ optimizely, user, children = null }) => children;\n\nconst createInstance = (args) => (true);\n\nexport { createInstance, useDecision, OptimizelyProvider };\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable import/no-unresolved */
|
|
3
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { Button, Image } from '@openedx/paragon';
|
|
6
|
+
import { Search } from '@openedx/paragon/icons';
|
|
7
|
+
import { useInView } from 'react-intersection-observer';
|
|
8
|
+
import { useInitializeLearnerHome } from '../../../data/hooks';
|
|
9
|
+
import { baseAppUrl } from '../../../data/services/lms/urls';
|
|
10
|
+
import emptyCourseSVG from '../../../assets/empty-course.svg';
|
|
11
|
+
import { exploreCoursesViewedCohesion, exploreCoursesClickedCohesion } from '../tracking/trackers/exploreCourses';
|
|
12
|
+
import messages from './messages';
|
|
13
|
+
import './index.scss';
|
|
14
|
+
const NoCoursesView = () => {
|
|
15
|
+
var _a;
|
|
16
|
+
const { formatMessage } = useIntl();
|
|
17
|
+
const { data } = useInitializeLearnerHome();
|
|
18
|
+
const courseSearchUrl = ((_a = data === null || data === void 0 ? void 0 : data.platformSettings) === null || _a === void 0 ? void 0 : _a.courseSearchUrl) || '';
|
|
19
|
+
const viewCorrelationIdRef = useRef(window.crypto.randomUUID());
|
|
20
|
+
const hasViewEventFired = useRef(false);
|
|
21
|
+
const { ref: exploreCoursesRef, inView } = useInView({ triggerOnce: true });
|
|
22
|
+
const handleExploreCoursesViewed = useCallback(() => {
|
|
23
|
+
exploreCoursesViewedCohesion(viewCorrelationIdRef.current);
|
|
24
|
+
}, []);
|
|
25
|
+
const handleExploreCoursesClick = () => {
|
|
26
|
+
exploreCoursesClickedCohesion(viewCorrelationIdRef.current);
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!hasViewEventFired.current && inView) {
|
|
30
|
+
handleExploreCoursesViewed();
|
|
31
|
+
hasViewEventFired.current = true;
|
|
32
|
+
}
|
|
33
|
+
}, [handleExploreCoursesViewed, inView]);
|
|
34
|
+
return (_jsxs("div", { id: "no-courses-content-view", className: "d-flex align-items-center justify-content-center mb-4.5", children: [_jsx(Image, { src: emptyCourseSVG, alt: formatMessage(messages.bannerAlt) }), _jsx("h3", { className: "h1", children: formatMessage(messages.lookingForChallengePrompt) }), _jsx("p", { children: formatMessage(messages.exploreCoursesPrompt) }), _jsx(Button, { variant: "brand", as: "a", onClick: handleExploreCoursesClick, href: baseAppUrl(courseSearchUrl), iconBefore: Search, ref: exploreCoursesRef, children: formatMessage(messages.exploreCoursesButton) })] }));
|
|
35
|
+
};
|
|
36
|
+
export default NoCoursesView;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/no-courses-view/index.jsx"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAElH,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,CAAC;AAEtB,MAAM,aAAa,GAAG,GAAG,EAAE;;IACzB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,GAAG,wBAAwB,EAAE,CAAC;IAC5C,MAAM,eAAe,GAAG,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,0CAAE,eAAe,KAAI,EAAE,CAAC;IACtE,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAChE,MAAM,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAExC,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5E,MAAM,0BAA0B,GAAG,WAAW,CAAC,GAAG,EAAE;QAClD,4BAA4B,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,yBAAyB,GAAG,GAAG,EAAE;QACrC,6BAA6B,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,iBAAiB,CAAC,OAAO,IAAI,MAAM,EAAE,CAAC;YACzC,0BAA0B,EAAE,CAAC;YAC7B,iBAAiB,CAAC,OAAO,GAAG,IAAI,CAAC;QACnC,CAAC;IACH,CAAC,EAAE,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC,CAAC;IAEzC,OAAO,CACL,eACE,EAAE,EAAC,yBAAyB,EAC5B,SAAS,EAAC,yDAAyD,aAEnE,KAAC,KAAK,IAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAI,EACtE,aAAI,SAAS,EAAC,IAAI,YACf,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,GAC/C,EACL,sBACG,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAC3C,EACJ,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,EAAE,EAAC,GAAG,EACN,OAAO,EAAE,yBAAyB,EAClC,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,EACjC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,iBAAiB,YAErB,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GACtC,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["/* eslint-disable import/no-unresolved */\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Button, Image } from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\nimport { useInView } from 'react-intersection-observer';\n\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport { baseAppUrl } from '@src/data/services/lms/urls';\n\nimport emptyCourseSVG from '@src/assets/empty-course.svg';\nimport { exploreCoursesViewedCohesion, exploreCoursesClickedCohesion } from '../tracking/trackers/exploreCourses';\n\nimport messages from './messages';\nimport './index.scss';\n\nconst NoCoursesView = () => {\n const { formatMessage } = useIntl();\n const { data } = useInitializeLearnerHome();\n const courseSearchUrl = data?.platformSettings?.courseSearchUrl || '';\n const viewCorrelationIdRef = useRef(window.crypto.randomUUID());\n const hasViewEventFired = useRef(false);\n\n const { ref: exploreCoursesRef, inView } = useInView({ triggerOnce: true });\n\n const handleExploreCoursesViewed = useCallback(() => {\n exploreCoursesViewedCohesion(viewCorrelationIdRef.current);\n }, []);\n\n const handleExploreCoursesClick = () => {\n exploreCoursesClickedCohesion(viewCorrelationIdRef.current);\n };\n\n useEffect(() => {\n if (!hasViewEventFired.current && inView) {\n handleExploreCoursesViewed();\n hasViewEventFired.current = true;\n }\n }, [handleExploreCoursesViewed, inView]);\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 ref={exploreCoursesRef}\n >\n {formatMessage(messages.exploreCoursesButton)}\n </Button>\n </div>\n );\n};\n\nexport default NoCoursesView;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#no-courses-content-view {
|
|
2
|
+
border: 2px solid var(--pgn-color-light-400);
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding-bottom: var(--pgn-spacing-spacer-5);
|
|
5
|
+
padding-top: var(--pgn-spacing-spacer-5);
|
|
6
|
+
height: 100%;
|
|
7
|
+
|
|
8
|
+
& > * {
|
|
9
|
+
margin-top: var(--pgn-spacing-spacer-3);
|
|
10
|
+
margin-bottom: var(--pgn-spacing-spacer-3);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default messages;
|
|
2
|
+
declare namespace messages {
|
|
3
|
+
namespace lookingForChallengePrompt {
|
|
4
|
+
let id: string;
|
|
5
|
+
let defaultMessage: string;
|
|
6
|
+
let description: string;
|
|
7
|
+
}
|
|
8
|
+
namespace exploreCoursesPrompt {
|
|
9
|
+
let id_1: string;
|
|
10
|
+
export { id_1 as id };
|
|
11
|
+
let defaultMessage_1: string;
|
|
12
|
+
export { defaultMessage_1 as defaultMessage };
|
|
13
|
+
let description_1: string;
|
|
14
|
+
export { description_1 as description };
|
|
15
|
+
}
|
|
16
|
+
namespace exploreCoursesButton {
|
|
17
|
+
let id_2: string;
|
|
18
|
+
export { id_2 as id };
|
|
19
|
+
let defaultMessage_2: string;
|
|
20
|
+
export { defaultMessage_2 as defaultMessage };
|
|
21
|
+
let description_2: string;
|
|
22
|
+
export { description_2 as description };
|
|
23
|
+
}
|
|
24
|
+
namespace bannerAlt {
|
|
25
|
+
let id_3: string;
|
|
26
|
+
export { id_3 as id };
|
|
27
|
+
let defaultMessage_3: string;
|
|
28
|
+
export { defaultMessage_3 as defaultMessage };
|
|
29
|
+
let description_3: string;
|
|
30
|
+
export { description_3 as description };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
lookingForChallengePrompt: {
|
|
4
|
+
id: 'Dashboard.NoCoursesView.lookingForChallengePrompt',
|
|
5
|
+
defaultMessage: 'Looking for a new challenge?',
|
|
6
|
+
description: 'Prompt user for new challenge',
|
|
7
|
+
},
|
|
8
|
+
exploreCoursesPrompt: {
|
|
9
|
+
id: 'Dashboard.NoCoursesView.exploreCoursesPrompt',
|
|
10
|
+
defaultMessage: 'Explore our courses to add them to your dashboard.',
|
|
11
|
+
description: 'Prompt user to explore more courses',
|
|
12
|
+
},
|
|
13
|
+
exploreCoursesButton: {
|
|
14
|
+
id: 'Dashboard.NoCoursesView.exploreCoursesButton',
|
|
15
|
+
defaultMessage: 'Explore courses',
|
|
16
|
+
description: 'Button to explore more courses',
|
|
17
|
+
},
|
|
18
|
+
bannerAlt: {
|
|
19
|
+
id: 'Dashboard.NoCoursesView.bannerAlt',
|
|
20
|
+
defaultMessage: 'No Courses view banner',
|
|
21
|
+
description: 'No Courses view basnner',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export default messages;
|
|
25
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/no-courses-view/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,yBAAyB,EAAE;QACzB,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,8BAA8B;QAC9C,WAAW,EAAE,+BAA+B;KAC7C;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,oDAAoD;QACpE,WAAW,EAAE,qCAAqC;KACnD;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,gCAAgC;KAC9C;IACD,SAAS,EAAE;QACT,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,wBAAwB;QACxC,WAAW,EAAE,yBAAyB;KACvC;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n lookingForChallengePrompt: {\n id: 'Dashboard.NoCoursesView.lookingForChallengePrompt',\n defaultMessage: 'Looking for a new challenge?',\n description: 'Prompt user for new challenge',\n },\n exploreCoursesPrompt: {\n id: 'Dashboard.NoCoursesView.exploreCoursesPrompt',\n defaultMessage: 'Explore our courses to add them to your dashboard.',\n description: 'Prompt user to explore more courses',\n },\n exploreCoursesButton: {\n id: 'Dashboard.NoCoursesView.exploreCoursesButton',\n defaultMessage: 'Explore courses',\n description: 'Button to explore more courses',\n },\n bannerAlt: {\n id: 'Dashboard.NoCoursesView.bannerAlt',\n defaultMessage: 'No Courses view banner',\n description: 'No Courses view basnner',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAppConfig } from '@openedx/frontend-base';
|
|
11
|
+
import { getAuthenticatedHttpClient, getAuthenticatedUser } from '@openedx/frontend-base';
|
|
12
|
+
import { logError, logInfo } from '@openedx/frontend-base';
|
|
13
|
+
export const noticesUrl = `${getAppConfig().LMS_BASE_URL}/notices/api/v1/unacknowledged`;
|
|
14
|
+
export const getNotices = ({ onLoad, notFoundMessage }) => {
|
|
15
|
+
const authenticatedUser = getAuthenticatedUser();
|
|
16
|
+
const handleError = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
// Error probably means that notices is not installed, which is fine.
|
|
18
|
+
const { customAttributes: { httpErrorStatus } } = e;
|
|
19
|
+
if (httpErrorStatus === 404) {
|
|
20
|
+
logInfo(`${e}. ${notFoundMessage}`);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
logError(e);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
if (authenticatedUser) {
|
|
27
|
+
return getAuthenticatedHttpClient().get(noticesUrl, {}).then(onLoad).catch(handleError);
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
export default { getNotices };
|
|
32
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/notices-redirect/api.js"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,YAAY,EAAE,CAAC,YAAY,gCAAgC,CAAC;AAEzF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE;IACxD,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IAEjD,MAAM,WAAW,GAAG,CAAO,CAAC,EAAE,EAAE;QAC9B,qEAAqE;QACrE,MAAM,EAAE,gBAAgB,EAAE,EAAE,eAAe,EAAE,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,eAAe,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,eAAe,EAAE,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAA,CAAC;IACF,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,0BAA0B,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { getAppConfig } from '@openedx/frontend-base';\nimport { getAuthenticatedHttpClient, getAuthenticatedUser } from '@openedx/frontend-base';\nimport { logError, logInfo } from '@openedx/frontend-base';\n\nexport const noticesUrl = `${getAppConfig().LMS_BASE_URL}/notices/api/v1/unacknowledged`;\n\nexport const getNotices = ({ onLoad, notFoundMessage }) => {\n const authenticatedUser = getAuthenticatedUser();\n\n const handleError = async (e) => {\n // Error probably means that notices is not installed, which is fine.\n const { customAttributes: { httpErrorStatus } } = e;\n if (httpErrorStatus === 404) {\n logInfo(`${e}. ${notFoundMessage}`);\n } else {\n logError(e);\n }\n };\n if (authenticatedUser) {\n return getAuthenticatedHttpClient().get(noticesUrl, {}).then(onLoad).catch(handleError);\n }\n return null;\n};\n\nexport default { getNotices };\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getAppConfig } from '@openedx/frontend-base';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { getNotices } from './api';
|
|
5
|
+
import messages from './messages';
|
|
6
|
+
/**
|
|
7
|
+
* This component uses the platform-plugin-notices plugin to function.
|
|
8
|
+
* If the user has an unacknowledged notice, they will be rerouted off
|
|
9
|
+
* course home and onto a full-screen notice page. If the plugin is not
|
|
10
|
+
* installed, or there are no notices, we just passthrough this component.
|
|
11
|
+
*/
|
|
12
|
+
export const useNoticesRedirectData = () => {
|
|
13
|
+
const [isRedirected, setIsRedirected] = React.useState(false);
|
|
14
|
+
const { formatMessage } = useIntl();
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (getAppConfig().ENABLE_NOTICES) {
|
|
17
|
+
getNotices({
|
|
18
|
+
onLoad: (data) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.results) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
21
|
+
setIsRedirected(true);
|
|
22
|
+
window.location.replace(`${data.data.results[0]}?next=${window.location.href}`);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
notFoundMessage: formatMessage(messages.error404Message),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, [setIsRedirected, formatMessage]);
|
|
29
|
+
return { isRedirected };
|
|
30
|
+
};
|
|
31
|
+
export default useNoticesRedirectData;
|
|
32
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/notices-redirect/hooks.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;YAClC,UAAU,CAAC;gBACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;oBACf,IAAI,CAAA,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,OAAO,0CAAE,MAAM,IAAG,CAAC,EAAE,CAAC;wBACpC,eAAe,CAAC,IAAI,CAAC,CAAC;wBACtB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;oBAClF,CAAC;gBACH,CAAC;gBACD,eAAe,EAAE,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC;aACzD,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAC;IACrC,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import React from 'react';\nimport { getAppConfig } from '@openedx/frontend-base';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { getNotices } from './api';\nimport messages from './messages';\n\n/**\n * This component uses the platform-plugin-notices plugin to function.\n * If the user has an unacknowledged notice, they will be rerouted off\n * course home and onto a full-screen notice page. If the plugin is not\n * installed, or there are no notices, we just passthrough this component.\n */\n\nexport const useNoticesRedirectData = () => {\n const [isRedirected, setIsRedirected] = React.useState(false);\n const { formatMessage } = useIntl();\n\n React.useEffect(() => {\n if (getAppConfig().ENABLE_NOTICES) {\n getNotices({\n onLoad: (data) => {\n if (data?.data?.results?.length > 0) {\n setIsRedirected(true);\n window.location.replace(`${data.data.results[0]}?next=${window.location.href}`);\n }\n },\n notFoundMessage: formatMessage(messages.error404Message),\n });\n }\n }, [setIsRedirected, formatMessage]);\n return { isRedirected };\n};\n\nexport default useNoticesRedirectData;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default NoticesRedirect;
|
|
2
|
+
/**
|
|
3
|
+
* This component uses the platform-plugin-notices plugin to function.
|
|
4
|
+
* If the user has an unacknowledged notice, they will be rerouted off
|
|
5
|
+
* course home and onto a full-screen notice page. If the plugin is not
|
|
6
|
+
* installed, or there are no notices, we just passthrough this component.
|
|
7
|
+
*/
|
|
8
|
+
declare function NoticesRedirect(): null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
2
|
+
import useNoticesRedirectData from './hooks';
|
|
3
|
+
/**
|
|
4
|
+
* This component uses the platform-plugin-notices plugin to function.
|
|
5
|
+
* If the user has an unacknowledged notice, they will be rerouted off
|
|
6
|
+
* course home and onto a full-screen notice page. If the plugin is not
|
|
7
|
+
* installed, or there are no notices, we just passthrough this component.
|
|
8
|
+
*/
|
|
9
|
+
const NoticesRedirect = () => {
|
|
10
|
+
useNoticesRedirectData();
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
13
|
+
export default NoticesRedirect;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/notices-redirect/index.jsx"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,sBAAsB,MAAM,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,sBAAsB,EAAE,CAAC;IACzB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["// eslint-disable-next-line import/no-named-as-default\nimport useNoticesRedirectData from './hooks';\n\n/**\n * This component uses the platform-plugin-notices plugin to function.\n * If the user has an unacknowledged notice, they will be rerouted off\n * course home and onto a full-screen notice page. If the plugin is not\n * installed, or there are no notices, we just passthrough this component.\n */\nconst NoticesRedirect = () => {\n useNoticesRedirectData();\n return null;\n};\n\nexport default NoticesRedirect;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
error404Message: {
|
|
4
|
+
id: 'learner-dash.notices.error404Message',
|
|
5
|
+
defaultMessage: 'This probably happened because the notices plugin is not installed on platform.',
|
|
6
|
+
description: 'Error message when notices API returns 404',
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
export default messages;
|
|
10
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/notices-redirect/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,eAAe,EAAE;QACf,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,iFAAiF;QACjG,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n error404Message: {\n id: 'learner-dash.notices.error404Message',\n defaultMessage: 'This probably happened because the notices plugin is not installed on platform.',\n description: 'Error message when notices API returns 404',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function ProgressiveProfilingEntry(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { getAuthenticatedUser } from '@openedx/frontend-base';
|
|
4
|
+
import ProgressiveProfilingModal from './ProgressiveProfilingModal';
|
|
5
|
+
import useProgressiveProfilingTrigger from './hooks/useProgressiveProfilingTrigger';
|
|
6
|
+
import useClearProgressiveProfilingQueryParams from './hooks/useClearProgressiveProfilingQueryParams';
|
|
7
|
+
import { trackProgressiveProfilingQuestionaireModalFormOpened } from '../tracking/trackers/progressiveProfiling';
|
|
8
|
+
const ProgressiveProfilingEntry = () => {
|
|
9
|
+
var _a;
|
|
10
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
+
const username = (_a = getAuthenticatedUser()) === null || _a === void 0 ? void 0 : _a.username;
|
|
12
|
+
const { shouldOpen } = useProgressiveProfilingTrigger();
|
|
13
|
+
const clearTrigger = useClearProgressiveProfilingQueryParams();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (shouldOpen && username) {
|
|
16
|
+
setIsOpen(true);
|
|
17
|
+
trackProgressiveProfilingQuestionaireModalFormOpened({ host: window.location.origin });
|
|
18
|
+
}
|
|
19
|
+
}, [shouldOpen, username]);
|
|
20
|
+
return (_jsx(ProgressiveProfilingModal, { isOpen: isOpen, onClose: () => setIsOpen(false), clearTrigger: clearTrigger }));
|
|
21
|
+
};
|
|
22
|
+
export { ProgressiveProfilingEntry };
|
|
23
|
+
//# sourceMappingURL=ProgressiveProfilingEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressiveProfilingEntry.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardPlugins/progressive-profiling-dashboard/ProgressiveProfilingEntry.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,8BAA8B,MAAM,wCAAwC,CAAC;AACpF,OAAO,uCAAuC,MAAM,iDAAiD,CAAC;AACtG,OAAO,EAAE,oDAAoD,EAAE,MAAM,2CAA2C,CAAC;AAEjH,MAAM,yBAAyB,GAAG,GAAG,EAAE;;IACrC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,QAAQ,GAAG,MAAA,oBAAoB,EAAE,0CAAE,QAAQ,CAAC;IAElD,MAAM,EAAE,UAAU,EAAE,GAAG,8BAA8B,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,uCAAuC,EAAE,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;YAC3B,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,oDAAoD,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3B,OAAO,CACL,KAAC,yBAAyB,IACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAC/B,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { getAuthenticatedUser } from '@openedx/frontend-base';\n\nimport ProgressiveProfilingModal from './ProgressiveProfilingModal';\nimport useProgressiveProfilingTrigger from './hooks/useProgressiveProfilingTrigger';\nimport useClearProgressiveProfilingQueryParams from './hooks/useClearProgressiveProfilingQueryParams';\nimport { trackProgressiveProfilingQuestionaireModalFormOpened } from '../tracking/trackers/progressiveProfiling';\n\nconst ProgressiveProfilingEntry = () => {\n const [isOpen, setIsOpen] = useState(false);\n\n const username = getAuthenticatedUser()?.username;\n\n const { shouldOpen } = useProgressiveProfilingTrigger();\n const clearTrigger = useClearProgressiveProfilingQueryParams();\n\n useEffect(() => {\n if (shouldOpen && username) {\n setIsOpen(true);\n trackProgressiveProfilingQuestionaireModalFormOpened({ host: window.location.origin });\n }\n }, [shouldOpen, username]);\n\n return (\n <ProgressiveProfilingModal\n isOpen={isOpen}\n onClose={() => setIsOpen(false)}\n clearTrigger={clearTrigger}\n />\n );\n};\n\nexport { ProgressiveProfilingEntry };\n"]}
|