From 11b9ffed2be8e9bdf82ff7304e00733776bcfd53 Mon Sep 17 00:00:00 2001 From: YanJin Date: Tue, 6 Feb 2024 13:00:31 +0100 Subject: [PATCH] ARTESCA-11299: disabled edit location for hd location --- src/react/locations/LocationsList.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/react/locations/LocationsList.tsx b/src/react/locations/LocationsList.tsx index aeea45c1b..f758c5031 100644 --- a/src/react/locations/LocationsList.tsx +++ b/src/react/locations/LocationsList.tsx @@ -138,6 +138,9 @@ const ActionButtons = ({ ); }; + const isEditButtonDisabled = + rowValues.isBuiltin || rowValues.type === 'location-scality-hdclient-v2'; + return (
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} /> }