diff --git a/src/app.scss b/src/app.scss index 1137b3ffd5..08b66f24c0 100644 --- a/src/app.scss +++ b/src/app.scss @@ -6,6 +6,7 @@ // // masthead overrides // + .pf-c-page__header-brand { max-width: 255px; } @@ -114,8 +115,9 @@ // // switch overrides -// // https://github.com/patternfly/patternfly-next/issues/915 +// + .pf-c-switch { .pf-c-switch__label::before { display: none; @@ -145,6 +147,7 @@ .awx-c-modal.pf-c-modal-box { margin: 0; + padding: 24px; width: 600px; .pf-c-modal-box__body { @@ -231,13 +234,21 @@ border-bottom: 1px solid #d7d7d7; } +.at-c-listCardBody { + --pf-c-card__footer--PaddingX: 0; + --pf-c-card__footer--PaddingY: 0; + --pf-c-card__body--PaddingX: 0; + --pf-c-card__body--PaddingY: 0; +} + .awx-c-card { position: relative; } - - +// // PF Alert notification component overrides +// + .pf-c-alert__title { --pf-c-alert__title--PaddingTop: 20px; --pf-c-alert__title--PaddingRight: 20px; @@ -272,17 +283,6 @@ margin-bottom: 10px; } -.orgListAlert-actionBtn{ - margin:0 10px; -} -.orgListDetete-progressBar{ - padding-right: 32px; -} -.orgListDelete-progressBar-noShow{ - display: none; - padding-right: 32px; -} - .awx-c-form-action-group { float: right; display: block; @@ -293,3 +293,66 @@ } } +// +// AlertModal styles +// + +.at-c-alertModal.pf-c-modal-box { + border: 0; + border-left: 56px solid black; + + .at-c-alertModal__icon { + position: absolute; + font-size: 23px; + top: 28px; + left: -39px; + } +} + +.at-c-alertModal--warning.pf-c-modal-box { + border-color: var(--pf-global--warning-color--100); + + .pf-c-title { + color: var(--pf-global--warning-color--200); + } + + .at-c-alertModal__icon { + color: var(--pf-global--warning-color--200); + } +} + +.at-c-alertModal--danger.pf-c-modal-box { + border-color: var(--pf-global--danger-color--100); + + .pf-c-title { + color: var(--pf-global--danger-color--200); + } + + .at-c-alertModal__icon { + color: white; + } +} + +.at-c-alertModal--info.pf-c-modal-box { + border-color: var(--pf-global--info-color--100); + + .pf-c-title { + color: var(--pf-global--info-color--200); + } + + .at-c-alertModal__icon { + color: var(--pf-global--info-color--200); + } +} + +.at-c-alertModal--success.pf-c-modal-box { + border-color: var(--pf-global--success-color--100); + + .pf-c-title { + color: var(--pf-global--success-color--200); + } + + .at-c-alertModal__icon { + color: var(--pf-global--success-color--200); + } +} diff --git a/src/components/AlertModal.jsx b/src/components/AlertModal.jsx new file mode 100644 index 0000000000..264e9cf355 --- /dev/null +++ b/src/components/AlertModal.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import { + Modal +} from '@patternfly/react-core'; + +import { ExclamationTriangleIcon, ExclamationCircleIcon, InfoCircleIcon, CheckCircleIcon } from '@patternfly/react-icons'; + +const getIcon = (variant) => { + let icon; + if (variant === 'warning') { + icon = (); + } else if (variant === 'danger') { + icon = (); + } if (variant === 'info') { + icon = (); + } if (variant === 'success') { + icon = (); + } + return icon; +}; + +export default ({ variant, children, ...props }) => ( + + {children} + {getIcon(variant)} + +); diff --git a/src/pages/Organizations/components/OrganizationAccessList.jsx b/src/pages/Organizations/components/OrganizationAccessList.jsx index abc289ed96..7e31033025 100644 --- a/src/pages/Organizations/components/OrganizationAccessList.jsx +++ b/src/pages/Organizations/components/OrganizationAccessList.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { DataList, DataListItem, DataListCell, Text, - TextContent, TextVariants, Chip, Alert, AlertActionCloseButton, Button + TextContent, TextVariants, Chip, Button } from '@patternfly/react-core'; import { I18n, i18nMark } from '@lingui/react'; @@ -13,6 +13,7 @@ import { Link } from 'react-router-dom'; +import AlertModal from '../../../components/AlertModal'; import Pagination from '../../../components/Pagination'; import DataListToolbar from '../../../components/DataListToolbar'; @@ -333,17 +334,18 @@ class OrganizationAccessList extends React.Component { showExpandCollapse /> {showWarning && ( - } + isOpen={showWarning} + onClose={this.hideWarning} + actions={[ + , + + ]} > {warningMsg} - - - - - + )} {results.map(result => ( diff --git a/src/pages/Organizations/screens/OrganizationsList.jsx b/src/pages/Organizations/screens/OrganizationsList.jsx index 8b38d8fe95..2f50887c79 100644 --- a/src/pages/Organizations/screens/OrganizationsList.jsx +++ b/src/pages/Organizations/screens/OrganizationsList.jsx @@ -5,26 +5,26 @@ import React, { import { withRouter } from 'react-router-dom'; + import { I18n, i18nMark } from '@lingui/react'; import { Trans, t } from '@lingui/macro'; + import { Card, EmptyState, EmptyStateIcon, EmptyStateBody, - Modal, PageSection, PageSectionVariants, Title, - Button, - Progress, - ProgressVariant + Button } from '@patternfly/react-core'; import { CubesIcon } from '@patternfly/react-icons'; import DataListToolbar from '../../../components/DataListToolbar'; import OrganizationListItem from '../components/OrganizationListItem'; import Pagination from '../../../components/Pagination'; +import AlertModal from '../../../components/AlertModal'; import { encodeQueryString, @@ -61,8 +61,6 @@ class OrganizationsList extends Component { selected: [], isModalOpen: false, orgsToDelete: [], - orgsDeleted: [], - deleteSuccess: false, }; @@ -145,10 +143,7 @@ class OrganizationsList extends Component { handleClearOrgsToDelete () { this.setState({ isModalOpen: false, - orgsDeleted: [], - deleteSuccess: false, - orgsToDelete: [], - deleteStarted: false + orgsToDelete: [] }); this.onSelectAll(); } @@ -175,23 +170,13 @@ class OrganizationsList extends Component { } async handleOrgDelete (event) { - const { orgsToDelete, orgsDeleted } = this.state; + const { orgsToDelete } = this.state; const { api } = this.props; - this.setState({ deleteStarted: true }); orgsToDelete.forEach(async (org) => { - try { - const res = await api.destroyOrganization(org.id); - this.setState({ - orgsDeleted: orgsDeleted.concat(res) - }); - } catch { - this.setState({ deleteSuccess: false }); - } finally { - this.setState({ deleteSuccess: true }); + await api.destroyOrganization(org.id); const queryParams = this.getQueryParams(); this.fetchOrganizations(queryParams); - } }); event.preventDefault(); } @@ -261,12 +246,9 @@ class OrganizationsList extends Component { const { count, error, - deleteSuccess, - deleteStarted, loading, noInitialResults, orgsToDelete, - orgsDeleted, page, pageCount, page_size, @@ -283,13 +265,15 @@ class OrganizationsList extends Component { { isModalOpen && ( - Delete, + + ]} > {warningMsg}
@@ -301,24 +285,8 @@ class OrganizationsList extends Component {
))} -
- -

-
- {orgsDeleted.length - ? - : ( - - - - - )} -
-
+ )} {noInitialResults && (