From ea4f80daab23cdd1c391b3214270d06a70d20c0d Mon Sep 17 00:00:00 2001 From: Sharon Gratch Date: Tue, 10 Dec 2024 20:09:53 +0200 Subject: [PATCH] Exclude the 'Edit Provider Credentials' dropdown item for OVA Reference: https://issues.redhat.com/browse/MTV-1766 Since editing the OVA provider cresentials is not supported, exclude this option from the providers dropdown menu items. Signed-off-by: Sharon Gratch --- .../Providers/actions/ProviderActionsDropdownItems.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/forklift-console-plugin/src/modules/Providers/actions/ProviderActionsDropdownItems.tsx b/packages/forklift-console-plugin/src/modules/Providers/actions/ProviderActionsDropdownItems.tsx index 66c7d2948..28aade4d8 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/actions/ProviderActionsDropdownItems.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/actions/ProviderActionsDropdownItems.tsx @@ -24,7 +24,7 @@ export const ProviderActionsDropdownItems = ({ data }: ProviderActionsDropdownIt showModal(); }; - return [ + const dropdownItems = [ {t('Edit Provider')} , @@ -38,6 +38,11 @@ export const ProviderActionsDropdownItems = ({ data }: ProviderActionsDropdownIt {t('Delete Provider')} , ]; + + // excluding the EditCredentials options since not supported for OVA + const ovaDropdownItems = dropdownItems.filter((item) => item.key !== 'EditCredentials'); + + return provider?.spec?.type === 'ova' ? ovaDropdownItems : dropdownItems; }; interface ProviderActionsDropdownItemsProps {