diff --git a/awx/ui_next/src/components/NotificationList/NotificationList.jsx b/awx/ui_next/src/components/NotificationList/NotificationList.jsx index ed30b364ea..120d9c86b0 100644 --- a/awx/ui_next/src/components/NotificationList/NotificationList.jsx +++ b/awx/ui_next/src/components/NotificationList/NotificationList.jsx @@ -164,7 +164,7 @@ class NotificationList extends Component { } this.setState(stateUpdateFunction); } catch (err) { - this.setState({ toggleError: true }); + this.setState({ toggleError: err }); } finally { this.setState({ toggleLoading: false }); } diff --git a/awx/ui_next/src/components/NotificationList/NotificationListItem.jsx b/awx/ui_next/src/components/NotificationList/NotificationListItem.jsx index 307ad6e1e4..fb4e80cfa9 100644 --- a/awx/ui_next/src/components/NotificationList/NotificationListItem.jsx +++ b/awx/ui_next/src/components/NotificationList/NotificationListItem.jsx @@ -8,8 +8,8 @@ import { DataListItemRow, DataListItemCells, DataListCell as PFDataListCell, + Switch, } from '@patternfly/react-core'; -import Switch from '@components/Switch'; import styled from 'styled-components'; diff --git a/awx/ui_next/src/components/Switch/Switch.jsx b/awx/ui_next/src/components/Switch/Switch.jsx deleted file mode 100644 index f62376e61b..0000000000 --- a/awx/ui_next/src/components/Switch/Switch.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Switch } from '@patternfly/react-core'; -import styled from 'styled-components'; - -Switch.displayName = 'PFSwitch'; -export default styled(Switch)` - display: flex; - flex-wrap: no-wrap; - /* workaround PF bug; used in calculating switch width: */ - --pf-c-switch__toggle-icon--Offset: 0.125rem; -`; diff --git a/awx/ui_next/src/components/Switch/index.js b/awx/ui_next/src/components/Switch/index.js deleted file mode 100644 index ed80f23e5b..0000000000 --- a/awx/ui_next/src/components/Switch/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Switch'; diff --git a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx index a705c87bdc..f3c70b066f 100644 --- a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx +++ b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx @@ -3,7 +3,7 @@ import { Link, useHistory, useParams, useLocation } from 'react-router-dom'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { Host } from '@types'; -import { Button } from '@patternfly/react-core'; +import { Button, Switch } from '@patternfly/react-core'; import { CardBody, CardActionsRow } from '@components/Card'; import AlertModal from '@components/AlertModal'; import ErrorDetail from '@components/ErrorDetail'; @@ -11,7 +11,6 @@ import { DetailList, Detail, UserDateDetail } from '@components/DetailList'; import { VariablesDetail } from '@components/CodeMirrorInput'; import { Sparkline } from '@components/Sparkline'; import DeleteButton from '@components/DeleteButton'; -import Switch from '@components/Switch'; import { HostsAPI } from '@api'; function HostDetail({ host, i18n, onUpdateHost }) { diff --git a/awx/ui_next/src/screens/Host/HostList/HostList.jsx b/awx/ui_next/src/screens/Host/HostList/HostList.jsx index 36ddd8f0dc..a84af76a4c 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostList.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostList.jsx @@ -34,7 +34,7 @@ class HostsList extends Component { selected: [], itemCount: 0, actions: null, - toggleError: false, + toggleError: null, toggleLoading: null, }; @@ -83,7 +83,7 @@ class HostsList extends Component { } handleHostToggleErrorClose() { - this.setState({ toggleError: false }); + this.setState({ toggleError: null }); } async handleHostDelete() { @@ -112,7 +112,7 @@ class HostsList extends Component { ), }); } catch (err) { - this.setState({ toggleError: true }); + this.setState({ toggleError: err }); } finally { this.setState({ toggleLoading: null }); } diff --git a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx index d5523d74ff..bda2b0a7a5 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx @@ -6,6 +6,7 @@ import { DataListItem, DataListItemRow, DataListItemCells, + Switch, Tooltip, } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; @@ -16,7 +17,6 @@ import DataListCell from '@components/DataListCell'; import DataListCheck from '@components/DataListCheck'; import ListActionButton from '@components/ListActionButton'; import { Sparkline } from '@components/Sparkline'; -import Switch from '@components/Switch'; import VerticalSeparator from '@components/VerticalSeparator'; import { Host } from '@types'; diff --git a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx index 439da004c6..46eaff8b02 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx @@ -6,6 +6,7 @@ import { DataListItem, DataListItemRow, DataListItemCells, + Switch, Tooltip, } from '@patternfly/react-core'; import { Link } from 'react-router-dom'; @@ -16,7 +17,6 @@ import DataListCell from '@components/DataListCell'; import DataListCheck from '@components/DataListCheck'; import ListActionButton from '@components/ListActionButton'; import { Sparkline } from '@components/Sparkline'; -import Switch from '@components/Switch'; import VerticalSeparator from '@components/VerticalSeparator'; import { Host } from '@types';