Skip to content

Commit fbd1386

Browse files
committed
ARTESCA-15484: Simplify the signature of the DeleteEndpoint component
1 parent 4e49550 commit fbd1386

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/react/endpoint/DeleteEndpoint.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import { useShellHooks } from '@scality/module-federation';
1313

1414
export const DeleteEndpoint = ({
1515
hostname,
16-
endpointsDeletionDisabledMap,
16+
disabled,
1717
}: {
1818
hostname: string;
19-
endpointsDeletionDisabledMap: Record<string, boolean>;
19+
disabled: boolean;
2020
}) => {
2121
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = useState(false);
2222
const accountsLocationsEndpointsAdapter =
@@ -61,7 +61,7 @@ export const DeleteEndpoint = ({
6161
}
6262
}, [waiterStatus, refetchAccountsLocationsEndpointsMutation]);
6363

64-
const tooltipMessage = endpointsDeletionDisabledMap[hostname]
64+
const tooltipMessage = disabled
6565
? 'This Data Service can not be deleted'
6666
: 'Delete Data Service';
6767

@@ -77,7 +77,7 @@ export const DeleteEndpoint = ({
7777
titleText={`Are you sure you want to delete Data Service: ${hostname} ?`}
7878
/>
7979
<T.ActionButton
80-
disabled={endpointsDeletionDisabledMap[hostname]}
80+
disabled={disabled}
8181
icon={<Icon name="Delete" />}
8282
tooltip={{
8383
overlay: tooltipMessage,

src/react/endpoint/EndpointList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function EndpointList({ endpoints, locations }: Props) {
127127
return (
128128
<DeleteEndpoint
129129
hostname={original.hostname}
130-
endpointsDeletionDisabledMap={endpointsDeletionDisabledMap}
130+
disabled={endpointsDeletionDisabledMap[original.hostname]}
131131
/>
132132
);
133133
} else if (

0 commit comments

Comments
 (0)