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 18, 2025
1 parent d2dc28e commit 08abe31
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/containers/Dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const Dashboard = () => {
hooks.useInitializeDashboard();
const { pageTitle } = hooks.useDashboardMessages();
const hasCourses = reduxHooks.useHasCourses();
const hasAvailableDashboards = reduxHooks.useHasAvailableDashboards();
const initIsPending = reduxHooks.useRequestIsPending(RequestKeys.initialize);
const showSelectSessionModal = reduxHooks.useShowSelectSessionModal();

Expand All @@ -24,7 +23,7 @@ export const Dashboard = () => {
<h1 className="sr-only">{pageTitle}</h1>
{!initIsPending && (
<>
{hasAvailableDashboards && <DashboardModalSlot />}
<DashboardModalSlot />
{(hasCourses && showSelectSessionModal) && <SelectSessionModal />}
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Dashboard/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('Dashboard', () => {
it(`renders ${contentName}`, () => {
testContent(contentEl);
});
it(`${renderString(showEnterpriseModal)} dashbaord modal`, () => {
it(`${renderString(showEnterpriseModal)} dashboard modal`, () => {
expect(wrapper.instance.findByType(DashboardModalSlot).length)
.toEqual(showEnterpriseModal ? 1 : 0);
});
Expand Down
10 changes: 8 additions & 2 deletions src/plugin-slots/DashboardModalSlot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
This slot is used for the modal on a dashboard that directs you to the enterprise dashboard if applicable.
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)

```js
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
import { DashboardModal } from '@edx/frontend-plugin-learner-dashboard';
import { ModalDialog } from '@openedx/paragon';

const config = {
pluginSlots: {
Expand All @@ -21,7 +26,8 @@ const config = {
id: 'dashboard_modal',
type: DIRECT_PLUGIN,
priority: 60,
RenderWidget: DashboardModal,
RenderWidget:
<ModalDialog title="Modal that appears on initial render of learner dashboard" />,
content: {
store,
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 08abe31

Please sign in to comment.