From ef85a321bc1fc070f8aa58775c95226d35976a86 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Thu, 8 Oct 2020 12:24:25 -0400 Subject: [PATCH] brings all lists in line with exsiting Ad Hoc workflow --- .../InventoryGroupHostList.jsx | 30 +++---------------- .../InventoryRelatedGroupList.jsx | 10 +++---- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.jsx index 15b5db3475..91e8981f82 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.jsx @@ -25,7 +25,7 @@ import DisassociateButton from '../../../components/DisassociateButton'; import { Kebabified } from '../../../contexts/Kebabified'; import AdHocCommands from '../../../components/AdHocCommands/AdHocCommands'; import InventoryGroupHostListItem from './InventoryGroupHostListItem'; -import AddHostDropdown from '../shared/AddDropdown'; +import AddDropdown from '../shared/AddDropdown'; const QS_CONFIG = getQSConfig('host', { page: 1, @@ -185,7 +185,7 @@ function InventoryGroupHostList({ i18n }) { ); } - // const addButton = ; + const addButton = ; return ( <> setIsModalOpen(true)} - onAddNew={() => history.push(addFormUrl)} - newTitle={i18n._(t`Add new host`)} - existingTitle={i18n._(t`Add existing host`)} - label={i18n._(t`host`)} - />, - ] - : []), + ...(canAdd ? [addButton] : []), {({ isKebabified }) => isKebabified ? ( @@ -299,18 +288,7 @@ function InventoryGroupHostList({ i18n }) { onSelect={() => handleSelect(o)} /> )} - emptyStateControls={ - canAdd && ( - setIsModalOpen(true)} - onAddNew={() => history.push(addFormUrl)} - newTitle={i18n._(t`Add new host`)} - existingTitle={i18n._(t`Add existing host`)} - label={i18n._(t`host`)} - /> - ) - } + emptyStateControls={canAdd && addButton} /> {isModalOpen && ( {({ isKebabified }) => isKebabified ? ( - )} - + ) : ( - )} - + )