From 84fcd32258e23ee9990b7a181b95e8944f144c05 Mon Sep 17 00:00:00 2001 From: Kira Miller Date: Mon, 24 Feb 2025 22:10:37 +0000 Subject: [PATCH] fix: PR requests --- src/data/redux/app/selectors/appSelectors.js | 6 +----- src/data/redux/app/selectors/appSelectors.test.js | 9 --------- src/plugin-slots/DashboardModalSlot/README.md | 2 +- ...et_sidebar_slot.png => dashboard_modal_slot.png} | Bin 4 files changed, 2 insertions(+), 15 deletions(-) rename src/plugin-slots/DashboardModalSlot/images/{widget_sidebar_slot.png => dashboard_modal_slot.png} (100%) 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