Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO-ISSUE] post patternfly5 upgrade on cards #287

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Card,
CardBody,
CardFooter,
CardHeader,
CardTitle,
Form,
FormFieldGroup,
Expand Down Expand Up @@ -87,6 +88,17 @@ const AddPresetModal: FC<AddIssuerAnnotationModalProps> = ({
useHasCertManager();
const isCertMangerDependencySatisfied =
hasCertManager && !isLoadingCertManagerAvailability;
const onChange = (event: React.FormEvent<HTMLInputElement>) => {
if (event.currentTarget.id === 'certmanagerandingress') {
if (!isCertMangerDependencySatisfied) {
return;
}
if (hasACertManagerAnnotation) {
return;
}
setShowCertManagerForm(!showCertManagerForm);
}
};
return (
<Modal
variant={ModalVariant.medium}
Expand Down Expand Up @@ -121,33 +133,30 @@ const AddPresetModal: FC<AddIssuerAnnotationModalProps> = ({
>
<Card
id="selectable-first-card"
onClick={() => {
if (!isCertMangerDependencySatisfied) {
return;
}
if (hasACertManagerAnnotation) {
return;
}
setShowCertManagerForm(!showCertManagerForm);
}}
isSelectable
isSelected={showCertManagerForm}
hasSelectableInput
isCompact
style={{ 'max-width': '100%' } as CSSProperties}
isDisabled
tabIndex={0}
isDisabled={!isCertMangerDependencySatisfied}
>
<CardTitle>{t('Annotate_an_acceptor_with_an_issuer')} </CardTitle>
{!isCertMangerDependencySatisfied && (
<CardFooter>
<>
<ExclamationTriangleIcon />
{' Preset disabled as CertManager is missing'}
</>
</CardFooter>
)}
<br />
<CardHeader
selectableActions={{
selectableActionId: 'certmanagerandingress',
name: 'certmanagerandingress',
variant: 'multiple',
onChange,
}}
>
<CardTitle>{t('Annotate_an_acceptor_with_an_issuer')} </CardTitle>
{!isCertMangerDependencySatisfied && (
<CardFooter>
<>
<ExclamationTriangleIcon />
{' Preset disabled as CertManager is missing'}
</>
</CardFooter>
)}
</CardHeader>
<CardBody>
<SimpleListGroup title="Effects:">
<SimpleList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,6 @@ export const CertSecretSelector: FC<CertSecretSelectorProps> = ({
'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.',
Expand Down
Loading