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

Paragon StatusAlert deprecation #562

Merged
merged 17 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f4fa6be
refactor: updated StatusAlert to Alert in SearchError component
abdullahwaheed Jun 21, 2022
b6287d0
refactor: updated StatusAlert to Alert in SearchNoResults component
abdullahwaheed Jun 21, 2022
206ba7a
refactor: updated StatusAlert to Alert in SearchCourseCard component
abdullahwaheed Jun 21, 2022
da3d602
refactor: updated StatusAlert to Alert in SearchProgramCard component
abdullahwaheed Jun 21, 2022
799c024
refactor: updated StatusAlert to Alert in SkillsCourse component
abdullahwaheed Jun 21, 2022
1cc05d9
refactor: upgraded paragon version to include required icons
abdullahwaheed Jul 26, 2022
2584f3e
fix: fixed custom styling and icon issues as suggested in the review
abdullahwaheed Jul 26, 2022
f9429ef
Merge branch 'master' of github.com:openedx/frontend-app-learner-port…
abdullahwaheed Jul 26, 2022
e71023a
refactor: reverted paragon version as it was breaking other code and …
abdullahwaheed Jul 27, 2022
c24084c
refactor: updated paragon, used paragon icon in place of font awesome
abdullahwaheed Sep 20, 2022
ccaf7f0
Merge branch 'master' of github.com:openedx/frontend-app-learner-port…
abdullahwaheed Sep 20, 2022
719ea48
Merge branch 'master' of github.com:openedx/frontend-app-learner-port…
abdullahwaheed Sep 23, 2022
ccd4c59
Merge branch 'master' of github.com:openedx/frontend-app-learner-port…
abdullahwaheed Nov 22, 2022
8c09495
Merge branch 'master' of github.com:openedx/frontend-app-learner-port…
abdullahwaheed Jan 6, 2023
82ced2e
Merge branch 'master' into abdullahwaheed/pagaron-status-alert-deprec…
abdullahwaheed Jan 13, 2023
b15c201
Merge branch 'master' into abdullahwaheed/pagaron-status-alert-deprec…
adamstankiewicz Jan 30, 2023
f67e0df
Merge branch 'master' into abdullahwaheed/pagaron-status-alert-deprec…
abdullahwaheed Jan 31, 2023
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
22 changes: 10 additions & 12 deletions src/components/search/SearchError.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { StatusAlert } from '@edx/paragon';
import { Alert } from '@edx/paragon';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { getSearchErrorMessage } from '../utils/search';
Expand All @@ -10,26 +10,24 @@ const SearchError = ({ title }) => {
const renderDialog = useCallback(
() => (
<div className="lead d-flex align-items-center py-3">
abdullahwaheed marked this conversation as resolved.
Show resolved Hide resolved
<div className="mr-3">
<FontAwesomeIcon icon={faExclamationTriangle} size="2x" />
</div>
<div>
<Alert.Heading>
{searchErrorMessage.messageTitle}
<br />
{searchErrorMessage.messageContent}
</div>
</Alert.Heading>
{searchErrorMessage.messageContent}
</div>
),
[],
);

return (
<StatusAlert
alertType="danger"
dialog={renderDialog()}
<Alert
variant="danger"
dismissible={false}
icon={() => <FontAwesomeIcon icon={faExclamationTriangle} size="2x" />}
abdullahwaheed marked this conversation as resolved.
Show resolved Hide resolved
open
/>
>
{renderDialog()}
abdullahwaheed marked this conversation as resolved.
Show resolved Hide resolved
</Alert>
);
};

Expand Down
24 changes: 10 additions & 14 deletions src/components/search/SearchNoResults.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { StatusAlert } from '@edx/paragon';
import { Alert } from '@edx/paragon';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSearchMinus } from '@fortawesome/free-solid-svg-icons';

