From 960b099dd550bb1eb182d2b19f19436dcd9d1b2b Mon Sep 17 00:00:00 2001 From: Ashley McEntee <123661468+ashley-o0o@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:16:44 -0500 Subject: [PATCH] Hide disabled kebab for connections owned by DSC (#3642) --- .../ConnectionTypesTableRow.tsx | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx b/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx index d7d53e7741..f027ba85c3 100644 --- a/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx +++ b/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx @@ -146,21 +146,27 @@ const ConnectionTypesTableRow: React.FC = ({ title: 'Preview', onClick: () => setShowPreview(true), }, - { - title: 'Edit', - onClick: () => navigate(`/connectionTypes/edit/${obj.metadata.name}`), - isDisabled: ownedByDSC(obj), - }, + ...(!ownedByDSC(obj) + ? [ + { + title: 'Edit', + onClick: () => navigate(`/connectionTypes/edit/${obj.metadata.name}`), + }, + ] + : []), { title: 'Duplicate', onClick: () => navigate(`/connectionTypes/duplicate/${obj.metadata.name}`), }, - { isSeparator: true }, - { - title: 'Delete', - onClick: () => handleDelete(obj), - isDisabled: ownedByDSC(obj), - }, + ...(!ownedByDSC(obj) + ? [ + { isSeparator: true }, + { + title: 'Delete', + onClick: () => handleDelete(obj), + }, + ] + : []), ]} />