diff --git a/src/containers/Dashboard/__snapshots__/index.test.jsx.snap b/src/containers/Dashboard/__snapshots__/index.test.jsx.snap index 1f6b098..3657058 100644 --- a/src/containers/Dashboard/__snapshots__/index.test.jsx.snap +++ b/src/containers/Dashboard/__snapshots__/index.test.jsx.snap @@ -54,7 +54,7 @@ exports[`Dashboard snapshots there are no courses, there ARE available dashboard test-page-title - +
{

{pageTitle}

{!initIsPending && ( <> - {hasAvailableDashboards && } + {hasAvailableDashboards && } {(hasCourses && showSelectSessionModal) && } )} diff --git a/src/containers/Dashboard/index.test.jsx b/src/containers/Dashboard/index.test.jsx index 6080dd3..86886ba 100644 --- a/src/containers/Dashboard/index.test.jsx +++ b/src/containers/Dashboard/index.test.jsx @@ -4,7 +4,7 @@ import { reduxHooks } from 'hooks'; import SelectSessionModal from 'containers/SelectSessionModal'; import CoursesPanel from 'containers/CoursesPanel'; -import DashboardModalSlot from 'plugin-slots/DashboardModalSlot'; +import EnterpriseDashboardModalSlot from 'plugin-slots/EnterpriseDashboardModalSlot'; import DashboardLayout from './DashboardLayout'; import LoadingView from './LoadingView'; @@ -20,7 +20,7 @@ jest.mock('hooks', () => ({ }, })); -jest.mock('plugin-slots/DashboardModalSlot', () => 'DashboardModalSlot'); +jest.mock('plugin-slots/EnterpriseDashboardModalSlot', () => 'EnterpriseDashboardModalSlot'); jest.mock('containers/CoursesPanel', () => 'CoursesPanel'); jest.mock('./LoadingView', () => 'LoadingView'); jest.mock('./DashboardLayout', () => 'DashboardLayout'); @@ -81,7 +81,7 @@ describe('Dashboard', () => { testContent(contentEl); }); it(`${renderString(showEnterpriseModal)} dashbaord modal`, () => { - expect(wrapper.instance.findByType(DashboardModalSlot).length) + expect(wrapper.instance.findByType(EnterpriseDashboardModalSlot).length) .toEqual(showEnterpriseModal ? 1 : 0); }); it(`${renderString(showSelectSessionModal)} select session modal`, () => { diff --git a/src/containers/DashboardModal/hooks.js b/src/containers/EnterpriseDashboardModal/hooks.js similarity index 100% rename from src/containers/DashboardModal/hooks.js rename to src/containers/EnterpriseDashboardModal/hooks.js diff --git a/src/containers/DashboardModal/hooks.test.js b/src/containers/EnterpriseDashboardModal/hooks.test.js similarity index 100% rename from src/containers/DashboardModal/hooks.test.js rename to src/containers/EnterpriseDashboardModal/hooks.test.js diff --git a/src/plugin-slots/DashboardModalSlot/index.jsx b/src/plugin-slots/DashboardModalSlot/index.jsx deleted file mode 100644 index 8926eeb..0000000 --- a/src/plugin-slots/DashboardModalSlot/index.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import { PluginSlot } from '@openedx/frontend-plugin-framework'; - -const DashboardModal = () => ( - -); - -export default DashboardModal; diff --git a/src/plugin-slots/DashboardModalSlot/README.md b/src/plugin-slots/EnterpriseDashboardModalSlot/README.md similarity index 72% rename from src/plugin-slots/DashboardModalSlot/README.md rename to src/plugin-slots/EnterpriseDashboardModalSlot/README.md index 9477acc..f2a7e70 100644 --- a/src/plugin-slots/DashboardModalSlot/README.md +++ b/src/plugin-slots/EnterpriseDashboardModalSlot/README.md @@ -1,6 +1,6 @@ # Course Card Action Slot -### Slot ID: `dashboard_modal_slot` +### Slot ID: `enterprise_dashboard_modal_slot` ## Description @@ -9,11 +9,11 @@ The following `env.config.jsx` will render the modal. ```js import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; -import { DashboardModal } from '@edx/frontend-plugin-learner-dashboard'; +import { EnterpriseDashboardModal } from '@edx/frontend-plugin-learner-dashboard'; const config = { pluginSlots: { - dashboard_modal_slot: { + enterprise_dashboard_modal_slot: { plugins: [ { op: PLUGIN_OPERATIONS.Insert, @@ -21,7 +21,7 @@ const config = { id: 'dashboard_modal', type: DIRECT_PLUGIN, priority: 60, - RenderWidget: DashboardModal, + RenderWidget: EnterpriseDashboardModal, }, }, ], diff --git a/src/plugin-slots/EnterpriseDashboardModalSlot/index.jsx b/src/plugin-slots/EnterpriseDashboardModalSlot/index.jsx new file mode 100644 index 0000000..288939a --- /dev/null +++ b/src/plugin-slots/EnterpriseDashboardModalSlot/index.jsx @@ -0,0 +1,8 @@ +import React from 'react'; +import { PluginSlot } from '@openedx/frontend-plugin-framework'; + +const EnterpriseDashboardModal = () => ( + +); + +export default EnterpriseDashboardModal; diff --git a/src/plugin-slots/README.md b/src/plugin-slots/README.md index 9adff41..7a44f7e 100644 --- a/src/plugin-slots/README.md +++ b/src/plugin-slots/README.md @@ -5,4 +5,4 @@ * [`widget_sidebar_slot`](./WidgetSidebarSlot/) * [`course_list_slot`](./CourseListSlot/) * [`no_courses_view_slot`](./NoCoursesViewSlot/) -* [`dashboard_modal_slot](./DashboardModalSlot) \ No newline at end of file +* [`enterprise_dashboard_modal_slot](./EnterpriseDashboardModalSlot) \ No newline at end of file diff --git a/src/tracking/constants.js b/src/tracking/constants.js index cc51a48..4683019 100644 --- a/src/tracking/constants.js +++ b/src/tracking/constants.js @@ -20,9 +20,9 @@ export const events = StrictDict({ leaveSession: 'leaveSession', unenrollReason: 'unenrollReason', entitlementUnenrollReason: 'entitlementUnenrollReason', - dashboardModalOpened: 'dashboardModalOpened', - dashboardModalCTAClicked: 'dashboardModalCTAClicked', - dashboardModalClosed: 'dashboardModalClosed', + enterpriseDashboardModalOpened: 'enterpriseDashboardModalOpened', + enterpriseDashboardModalCTAClicked: 'enterpriseDashboardModalCTAClicked', + enterpriseDashboardModalClosed: 'enterpriseDashboardModalClosed', }); const learnerPortal = 'edx.ui.enterprise.lms.dashboard.learner_portal_modal'; @@ -39,9 +39,9 @@ export const eventNames = StrictDict({ leaveSession: 'course-dashboard.leave-session', unenrollReason: 'unenrollment_reason.selected', entitlementUnenrollReason: 'entitlement_unenrollment_reason.selected', - dashboardModalOpened: `${learnerPortal}.opened`, - dashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`, - dashboardModalClosed: `${learnerPortal}.closed`, + enterpriseDashboardModalOpened: `${learnerPortal}.opened`, + enterpriseDashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`, + enterpriseDashboardModalClosed: `${learnerPortal}.closed`, findCoursesClicked: 'edx.bi.dashboard.find_courses_button.clicked', purchaseCredit: 'edx.bi.credit.clicked_purchase_credit', filterClicked: 'course-dashboard.filter.clicked', diff --git a/src/tracking/trackers/enterpriseDashboard.js b/src/tracking/trackers/enterpriseDashboard.js index 6707d16..26a3bd9 100644 --- a/src/tracking/trackers/enterpriseDashboard.js +++ b/src/tracking/trackers/enterpriseDashboard.js @@ -8,7 +8,7 @@ import { eventNames } from '../constants'; * @return {func} - Callback that tracks the event when fired. */ export const modalOpened = (enterpriseUUID) => () => createEventTracker( - eventNames.dashboardModalOpened, + eventNames.enterpriseDashboardModalOpened, { enterpriseUUID }, ); @@ -20,7 +20,7 @@ export const modalOpened = (enterpriseUUID) => () => createEventTracker( */ export const modalCTAClicked = (enterpriseUUID, href) => createLinkTracker( createEventTracker( - eventNames.dashboardModalCTAClicked, + eventNames.enterpriseDashboardModalCTAClicked, { enterpriseUUID }, ), href, @@ -33,7 +33,7 @@ export const modalCTAClicked = (enterpriseUUID, href) => createLinkTracker( * @return {func} - Callback that tracks the event when fired. */ export const modalClosed = (enterpriseUUID, source) => createEventTracker( - eventNames.dashboardModalClosed, + eventNames.enterpriseDashboardModalClosed, { enterpriseUUID, source }, ); diff --git a/src/tracking/trackers/enterpriseDashboard.test.js b/src/tracking/trackers/enterpriseDashboard.test.js index efbb62b..cf47da5 100644 --- a/src/tracking/trackers/enterpriseDashboard.test.js +++ b/src/tracking/trackers/enterpriseDashboard.test.js @@ -15,7 +15,7 @@ describe('enterpriseDashboard trackers', () => { it('creates event tracker for dashboard modal opened event', () => { expect(trackers.modalOpened(enterpriseUUID, source)()).toEqual( createEventTracker( - eventNames.dashboardModalOpened, + eventNames.enterpriseDashboardModalOpened, { enterpriseUUID, source }, ), ); @@ -28,7 +28,7 @@ describe('enterpriseDashboard trackers', () => { expect(href).toEqual(testHref); expect(cb).toEqual( createEventTracker( - eventNames.dashboardModalCTAClicked, + eventNames.enterpriseDashboardModalCTAClicked, { enterpriseUUID, source }, ), ); @@ -38,7 +38,7 @@ describe('enterpriseDashboard trackers', () => { it('creates event tracker for dashboard modal closed event with close source', () => { expect(trackers.modalClosed(enterpriseUUID, source)).toEqual( createEventTracker( - eventNames.dashboardModalClosed, + eventNames.enterpriseDashboardModalClosed, { enterpriseUUID, source }, ), );