Expand All @@ -12,28 +12,24 @@ const SearchNoResults = ({ title }) => {
const renderDialog = useCallback(
() => (
<div className="lead d-flex align-items-center py-3">
<div className="mr-3">
<FontAwesomeIcon icon={faSearchMinus} size="2x" />
</div>
<div>
{noResultsMessage.messageTitle}
<br />
{noResultsMessage.messageContent}
</div>
<Alert.Heading>{noResultsMessage.messageTitle}</Alert.Heading>
{noResultsMessage.messageContent}
</div>
),
[],
);

return (
<>
<StatusAlert
<Alert
className="mb-5"
alertType="info"
dialog={renderDialog()}
variant="info"
dismissible={false}
open
/>
icon={() => <FontAwesomeIcon icon={faSearchMinus} size="2x" />}
show
>
{renderDialog()}
</Alert>
<PopularResults title={title} />
</>
);
Expand Down
17 changes: 8 additions & 9 deletions src/components/skills-quiz/SearchCourseCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, {
import PropTypes from 'prop-types';
import { AppContext } from '@edx/frontend-platform/react';
import { SearchContext } from '@edx/frontend-enterprise-catalog-search';
import { StatusAlert } from '@edx/paragon';
import { Alert } from '@edx/paragon';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSearchMinus } from '@fortawesome/free-solid-svg-icons';
import { camelCaseObject } from '@edx/frontend-platform/utils';
Expand All @@ -19,9 +19,6 @@ import { SubsidyRequestsContext } from '../enterprise-subsidy-requests';

const renderDialog = () => (
<div className="lead d-flex align-items-center py-3">
<div className="mr-3">
<FontAwesomeIcon icon={faSearchMinus} size="2x" />
</div>
<p>
{ NO_COURSES_ALERT_MESSAGE }
</p>
Expand Down Expand Up @@ -100,13 +97,15 @@ const SearchCourseCard = ({ index }) => {
</div>
<div>
{ hitCount === 0 && (
<StatusAlert
<Alert
className="mt-4 mb-5"
alertType="info"
dialog={renderDialog()}
variant="info"
dismissible={false}
open
/>
icon={() => <FontAwesomeIcon icon={faSearchMinus} size="2x" />}
show
>
{renderDialog()}
</Alert>
)}
</div>
</div>
Expand Down
17 changes: 8 additions & 9 deletions src/components/skills-quiz/SearchProgramCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AppContext } from '@edx/frontend-platform/react';
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
import { camelCaseObject } from '@edx/frontend-platform/utils';
import {
Badge, Card, Icon, StatusAlert,
Badge, Card, Icon, Alert,
} from '@edx/paragon';
import { Program } from '@edx/paragon/icons';
import { sendEnterpriseTrackEvent } from '@edx/frontend-enterprise-utils';
Expand Down Expand Up @@ -46,9 +46,6 @@ const linkToProgram = (program, slug, enterpriseUUID, programUuid) => {

const renderDialog = () => (
<div className="lead d-flex align-items-center py-3">
<div className="mr-3">
<FontAwesomeIcon icon={faSearchMinus} size="2x" />
</div>
<p>
{ NO_PROGRAMS_ALERT_MESSAGE }
</p>
Expand Down Expand Up @@ -284,13 +281,15 @@ const SearchProgramCard = ({ index }) => {
</div>
<div>
{ hitCount === 0 && (
<StatusAlert
<Alert
className="mt-4 mb-5"
alertType="info"
dialog={renderDialog()}
variant="info"
dismissible={false}
open
/>
icon={() => <FontAwesomeIcon icon={faSearchMinus} size="2x" />}
show
>
{renderDialog()}
</Alert>
)}
</div>
</div>
Expand Down
17 changes: 8 additions & 9 deletions src/components/skills-quiz/SkillsCourses.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {
useEffect, useState, useContext, useMemo,
} from 'react';
import { Badge, StatusAlert } from '@edx/paragon';
import { Badge, Alert } from '@edx/paragon';
import {
SearchContext,
} from '@edx/frontend-enterprise-catalog-search';
Expand All @@ -27,9 +27,6 @@ import { SubsidyRequestsContext } from '../enterprise-subsidy-requests';

const renderDialog = () => (
<div className="lead d-flex align-items-center py-3">
<div className="mr-3">
<FontAwesomeIcon icon={faSearchMinus} size="2x" />
</div>
<p>
{ NO_COURSES_ALERT_MESSAGE_AGAINST_SKILLS }
</p>
Expand Down Expand Up @@ -153,13 +150,15 @@ const SkillsCourses = ({ index }) => {
))}
<div>
{ hitCount === 0 && (
<StatusAlert
<Alert
className="mt-4 mb-5"
alertType="info"
dialog={renderDialog()}
variant="info"
dismissible={false}
open
/>
icon={() => <FontAwesomeIcon icon={faSearchMinus} size="2x" />}
show
>
{renderDialog()}
</Alert>
)}
</div>
</div>
Expand Down