Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openedx/frontend-app-learner-portal-enterprise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ab579c01dbb86c9553d8f9b3986137b4ab7f1c20
Choose a base ref
..
head repository: openedx/frontend-app-learner-portal-enterprise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d1f19c24f09c778fe7ab158a1eb5a99131f6d07c
Choose a head ref
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
Form, Alert, StatefulButton, ModalDialog, ActionRow,
Form, Alert, StatefulButton, ActionRow, Button, StandardModal,
} from '@openedx/paragon';
import { Error } from '@openedx/paragon/icons';

@@ -111,41 +111,15 @@ class EmailSettingsModal extends Component {
const { open } = this.props;

return (
<ModalDialog
hasCloseButton
isFullscreenOnMobile
<StandardModal
title="Email settings"
isOpen={open}
size="md"
onClose={this.handleOnClose}
>
<ModalDialog.Header>
<ModalDialog.Title>
Email settings
</ModalDialog.Title>
</ModalDialog.Header>
<ModalDialog.Body>
{error && (
<Alert variant="danger" icon={Error}>
An error occurred while saving your email settings. Please try again.
</Alert>
)}
<Form.Group>
<Form.Checkbox
checked={hasEmailsEnabled}
disabled={isSubmitting}
onChange={this.handleEmailSettingsChange}
className="email-checkbox"
>
Receive course emails such as reminders, schedule updates, and other critical announcements.
</Form.Checkbox>
</Form.Group>
</ModalDialog.Body>
<ModalDialog.Footer>
hasCloseButton
isFullscreenOnMobile
footerNode={(
<ActionRow>
<ModalDialog.CloseButton variant="tertiary" data-testid="email-setting-modal-cancel-btn">
Close
</ModalDialog.CloseButton>
<Button variant="tertiary" onClick={this.handleOnClose} data-testid="email-setting-modal-close-btn">Close</Button>
<StatefulButton
labels={{
default: 'Save',
@@ -157,8 +131,24 @@ class EmailSettingsModal extends Component {
onClick={this.handleSaveButtonClick}
/>
</ActionRow>
</ModalDialog.Footer>
</ModalDialog>
)}
>
{error && (
<Alert variant="danger" icon={Error}>

Check warning on line 137 in src/components/dashboard/main-content/course-enrollments/course-cards/email-settings/EmailSettingsModal.jsx

Codecov / codecov/patch

src/components/dashboard/main-content/course-enrollments/course-cards/email-settings/EmailSettingsModal.jsx#L137

Added line #L137 was not covered by tests
An error occurred while saving your email settings. Please try again.
</Alert>
)}
<Form.Group>
<Form.Checkbox
checked={hasEmailsEnabled}
disabled={isSubmitting}
onChange={this.handleEmailSettingsChange}
className="email-checkbox"
>
Receive course emails such as reminders, schedule updates, and other critical announcements.
</Form.Checkbox>
</Form.Group>
</StandardModal>
);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useMemo } from 'react';
import PropTypes from 'prop-types';
import {
ActionRow, ModalDialog, StatefulButton,
ActionRow, Button, StandardModal, StatefulButton,
} from '@openedx/paragon';
import { camelCaseObject } from '@edx/frontend-platform';

@@ -75,26 +75,15 @@ const MarkCompleteModal = ({

return (
<MarkCompleteModalContext.Provider value={contextValue}>
<ModalDialog
<StandardModal
title="Save course for later"
isOpen={isOpen && !confirmSuccessful}
onClose={handleModalOnClose}
hasCloseButton
isFullscreenOnMobile
>
<ModalDialog.Header>
<ModalDialog.Title>
Save course for later
</ModalDialog.Title>
</ModalDialog.Header>
<ModalDialog.Body>
<ModalBody />
</ModalDialog.Body>
<ModalDialog.Footer>
footerNode={(
<ActionRow>
<ModalDialog.CloseButton variant="tertiary" data-testid="mark-complete-modal-cancel-btn">
Cancel
</ModalDialog.CloseButton>
<Button variant="tertiary" onClick={handleModalOnClose} data-testid="mark-complete-modal-cancel-btn">Cancel</Button>
<StatefulButton
labels={{
default: MARK_SAVED_FOR_LATER_DEFAULT_LABEL,
@@ -104,11 +93,12 @@ const MarkCompleteModal = ({
className="confirm-mark-complete-btn btn-brand-primary"
state={confirmButtonState}
onClick={handleConfirmButtonClick}
key="confirm-mark-complete-btn"
/>
</ActionRow>
</ModalDialog.Footer>
</ModalDialog>
)}
>
<ModalBody />
</StandardModal>
</MarkCompleteModalContext.Provider>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useMemo } from 'react';
import PropTypes from 'prop-types';
import {
ActionRow, ModalDialog, StatefulButton,
ActionRow, Button, StandardModal, StatefulButton,
} from '@openedx/paragon';
import { camelCaseObject } from '@edx/frontend-platform';

@@ -69,27 +69,15 @@ const MoveToInProgressModal = ({

return (
<MoveToInProgressModalContext.Provider value={contextValue}>
<ModalDialog
<StandardModal
title="Move course to &quot;In Progress&quot;"
isOpen={isOpen && !confirmSuccessful}
onClose={handleModalOnClose}
size="md"
hasCloseButton
isFullscreenOnMobile
>
<ModalDialog.Header>
<ModalDialog.Title>
Move course to &quot;In Progress&quot;
</ModalDialog.Title>
</ModalDialog.Header>
<ModalDialog.Body>
<ModalBody />
</ModalDialog.Body>
<ModalDialog.Footer>
footerNode={(
<ActionRow>
<ModalDialog.CloseButton variant="tertiary">
Cancel
</ModalDialog.CloseButton>
<Button variant="tertiary" onClick={onClose}>Cancel</Button>
<StatefulButton
labels={{
default: MARK_MOVE_TO_IN_PROGRESS_DEFAULT_LABEL,
@@ -99,11 +87,12 @@ const MoveToInProgressModal = ({
className="confirm-move-to-in-progress-btn btn-primary btn-brand-primary"
state={confirmButtonState}
onClick={handleConfirmButtonClick}
key="confirm-move-to-in-progress-btn"
/>
</ActionRow>
</ModalDialog.Footer>
</ModalDialog>
)}
>
<ModalBody />
</StandardModal>
</MoveToInProgressModalContext.Provider>
);
};
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ describe('<BaseCourseCard />', () => {
});

it('handles email settings modal close/cancel', async () => {
userEvent.click(screen.getByTestId('email-setting-modal-cancel-btn', { name: 'Close' }));
userEvent.click(screen.getByTestId('email-setting-modal-close-btn', { name: 'Close' }));
expect(await screen.queryByRole('dialog')).not.toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -354,7 +354,6 @@ describe('Course enrollments', () => {
});
renderWithRouter(<CourseEnrollmentsWrapper />);
const { title } = savedForLaterCourseRun;
screen.debug(undefined, Infinity);

// Open the dropdown menu for the course
userEvent.click(screen.getByLabelText(`course settings for ${title}`));