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

MGMT-20083: validation blocks Next button but leave Add Hosts enabled #2858

Closed
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 @@ -117,7 +117,7 @@ const ClusterDeploymentHostsDiscoveryStep = ({
<WizardFooter
activeStep={activeStep}
onNext={onNext}
isNextDisabled={nextRequested || (showFormErrors ? !!errors.length : false)}
isNextDisabled={nextRequested || !!syncError || (showFormErrors ? !!errors.length : false)}
nextButtonText={submittingText || t('ai:Next')}
nextButtonProps={{ isLoading: !!submittingText }}
onBack={goToPrevStep}
Expand All @@ -133,6 +133,7 @@ const ClusterDeploymentHostsDiscoveryStep = ({
onNext,
showFormErrors,
submittingText,
syncError,
t,
],
);
Expand Down
3 changes: 3 additions & 0 deletions libs/ui-lib/lib/cim/components/InfraEnv/AddHostDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import './AddHostDropdown.css';
import { PopoverIcon } from '../../../common';
import { Trans } from 'react-i18next';
import { Link } from 'react-router-dom-v5-compat';
import { ClusterDeploymentWizardContext } from '../ClusterDeployment/ClusterDeploymentWizardContext';

type ModalType = 'iso' | 'bmc' | 'yaml' | 'ipxe' | undefined;

Expand Down Expand Up @@ -45,6 +46,7 @@ const AddHostDropdown = ({
onCreateBmcByYaml,
provisioningConfigResult,
}: AddHostDropdownProps) => {
const { syncError } = React.useContext(ClusterDeploymentWizardContext);
const [addModalType, setAddModalType] = React.useState<ModalType>(undefined);
const [isKebabOpen, setIsKebabOpen] = React.useState(false);
const [provisioningConfig, provisioningConfigLoaded, provisioningConfigError] =
Expand All @@ -59,6 +61,7 @@ const AddHostDropdown = ({
id="dropdown-basic"
onToggle={(_event, value) => setIsKebabOpen(value)}
toggleVariant="primary"
isDisabled={!!syncError}
>
{t('ai:Add hosts')}
</DropdownToggle>
Expand Down
Loading