Skip to content

Commit

Permalink
feat(THEEDGE-3758): show both tabs when adding systems to group
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ldjebran committed Dec 11, 2023
1 parent 64c5f6c commit 9056bf0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/GroupSystems/GroupImmutableSystems.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => {
}}
groupId={groupId}
groupName={groupName}
edgeParityIsAllowed={true}
initialActiveTab={1}
/>
)}
{removeHostsFromGroupModalOpen && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/GroupSystems/GroupSystems.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ const GroupSystems = ({ groupName, groupId }) => {
}}
groupId={groupId}
groupName={groupName}
edgeParityIsAllowed={true}
initialActiveTab={0}
/>
)}
{removeHostsFromGroupModalOpen && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const AddSystemsToGroupModal = ({
groupId,
groupName,
edgeParityIsAllowed,
initialActiveTab,
}) => {
const dispatch = useDispatch();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -288,6 +291,7 @@ AddSystemsToGroupModal.propTypes = {
groupId: PropTypes.string,
groupName: PropTypes.string,
edgeParityIsAllowed: PropTypes.bool,
initialActiveTab: PropTypes.number,
};

export default AddSystemsToGroupModal;

0 comments on commit 9056bf0

Please sign in to comment.