From 5d8744fdf3ae0ff0e7b6f21a3b84032daa63497c Mon Sep 17 00:00:00 2001 From: Adelia Ferreira Date: Fri, 9 Feb 2024 10:01:24 +0000 Subject: [PATCH] fix(THEEDGE-3793): Fix update option showed when all system are updated in a group (#2144) Fixes https://issues.redhat.com/browse/THEEDGE-3793. * fix: Add conditional to avoid update options to be update when no update is available on group Signed-off-by: Adelia Ferreira * Accept PR suggestion Signed-off-by: Adelia Ferreira --------- Signed-off-by: Adelia Ferreira --- src/components/GroupSystems/GroupImmutableSystems.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/GroupSystems/GroupImmutableSystems.js b/src/components/GroupSystems/GroupImmutableSystems.js index 2bd89d1e7..d0f9298ea 100644 --- a/src/components/GroupSystems/GroupImmutableSystems.js +++ b/src/components/GroupSystems/GroupImmutableSystems.js @@ -131,10 +131,9 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => { enhancedConfig, showTags ); - const mapDeviceIds = mapDefaultData(defaultData.results); const updateInfo = await getUpdateInfo(groupId); - setDeviceData(updateInfo?.update_devices_uuids); + setDeviceData(updateInfo?.update_devices_uuids || []); setDeviceImageSet(updateInfo?.device_image_set_info); const rowInfo = []; let items = []; @@ -206,6 +205,7 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => { setCanUpdate(false); } }, [deviceData, selected, deviceImageSet]); + return (
{addToGroupModalOpen && ( @@ -274,9 +274,7 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => { { title: ( obj === row.id) - } + isAriaDisabled={!deviceData.includes(row.id)} requiredPermissions={REQUIRED_PERMISSIONS_TO_MODIFY_GROUP( groupId )}