From 9056bf0b67467101793b7d3b1b405884216dfaf5 Mon Sep 17 00:00:00 2001 From: Djebran Lezzoum Date: Mon, 11 Dec 2023 13:45:35 +0100 Subject: [PATCH] feat(THEEDGE-3758): show both tabs when adding systems to group Show both tabs when adding systems to group, when adding conventional systems, conventional tab should be selected by default and when adding immutable systems, immutable tab should be selected by default. FIXES: https://issues.redhat.com/browse/THEEDGE-3758 --- src/components/GroupSystems/GroupImmutableSystems.js | 2 ++ src/components/GroupSystems/GroupSystems.js | 2 ++ .../InventoryGroups/Modals/AddSystemsToGroupModal.js | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/GroupSystems/GroupImmutableSystems.js b/src/components/GroupSystems/GroupImmutableSystems.js index 8a145b003..b27c46056 100644 --- a/src/components/GroupSystems/GroupImmutableSystems.js +++ b/src/components/GroupSystems/GroupImmutableSystems.js @@ -212,6 +212,8 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => { }} groupId={groupId} groupName={groupName} + edgeParityIsAllowed={true} + initialActiveTab={1} /> )} {removeHostsFromGroupModalOpen && ( diff --git a/src/components/GroupSystems/GroupSystems.js b/src/components/GroupSystems/GroupSystems.js index af4614465..61221d130 100644 --- a/src/components/GroupSystems/GroupSystems.js +++ b/src/components/GroupSystems/GroupSystems.js @@ -126,6 +126,8 @@ const GroupSystems = ({ groupName, groupId }) => { }} groupId={groupId} groupName={groupName} + edgeParityIsAllowed={true} + initialActiveTab={0} /> )} {removeHostsFromGroupModalOpen && ( diff --git a/src/components/InventoryGroups/Modals/AddSystemsToGroupModal.js b/src/components/InventoryGroups/Modals/AddSystemsToGroupModal.js index e45612ac1..90af648c8 100644 --- a/src/components/InventoryGroups/Modals/AddSystemsToGroupModal.js +++ b/src/components/InventoryGroups/Modals/AddSystemsToGroupModal.js @@ -38,6 +38,7 @@ const AddSystemsToGroupModal = ({ groupId, groupName, edgeParityIsAllowed, + initialActiveTab, }) => { const dispatch = useDispatch(); @@ -135,7 +136,9 @@ const AddSystemsToGroupModal = ({ alreadyHasGroup.length > 0 || immutableDevicesAlreadyHasGroup.length > 0; const { hasEdgeDevices } = useContext(AccountStatContext); - const [activeTab, setActiveTab] = useState(0); + const [activeTab, setActiveTab] = useState( + initialActiveTab === 0 || initialActiveTab === 1 ? initialActiveTab : 0 + ); const handleTabClick = (_event, tabIndex) => { setActiveTab(tabIndex); @@ -288,6 +291,7 @@ AddSystemsToGroupModal.propTypes = { groupId: PropTypes.string, groupName: PropTypes.string, edgeParityIsAllowed: PropTypes.bool, + initialActiveTab: PropTypes.number, }; export default AddSystemsToGroupModal;