Skip to content

Commit

Permalink
fix(THEEDGE-3793): Fix update option showed when all system are updat…
Browse files Browse the repository at this point in the history
…ed 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 <[email protected]>

* Accept PR suggestion

Signed-off-by: Adelia Ferreira <[email protected]>

---------

Signed-off-by: Adelia Ferreira <[email protected]>
  • Loading branch information
adeliaferreira authored Feb 9, 2024
1 parent 3509818 commit 5d8744f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/GroupSystems/GroupImmutableSystems.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -206,6 +205,7 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => {
setCanUpdate(false);
}
}, [deviceData, selected, deviceImageSet]);

return (
<div id="group-systems-table">
{addToGroupModalOpen && (
Expand Down Expand Up @@ -274,9 +274,7 @@ const GroupImmutableSystems = ({ groupName, groupId, ...props }) => {
{
title: (
<ActionDropdownItem
isAriaDisabled={
deviceData && !deviceData.find((obj) => obj === row.id)
}
isAriaDisabled={!deviceData.includes(row.id)}
requiredPermissions={REQUIRED_PERMISSIONS_TO_MODIFY_GROUP(
groupId
)}
Expand Down

0 comments on commit 5d8744f

Please sign in to comment.