Skip to content

Commit 13721f2

Browse files
committed
Revert "fix: renaming slot"
This reverts commit 6a43918.
1 parent 960647c commit 13721f2

File tree

12 files changed

+31
-31
lines changed

12 files changed

+31
-31
lines changed

src/containers/Dashboard/__snapshots__/index.test.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ exports[`Dashboard snapshots there are no courses, there ARE available dashboard
5454
test-page-title
5555
</h1>
5656
<Fragment>
57-
<DashboardModal />
57+
<EnterpriseDashboardModal />
5858
</Fragment>
5959
<div
6060
data-testid="dashboard-content"

src/containers/Dashboard/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { reduxHooks } from 'hooks';
44
import { RequestKeys } from 'data/constants/requests';
55
import SelectSessionModal from 'containers/SelectSessionModal';
66
import CoursesPanel from 'containers/CoursesPanel';
7-
import DashboardModalSlot from 'plugin-slots/DashboardModalSlot';
7+
import EnterpriseDashboardModalSlot from 'plugin-slots/EnterpriseDashboardModalSlot';
88

99
import LoadingView from './LoadingView';
1010
import DashboardLayout from './DashboardLayout';
@@ -24,7 +24,7 @@ export const Dashboard = () => {
2424
<h1 className="sr-only">{pageTitle}</h1>
2525
{!initIsPending && (
2626
<>
27-
{hasAvailableDashboards && <DashboardModalSlot />}
27+
{hasAvailableDashboards && <EnterpriseDashboardModalSlot />}
2828
{(hasCourses && showSelectSessionModal) && <SelectSessionModal />}
2929
</>
3030
)}

src/containers/Dashboard/index.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { reduxHooks } from 'hooks';
44

55
import SelectSessionModal from 'containers/SelectSessionModal';
66
import CoursesPanel from 'containers/CoursesPanel';
7-
import DashboardModalSlot from 'plugin-slots/DashboardModalSlot';
7+
import EnterpriseDashboardModalSlot from 'plugin-slots/EnterpriseDashboardModalSlot';
88

99
import DashboardLayout from './DashboardLayout';
1010
import LoadingView from './LoadingView';
@@ -20,7 +20,7 @@ jest.mock('hooks', () => ({
2020
},
2121
}));
2222

23-
jest.mock('plugin-slots/DashboardModalSlot', () => 'DashboardModalSlot');
23+
jest.mock('plugin-slots/EnterpriseDashboardModalSlot', () => 'EnterpriseDashboardModalSlot');
2424
jest.mock('containers/CoursesPanel', () => 'CoursesPanel');
2525
jest.mock('./LoadingView', () => 'LoadingView');
2626
jest.mock('./DashboardLayout', () => 'DashboardLayout');
@@ -81,7 +81,7 @@ describe('Dashboard', () => {
8181
testContent(contentEl);
8282
});
8383
it(`${renderString(showEnterpriseModal)} dashbaord modal`, () => {
84-
expect(wrapper.instance.findByType(DashboardModalSlot).length)
84+
expect(wrapper.instance.findByType(EnterpriseDashboardModalSlot).length)
8585
.toEqual(showEnterpriseModal ? 1 : 0);
8686
});
8787
it(`${renderString(showSelectSessionModal)} select session modal`, () => {

src/plugin-slots/DashboardModalSlot/index.jsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/plugin-slots/DashboardModalSlot/README.md renamed to src/plugin-slots/EnterpriseDashboardModalSlot/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Course Card Action Slot
22

3-
### Slot ID: `dashboard_modal_slot`
3+
### Slot ID: `enterprise_dashboard_modal_slot`
44

55
## Description
66

@@ -9,19 +9,19 @@ The following `env.config.jsx` will render the modal.
99

1010
```js
1111
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
12-
import { DashboardModal } from '@edx/frontend-plugin-learner-dashboard';
12+
import { EnterpriseDashboardModal } from '@edx/frontend-plugin-learner-dashboard';
1313

1414
const config = {
1515
pluginSlots: {
16-
dashboard_modal_slot: {
16+
enterprise_dashboard_modal_slot: {
1717
plugins: [
1818
{
1919
op: PLUGIN_OPERATIONS.Insert,
2020
widget: {
2121
id: 'dashboard_modal',
2222
type: DIRECT_PLUGIN,
2323
priority: 60,
24-
RenderWidget: DashboardModal,
24+
RenderWidget: EnterpriseDashboardModal,
2525
},
2626
},
2727
],
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
3+
4+
const EnterpriseDashboardModal = () => (
5+
<PluginSlot id="enterprise_dashboard_modal_slot" />
6+
);
7+
8+
export default EnterpriseDashboardModal;

src/plugin-slots/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* [`widget_sidebar_slot`](./WidgetSidebarSlot/)
66
* [`course_list_slot`](./CourseListSlot/)
77
* [`no_courses_view_slot`](./NoCoursesViewSlot/)
8-
* [`dashboard_modal_slot](./DashboardModalSlot)
8+
* [`enterprise_dashboard_modal_slot](./EnterpriseDashboardModalSlot)

src/tracking/constants.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export const events = StrictDict({
2020
leaveSession: 'leaveSession',
2121
unenrollReason: 'unenrollReason',
2222
entitlementUnenrollReason: 'entitlementUnenrollReason',
23-
dashboardModalOpened: 'dashboardModalOpened',
24-
dashboardModalCTAClicked: 'dashboardModalCTAClicked',
25-
dashboardModalClosed: 'dashboardModalClosed',
23+
enterpriseDashboardModalOpened: 'enterpriseDashboardModalOpened',
24+
enterpriseDashboardModalCTAClicked: 'enterpriseDashboardModalCTAClicked',
25+
enterpriseDashboardModalClosed: 'enterpriseDashboardModalClosed',
2626
});
2727

2828
const learnerPortal = 'edx.ui.enterprise.lms.dashboard.learner_portal_modal';
@@ -39,9 +39,9 @@ export const eventNames = StrictDict({
3939
leaveSession: 'course-dashboard.leave-session',
4040
unenrollReason: 'unenrollment_reason.selected',
4141
entitlementUnenrollReason: 'entitlement_unenrollment_reason.selected',
42-
dashboardModalOpened: `${learnerPortal}.opened`,
43-
dashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`,
44-
dashboardModalClosed: `${learnerPortal}.closed`,
42+
enterpriseDashboardModalOpened: `${learnerPortal}.opened`,
43+
enterpriseDashboardModalCTAClicked: `${learnerPortal}.dashboard_cta.clicked`,
44+
enterpriseDashboardModalClosed: `${learnerPortal}.closed`,
4545
findCoursesClicked: 'edx.bi.dashboard.find_courses_button.clicked',
4646
purchaseCredit: 'edx.bi.credit.clicked_purchase_credit',
4747
filterClicked: 'course-dashboard.filter.clicked',

0 commit comments

Comments
 (0)