diff --git a/src/containers/Dashboard/__snapshots__/index.test.jsx.snap b/src/containers/Dashboard/__snapshots__/index.test.jsx.snap index 1f6b0985..9fdbbbdd 100644 --- a/src/containers/Dashboard/__snapshots__/index.test.jsx.snap +++ b/src/containers/Dashboard/__snapshots__/index.test.jsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Dashboard snapshots courses loaded, show select session modal, no available dashboards snapshot 1`] = ` +exports[`Dashboard snapshots courses loaded, show select session modal snapshot 1`] = `
+
`; -exports[`Dashboard snapshots there are no courses, there ARE available dashboards snapshot 1`] = ` +exports[`Dashboard snapshots there are no courses snapshot 1`] = `
- +
{ const testView = ({ props, content: [contentName, contentEl], - showEnterpriseModal, showSelectSessionModal, }) => { beforeEach(() => { wrapper = createWrapper(props); }); @@ -77,10 +75,6 @@ describe('Dashboard', () => { it(`renders ${contentName}`, () => { testContent(contentEl); }); - it(`${renderString(showEnterpriseModal)} dashboard modal`, () => { - expect(wrapper.instance.findByType(DashboardModalSlot).length) - .toEqual(showEnterpriseModal ? 1 : 0); - }); it(`${renderString(showSelectSessionModal)} select session modal`, () => { expect(wrapper.instance.findByType(SelectSessionModal).length).toEqual(showSelectSessionModal ? 1 : 0); }); @@ -93,7 +87,6 @@ describe('Dashboard', () => { showSelectSessionModal: false, }, content: ['LoadingView', ], - showEnterpriseModal: false, showSelectSessionModal: false, }); }); @@ -108,7 +101,6 @@ describe('Dashboard', () => { content: ['LoadedView', ( )], - showEnterpriseModal: false, showSelectSessionModal: true, }); }); @@ -123,7 +115,6 @@ describe('Dashboard', () => { content: ['Dashboard layout with no courses sidebar and content', ( )], - showEnterpriseModal: true, showSelectSessionModal: false, }); }); diff --git a/src/data/redux/app/selectors/appSelectors.js b/src/data/redux/app/selectors/appSelectors.js index 04932e1a..255c7976 100644 --- a/src/data/redux/app/selectors/appSelectors.js +++ b/src/data/redux/app/selectors/appSelectors.js @@ -10,10 +10,7 @@ export const numCourses = createSelector( (courseData) => Object.keys(courseData).length, ); export const hasCourses = createSelector([module.numCourses], (num) => num > 0); -export const hasAvailableDashboards = createSelector( - [simpleSelectors.enterpriseDashboard], - (data) => data !== null && data.isLearnerPortalEnabled === true, -); + export const showSelectSessionModal = createSelector( [simpleSelectors.selectSessionModal], (data) => data.cardId != null, @@ -22,6 +19,5 @@ export const showSelectSessionModal = createSelector( export default StrictDict({ numCourses, hasCourses, - hasAvailableDashboards, showSelectSessionModal, }); diff --git a/src/data/redux/app/selectors/appSelectors.test.js b/src/data/redux/app/selectors/appSelectors.test.js index ee4f3c7f..09b528c0 100644 --- a/src/data/redux/app/selectors/appSelectors.test.js +++ b/src/data/redux/app/selectors/appSelectors.test.js @@ -17,15 +17,6 @@ describe('basic app selectors', () => { expect(cb(0)).toEqual(false); }); }); - describe('hasAvailableDashboards', () => { - it('returns true iff the enterpriseDashboard field is populated and learner portal is enabled', () => { - const { preSelectors, cb } = appSelectors.hasAvailableDashboards; - expect(preSelectors).toEqual([simpleSelectors.enterpriseDashboard]); - expect(cb({ isLearnerPortalEnabled: true })).toEqual(true); - expect(cb({ isLearnerPortalEnabled: false })).toEqual(false); - expect(cb(null)).toEqual(false); - }); - }); describe('showSelectSessionModal', () => { it('returns true if the selectSessionModal cardId is not null', () => { const { preSelectors, cb } = appSelectors.showSelectSessionModal; diff --git a/src/plugin-slots/DashboardModalSlot/README.md b/src/plugin-slots/DashboardModalSlot/README.md index d94312aa..7147fc41 100644 --- a/src/plugin-slots/DashboardModalSlot/README.md +++ b/src/plugin-slots/DashboardModalSlot/README.md @@ -10,7 +10,7 @@ The following `env.config.jsx` will render the modal. ## Example Learner dashboard will show modal on initial load -![Screenshot of the dashboard modal](./images/widget_sidebar_slot.png) +![Screenshot of the dashboard modal](./images/dashboard_modal_slot.png) ```js import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; diff --git a/src/plugin-slots/DashboardModalSlot/images/widget_sidebar_slot.png b/src/plugin-slots/DashboardModalSlot/images/dashboard_modal_slot.png similarity index 100% rename from src/plugin-slots/DashboardModalSlot/images/widget_sidebar_slot.png rename to src/plugin-slots/DashboardModalSlot/images/dashboard_modal_slot.png