Skip to content

Commit

Permalink
ARTESCA-11299: disabled edit location for hd location
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengYanJin committed May 14, 2024
1 parent 153356a commit 11b9ffe
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/react/locations/LocationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ const ActionButtons = ({
);
};

const isEditButtonDisabled =
rowValues.isBuiltin || rowValues.type === 'location-scality-hdclient-v2';

return (
<div>
<DeleteConfirmation
Expand All @@ -157,11 +160,18 @@ const ActionButtons = ({
onClick={() => history.push(`/locations/${locationName}/edit`)}
type="button"
aria-label="Edit Location"
tooltip={{
overlay: 'Edit Location',
placement: 'top',
}}
disabled={rowValues.isBuiltin}
tooltip={
isEditButtonDisabled
? {
overlay: 'Edit Location is disabled for this location',
placement: 'top',
}
: {
overlay: 'Edit Location',
placement: 'top',
}
}
disabled={isEditButtonDisabled}
/>
<InlineButton
icon={<Icon name="Delete" />}
Expand Down

0 comments on commit 11b9ffe

Please sign in to comment.