Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Table and StatusAlert deprecation of Paragon #798

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9174fd5
refactor: updated columns for table deprecations
abdullahwaheed Jun 7, 2022
6250d81
refactor: updated unit tests for Datatable changes
abdullahwaheed Jun 8, 2022
45691d7
feat: allowing for idp direct entry + bug fixes
alex-sheehan-edx May 23, 2022
a441acd
chore: redesigned connect step and rolling back idp data direct entry
alex-sheehan-edx Jun 3, 2022
0ab3c24
refactor: updated StatusAlert deprecated component to Alert and made …
abdullahwaheed Jun 9, 2022
c6d4e9b
fix: added specific npm version to fix peerdependency issue (#799)
abdullahwaheed Jun 13, 2022
b0f1b38
refactor: improved coverage
abdullahwaheed Jun 15, 2022
b2386ff
refactor: improved code coverage and removed unused code
abdullahwaheed Jun 16, 2022
067ced0
refactor: updated the missing prop
abdullahwaheed Jun 20, 2022
d5b9663
refactor: removed StatusAlert wrapper and updated each component indi…
abdullahwaheed Jun 28, 2022
208f779
fix: undo removal of coverage in package.json
abdullahwaheed Jun 28, 2022
855f298
fix: fixing config info entry bug (#800)
kiram15 Jun 15, 2022
7473722
feat: hide learner credit management automatically, refactor sidebar
long74100 Jun 15, 2022
55dc278
fix: removed codecov deprecated package (#802)
mamankhan99 Jun 17, 2022
99f1e63
feat: learner credit mgmt offer metadata display (#803)
adamstankiewicz Jun 22, 2022
40a666e
fix: accounting for unique entity ID errors
alex-sheehan-edx Jun 21, 2022
4e1810d
chore: upgrade dependencies to resolve peer dependency resolutions (#…
adamstankiewicz Jun 23, 2022
f7a3ee9
fix: cleaning up self serve integration config settings page
alex-sheehan-edx Jun 23, 2022
7fdf1e9
feat: integrate offers api from analytics
long74100 Jun 24, 2022
5dcb796
fix: tweaking error responses to read better
alex-sheehan-edx Jun 27, 2022
50d705a
fix: add ability to enable FEATURE_LEARNER_CREDIT_MANAGEMENT via quar…
adamstankiewicz Jun 28, 2022
e6ed817
feat: Add learner credit management product tour (#805)
christopappas Jun 28, 2022
866dc11
refactor: updated datatable to handle sorting and pagination as sugge…
abdullahwaheed Jun 30, 2022
d12a372
fix: upgrade paragon and frontend-platform to latest to bring in styl…
adamstankiewicz Jun 29, 2022
2bcaa06
chore: cleaning up SSO and LMS settings page feature flags
alex-sheehan-edx Jun 28, 2022
cd4fd8d
fix: pass bool to hotjarDebug
long74100 Jun 29, 2022
88fca02
fix: fixed crashing unit tests
abdullahwaheed Jun 30, 2022
6aa0c51
feat: alerts and color variants for low/no funds remaining in Learner…
adamstankiewicz Jun 30, 2022
4d6890c
feat: ignore null course price in learner credit mgmt table (#819)
adamstankiewicz Jun 30, 2022
dc04679
fix: failed unit tests after backmerging from master
abdullahwaheed Jul 1, 2022
d517092
Merge branch 'master' of github.com:openedx/frontend-app-admin-portal…
abdullahwaheed Jul 1, 2022
03c04ae
refactor: code coverage improvement
abdullahwaheed Jul 1, 2022
5b2bfa9
refactor: added unit tests for tablecomponent coverage
abdullahwaheed Jul 4, 2022
71b1d69
refactor: removed unused code
abdullahwaheed Jul 5, 2022
e116965
Merge branch 'master' of github.com:openedx/frontend-app-admin-portal…
abdullahwaheed Jul 15, 2022
ceae377
Merge branch 'master' of github.com:openedx/frontend-app-admin-portal…
abdullahwaheed Sep 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions src/components/Admin/__snapshots__/Admin.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6134,35 +6134,40 @@ exports[`<Admin /> renders correctly with error state 1`] = `
className="col"
>
<div
className="alert fade alert-danger show"
hidden={false}
className="fade alert-content alert alert-danger show"
role="alert"
>
<span
className="pgn__icon alert-icon"
>
<svg
aria-hidden={true}
fill="none"
focusable={false}
height={24}
role="img"
viewBox="0 0 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
fill="currentColor"
/>
</svg>
</span>
<div
className="alert-dialog"
className="pgn__alert-message-wrapper"
>
<div
className="d-flex"
className="alert-message-content"
>
<div
className="icon mr-2"
>
<span
aria-hidden={true}
className="fa fa-times-circle"
id="Icon109"
/>
</div>
<div
className="message"
className="alert-heading h4"
>
<span
className="title"
>
Unable to load overview
</span>
Try refreshing your screen (Network Error)
Unable to load overview
</div>
Try refreshing your screen (Network Error)
</div>
</div>
</div>
Expand Down
34 changes: 20 additions & 14 deletions src/components/Admin/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { Icon } from '@edx/paragon';
import { Icon, Alert } from '@edx/paragon';
import { Error } from '@edx/paragon/icons';
import { Link } from 'react-router-dom';

import Hero from '../Hero';
import StatusAlert from '../StatusAlert';
import EnrollmentsTable from '../EnrollmentsTable';
import RegisteredLearnersTable from '../RegisteredLearnersTable';
import EnrolledLearnersTable from '../EnrolledLearnersTable';
Expand Down Expand Up @@ -248,24 +248,30 @@ class Admin extends React.Component {

renderErrorMessage() {
return (
<StatusAlert
alertType="danger"
iconClassName="fa fa-times-circle"
title="Unable to load overview"
message={`Try refreshing your screen (${this.props.error.message})`}
/>
<Alert
variant="danger"
icon={Error}
>
<Alert.Heading>
Unable to load overview
</Alert.Heading>
{`Try refreshing your screen (${this.props.error.message})`}
</Alert>
);
}

renderCsvErrorMessage(message) {
return (
<StatusAlert
<Alert
className="mt-3"
alertType="danger"
iconClassName="fa fa-times-circle"
title="Unable to Generate CSV Report"
message={`Please try again. (${message})`}
/>
variant="danger"
icon={Error}
>
<Alert.Heading>
Unable to Generate CSV Report
</Alert.Heading>
{`Please try again. (${message})`}
</Alert>
);
}

Expand Down
26 changes: 14 additions & 12 deletions src/components/BulkEnrollmentPage/CourseSearchResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import React, {
} from 'react';
import PropTypes from 'prop-types';
import { connectStateResults } from 'react-instantsearch-dom';
import { DataTable, Skeleton } from '@edx/paragon';
import { DataTable, Skeleton, Alert } from '@edx/paragon';
import { SearchContext, SearchPagination } from '@edx/frontend-enterprise-catalog-search';
import { WarningFilled, Error } from '@edx/paragon/icons';

import StatusAlert from '../StatusAlert';
import { CourseNameCell, FormattedDateCell } from './table/CourseSearchResultsCells';
import { BulkEnrollContext } from './BulkEnrollmentContext';

Expand Down Expand Up @@ -96,20 +96,22 @@ export const BaseCourseSearchResults = (props) => {

if (!isSearchStalled && error) {
return (
<StatusAlert
alertType="danger"
iconClassName="fa fa-times-circle"
message={`${ERROR_MESSAGE} ${error.message}`}
/>
<Alert
variant="danger"
icon={Error}
>
{`${ERROR_MESSAGE} ${error.message}`}
</Alert>
);
}
if (!isSearchStalled && searchResults?.nbHits === 0) {
return (
<StatusAlert
alertType="warning"
iconClassName="fa fa-exclamation-circle"
message={NO_DATA_MESSAGE}
/>
<Alert
variant="warning"
icon={WarningFilled}
>
{NO_DATA_MESSAGE}
</Alert>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import configureMockStore from 'redux-mock-store';
import userEvent from '@testing-library/user-event';
import thunk from 'redux-thunk';
import { SearchContext, SearchPagination } from '@edx/frontend-enterprise-catalog-search';
import { Skeleton } from '@edx/paragon';
import { Skeleton, Alert } from '@edx/paragon';
import { IntlProvider } from '@edx/frontend-platform/i18n';

import StatusAlert from '../StatusAlert';
import BulkEnrollContextProvider from './BulkEnrollmentContext';
import {
BaseCourseSearchResults, NO_DATA_MESSAGE, TABLE_HEADERS,
Expand Down Expand Up @@ -158,7 +157,7 @@ describe('<CourseSearchResults />', () => {
const wrapper = mount(<CourseSearchWrapper
props={{ ...defaultProps, searchResults: { ...searchResults, nbHits: 0 } }}
/>);
expect(wrapper.find(StatusAlert)).toHaveLength(1);
expect(wrapper.find(Alert)).toHaveLength(1);
expect(wrapper.text()).toContain(NO_DATA_MESSAGE);
});
});
123 changes: 72 additions & 51 deletions src/components/CodeSearchResults/CodeSearchResults.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { MemoryRouter } from 'react-router-dom';
import { mount } from 'enzyme';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { IntlProvider } from '@edx/frontend-platform/i18n';

import CodeSearchResults from './index';

Expand Down Expand Up @@ -77,12 +78,14 @@ describe('<CodeSearchResults />', () => {
.create((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
enableLearnerPortal={false}
enterpriseSlug="sluggy"
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
enableLearnerPortal={false}
enterpriseSlug="sluggy"
/>
</IntlProvider>
</Provider>
</MemoryRouter>
))
Expand All @@ -105,11 +108,13 @@ describe('<CodeSearchResults />', () => {
.create((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
))
Expand Down Expand Up @@ -164,11 +169,13 @@ describe('<CodeSearchResults />', () => {
.create((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
))
Expand Down Expand Up @@ -204,11 +211,13 @@ describe('<CodeSearchResults />', () => {
.create((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="FAG2LVLNHAKIXQ0Q"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="FAG2LVLNHAKIXQ0Q"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
))
Expand All @@ -235,11 +244,13 @@ describe('<CodeSearchResults />', () => {
.create((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
))
Expand All @@ -262,11 +273,13 @@ describe('<CodeSearchResults />', () => {
.create((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
))
Expand Down Expand Up @@ -305,11 +318,13 @@ describe('<CodeSearchResults />', () => {
const wrapper = mount((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
));
Expand Down Expand Up @@ -360,11 +375,13 @@ describe('<CodeSearchResults />', () => {
const wrapper = mount((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
));
Expand Down Expand Up @@ -405,11 +422,13 @@ describe('<CodeSearchResults />', () => {
const wrapper = mount((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={jest.fn()}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
));
Expand Down Expand Up @@ -441,11 +460,13 @@ describe('<CodeSearchResults />', () => {
const wrapper = mount((
<MemoryRouter>
<Provider store={store}>
<CodeSearchResults
onClose={mockOnClose}
searchQuery="[email protected]"
isOpen
/>
<IntlProvider locale="en">
<CodeSearchResults
onClose={mockOnClose}
searchQuery="[email protected]"
isOpen
/>
</IntlProvider>
</Provider>
</MemoryRouter>
));
Expand Down
Loading