Skip to content

Commit bc580d9

Browse files
committed
fix: PR requests
1 parent 9f57363 commit bc580d9

File tree

6 files changed

+6
-27
lines changed

6 files changed

+6
-27
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Dashboard snapshots courses loaded, show select session modal, no available dashboards snapshot 1`] = `
3+
exports[`Dashboard snapshots courses loaded, show select session modal snapshot 1`] = `
44
<div
55
className="d-flex flex-column p-2 pt-0"
66
id="dashboard-container"
@@ -11,6 +11,7 @@ exports[`Dashboard snapshots courses loaded, show select session modal, no avail
1111
test-page-title
1212
</h1>
1313
<Fragment>
14+
<DashboardModalSlot />
1415
<SelectSessionModal />
1516
</Fragment>
1617
<div
@@ -43,7 +44,7 @@ exports[`Dashboard snapshots courses still loading snapshot 1`] = `
4344
</div>
4445
`;
4546

46-
exports[`Dashboard snapshots there are no courses, there ARE available dashboards snapshot 1`] = `
47+
exports[`Dashboard snapshots there are no courses snapshot 1`] = `
4748
<div
4849
className="d-flex flex-column p-2 pt-0"
4950
id="dashboard-container"
@@ -54,7 +55,7 @@ exports[`Dashboard snapshots there are no courses, there ARE available dashboard
5455
test-page-title
5556
</h1>
5657
<Fragment>
57-
<DashboardModal />
58+
<DashboardModalSlot />
5859
</Fragment>
5960
<div
6061
data-testid="dashboard-content"

src/containers/Dashboard/index.test.jsx

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

55
import SelectSessionModal from 'containers/SelectSessionModal';
66
import CoursesPanel from 'containers/CoursesPanel';
7-
import DashboardModalSlot from 'plugin-slots/DashboardModalSlot';
87

98
import DashboardLayout from './DashboardLayout';
109
import LoadingView from './LoadingView';
@@ -68,7 +67,6 @@ describe('Dashboard', () => {
6867
const testView = ({
6968
props,
7069
content: [contentName, contentEl],
71-
showEnterpriseModal,
7270
showSelectSessionModal,
7371
}) => {
7472
beforeEach(() => { wrapper = createWrapper(props); });
@@ -77,10 +75,6 @@ describe('Dashboard', () => {
7775
it(`renders ${contentName}`, () => {
7876
testContent(contentEl);
7977
});
80-
it(`${renderString(showEnterpriseModal)} dashboard modal`, () => {
81-
expect(wrapper.instance.findByType(DashboardModalSlot).length)
82-
.toEqual(showEnterpriseModal ? 1 : 0);
83-
});
8478
it(`${renderString(showSelectSessionModal)} select session modal`, () => {
8579
expect(wrapper.instance.findByType(SelectSessionModal).length).toEqual(showSelectSessionModal ? 1 : 0);
8680
});
@@ -93,7 +87,6 @@ describe('Dashboard', () => {
9387
showSelectSessionModal: false,
9488
},
9589
content: ['LoadingView', <LoadingView />],
96-
showEnterpriseModal: false,
9790
showSelectSessionModal: false,
9891
});
9992
});
@@ -108,7 +101,6 @@ describe('Dashboard', () => {
108101
content: ['LoadedView', (
109102
<DashboardLayout><CoursesPanel /></DashboardLayout>
110103
)],
111-
showEnterpriseModal: false,
112104
showSelectSessionModal: true,
113105
});
114106
});
@@ -123,7 +115,6 @@ describe('Dashboard', () => {
123115
content: ['Dashboard layout with no courses sidebar and content', (
124116
<DashboardLayout><CoursesPanel /></DashboardLayout>
125117
)],
126-
showEnterpriseModal: true,
127118
showSelectSessionModal: false,
128119
});
129120
});

src/data/redux/app/selectors/appSelectors.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ export const numCourses = createSelector(
1010
(courseData) => Object.keys(courseData).length,
1111
);
1212
export const hasCourses = createSelector([module.numCourses], (num) => num > 0);
13-
export const hasAvailableDashboards = createSelector(
14-
[simpleSelectors.enterpriseDashboard],
15-
(data) => data !== null && data.isLearnerPortalEnabled === true,
16-
);
13+
1714
export const showSelectSessionModal = createSelector(
1815
[simpleSelectors.selectSessionModal],
1916
(data) => data.cardId != null,
@@ -22,6 +19,5 @@ export const showSelectSessionModal = createSelector(
2219
export default StrictDict({
2320
numCourses,
2421
hasCourses,
25-
hasAvailableDashboards,
2622
showSelectSessionModal,
2723
});

src/data/redux/app/selectors/appSelectors.test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ describe('basic app selectors', () => {
1717
expect(cb(0)).toEqual(false);
1818
});
1919
});
20-
describe('hasAvailableDashboards', () => {
21-
it('returns true iff the enterpriseDashboard field is populated and learner portal is enabled', () => {
22-
const { preSelectors, cb } = appSelectors.hasAvailableDashboards;
23-
expect(preSelectors).toEqual([simpleSelectors.enterpriseDashboard]);
24-
expect(cb({ isLearnerPortalEnabled: true })).toEqual(true);
25-
expect(cb({ isLearnerPortalEnabled: false })).toEqual(false);
26-
expect(cb(null)).toEqual(false);
27-
});
28-
});
2920
describe('showSelectSessionModal', () => {
3021
it('returns true if the selectSessionModal cardId is not null', () => {
3122
const { preSelectors, cb } = appSelectors.showSelectSessionModal;

src/plugin-slots/DashboardModalSlot/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following `env.config.jsx` will render the modal.
1010
## Example
1111

1212
Learner dashboard will show modal on initial load
13-
![Screenshot of the dashboard modal](./images/widget_sidebar_slot.png)
13+
![Screenshot of the dashboard modal](./images/dashboard_modal_slot.png)
1414

1515
```js
1616
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

0 commit comments

Comments
 (0)