Skip to content

Commit

Permalink
fix: PR requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kiram15 committed Feb 24, 2025
1 parent 9f57363 commit 84fcd32
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/data/redux/app/selectors/appSelectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,6 +19,5 @@ export const showSelectSessionModal = createSelector(
export default StrictDict({
numCourses,
hasCourses,
hasAvailableDashboards,
showSelectSessionModal,
});
9 changes: 0 additions & 9 deletions src/data/redux/app/selectors/appSelectors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-slots/DashboardModalSlot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 84fcd32

Please sign in to comment.