From c1edf15ba5032fe20221a5ce86539f879d39f984 Mon Sep 17 00:00:00 2001 From: Thomas Lavocat Date: Fri, 13 Sep 2024 10:55:53 +0200 Subject: [PATCH] [NO-ISSUE] post patternfly5 upgrade on cards After the upgrade to pf5 got complete, and after the fix preventing some CSS to load completely was landed in the console, there was still some work to be done to migrate the cards to the new PF5 ways of doing things. Also a check was left in the cert generation preventing certs to be generated even though cert-manager was installed. --- .../PresetButton/PresetButton.tsx | 53 +++++++++++-------- .../CertSecretSelector/CertSecretSelector.tsx | 6 --- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/src/shared-components/FormView/BrokerProperties/ConfigurationPage/AcceptorsConfigPage/AcceptorConfigSection/PresetButton/PresetButton.tsx b/src/shared-components/FormView/BrokerProperties/ConfigurationPage/AcceptorsConfigPage/AcceptorConfigSection/PresetButton/PresetButton.tsx index c367bea9..f40b83c6 100644 --- a/src/shared-components/FormView/BrokerProperties/ConfigurationPage/AcceptorsConfigPage/AcceptorConfigSection/PresetButton/PresetButton.tsx +++ b/src/shared-components/FormView/BrokerProperties/ConfigurationPage/AcceptorsConfigPage/AcceptorConfigSection/PresetButton/PresetButton.tsx @@ -4,6 +4,7 @@ import { Card, CardBody, CardFooter, + CardHeader, CardTitle, Form, FormFieldGroup, @@ -87,6 +88,17 @@ const AddPresetModal: FC = ({ useHasCertManager(); const isCertMangerDependencySatisfied = hasCertManager && !isLoadingCertManagerAvailability; + const onChange = (event: React.FormEvent) => { + if (event.currentTarget.id === 'certmanagerandingress') { + if (!isCertMangerDependencySatisfied) { + return; + } + if (hasACertManagerAnnotation) { + return; + } + setShowCertManagerForm(!showCertManagerForm); + } + }; return ( = ({ > { - if (!isCertMangerDependencySatisfied) { - return; - } - if (hasACertManagerAnnotation) { - return; - } - setShowCertManagerForm(!showCertManagerForm); - }} isSelectable isSelected={showCertManagerForm} - hasSelectableInput isCompact style={{ 'max-width': '100%' } as CSSProperties} - isDisabled - tabIndex={0} + isDisabled={!isCertMangerDependencySatisfied} > - {t('Annotate_an_acceptor_with_an_issuer')} - {!isCertMangerDependencySatisfied && ( - - <> - - {' Preset disabled as CertManager is missing'} - - - )} -
+ + {t('Annotate_an_acceptor_with_an_issuer')} + {!isCertMangerDependencySatisfied && ( + + <> + + {' Preset disabled as CertManager is missing'} + + + )} + diff --git a/src/shared-components/FormView/BrokerProperties/ConfigurationPage/CertSecretSelector/CertSecretSelector.tsx b/src/shared-components/FormView/BrokerProperties/ConfigurationPage/CertSecretSelector/CertSecretSelector.tsx index cd7b167f..86d32b20 100644 --- a/src/shared-components/FormView/BrokerProperties/ConfigurationPage/CertSecretSelector/CertSecretSelector.tsx +++ b/src/shared-components/FormView/BrokerProperties/ConfigurationPage/CertSecretSelector/CertSecretSelector.tsx @@ -545,12 +545,6 @@ export const CertSecretSelector: FC = ({ 'cert mgr pods: ' + certManagerDeployments.length.toString(), ); - if (certManagerDeployments.length === 0) { - failedSecretGen( - 'No cert-manager found\n' + 'please install cert-manager.', - ); - return; - } if (!certMgrFound) { failedSecretGen( 'No cert-manager found\n' + 'please install cert-manager.',