diff --git a/libs/ui-lib/lib/common/api/assisted-service/ClustersAPI.ts b/libs/ui-lib/lib/common/api/assisted-service/ClustersAPI.ts index 5a9ccc8ae4..18ddb622f0 100644 --- a/libs/ui-lib/lib/common/api/assisted-service/ClustersAPI.ts +++ b/libs/ui-lib/lib/common/api/assisted-service/ClustersAPI.ts @@ -245,12 +245,6 @@ const ClustersAPI = { headers: { 'Content-Type': 'application/json' }, }); }, - registerDisconnected(params: { name: string; openshiftVersion: string }) { - return client.post, { name: string; openshiftVersion: string }>( - `${ClustersAPI.makeBaseURI()}disconnected`, - params, - ); - }, }; export default ClustersAPI; diff --git a/libs/ui-lib/lib/common/components/ui/WizardFooter.tsx b/libs/ui-lib/lib/common/components/ui/WizardFooter.tsx index 54f2b6871f..b4bae5e9bc 100644 --- a/libs/ui-lib/lib/common/components/ui/WizardFooter.tsx +++ b/libs/ui-lib/lib/common/components/ui/WizardFooter.tsx @@ -69,7 +69,7 @@ export const WizardFooter: React.FC = ({ variant={ButtonVariant.primary} name="next" onClick={onNext} - isDisabled={isNextDisabled || isSubmitting} + isDisabled={isNextDisabled} isLoading={isNextButtonLoading} > {nextButtonText || t('ai:Next')} diff --git a/libs/ui-lib/lib/common/components/ui/formik/PullSecretField.tsx b/libs/ui-lib/lib/common/components/ui/formik/PullSecretField.tsx index dfcf5462f6..77dd0a308e 100644 --- a/libs/ui-lib/lib/common/components/ui/formik/PullSecretField.tsx +++ b/libs/ui-lib/lib/common/components/ui/formik/PullSecretField.tsx @@ -67,7 +67,6 @@ const GetPullSecretHelperText: React.FC<{ isOcm: boolean }> = ({ isOcm }) => { const PullSecretField: React.FC<{ isOcm: boolean }> = ({ isOcm }) => { const { t } = useTranslation(); - return ( }> - }> - } /> - + } /> } /> } /> diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx index a0e5d36c09..bb10d049ec 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx @@ -213,7 +213,6 @@ export const VirtualIPControlGroup = ({ name="apiVips.0.ip" helperText={ipHelperText} isRequired - maxLength={45} labelInfo={isDualStack ? 'Primary' : undefined} onChange={(e) => setVipValueAtIndex('apiVips', 0, e as React.ChangeEvent) @@ -230,7 +229,6 @@ export const VirtualIPControlGroup = ({ } name="apiVips.1.ip" helperText={ipHelperText} - maxLength={45} labelInfo={'Secondary'} onChange={(e) => setVipValueAtIndex('apiVips', 1, e as React.ChangeEvent) @@ -248,7 +246,6 @@ export const VirtualIPControlGroup = ({ } helperText={ipHelperText} isRequired - maxLength={45} labelInfo={isDualStack ? 'Primary' : undefined} onChange={(e) => setVipValueAtIndex('ingressVips', 0, e as React.ChangeEvent) @@ -265,7 +262,6 @@ export const VirtualIPControlGroup = ({ } helperText={ipHelperText} - maxLength={45} labelInfo={'Secondary'} onChange={(e) => setVipValueAtIndex( diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx index 9c7522ca9a..cf790da2b6 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx @@ -3,7 +3,6 @@ import { HostsNetworkConfigurationType } from '../../services'; import { StaticIpView } from '../clusterConfiguration/staticIp/data/dataTypes'; import { ClusterWizardStepsType } from './wizardTransition'; import { UISettingsValues } from '../../../common'; -import { InfraEnv } from '@openshift-assisted/types/assisted-installer-service'; export type ClusterWizardContextType = { currentStepId: ClusterWizardStepsType; @@ -21,8 +20,6 @@ export type ClusterWizardContextType = { uiSettings?: UISettingsValues; installDisconnected: boolean; setInstallDisconnected: (enabled: boolean) => void; - disconnectedInfraEnv?: InfraEnv; - setDisconnectedInfraEnv: (infraEnv: InfraEnv | undefined) => void; }; export const ClusterWizardContext = React.createContext(null); diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx index 40c3c83991..216e1860a9 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx @@ -92,9 +92,6 @@ const ClusterWizardContextProvider = ({ const [wizardPerPage, setWizardPerPage] = React.useState(10); const [customManifestsStep, setCustomManifestsStep] = React.useState(false); const [installDisconnected, setInstallDisconnected] = React.useState(false); - const [disconnectedInfraEnv, setDisconnectedInfraEnv] = React.useState( - infraEnv, - ); const location = useLocation(); const locationState = location.state as ClusterWizardFlowStateType | undefined; const { @@ -262,8 +259,6 @@ const ClusterWizardContextProvider = ({ connectedWizardStepIds?.length && onSetCurrentStepId(connectedWizardStepIds[0]); } }, - disconnectedInfraEnv, - setDisconnectedInfraEnv, }; }, [ wizardStepIds, @@ -278,7 +273,6 @@ const ClusterWizardContextProvider = ({ installDisconnected, setInstallDisconnected, connectedWizardStepIds, - disconnectedInfraEnv, ]); if (!contextValue) { diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx index c714ea4073..1925c56de7 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx @@ -17,8 +17,6 @@ import { onFetchEvents } from '../fetching/fetchEvents'; import { Cluster } from '@openshift-assisted/types/assisted-installer-service'; import { useFeature } from '../../hooks/use-feature'; import { useModalDialogsContext } from '../hosts/ModalDialogsContext'; -import ClustersService from '../../services/ClustersService'; -import { handleApiError, getApiErrorMessage } from '../../../common/api'; type ClusterValidationSectionProps = { cluster?: Cluster; @@ -73,7 +71,6 @@ type ClusterWizardFooterProps = WizardFooterGenericProps & { errorFields?: string[]; alertTitle?: string; alertContent?: string | null; - disconnectedClusterId?: string; }; const ClusterWizardFooter = ({ @@ -83,37 +80,19 @@ const ClusterWizardFooter = ({ alertTitle, alertContent, onCancel, - disconnectedClusterId, ...rest }: ClusterWizardFooterProps) => { - const { alerts, addAlert } = useAlerts(); + const { alerts } = useAlerts(); const navigate = useNavigate(); const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE'); const { currentStepId } = useClusterWizardContext(); const { resetSingleClusterDialog } = useModalDialogsContext(); - const { setDisconnectedInfraEnv } = useClusterWizardContext(); - const handleCancel = React.useCallback(async () => { - if (disconnectedClusterId) { - try { - await ClustersService.remove(disconnectedClusterId); - } catch (e) { - handleApiError(e, () => - addAlert({ - title: 'Failed to remove cluster', - message: getApiErrorMessage(e), - }), - ); - } - } - setDisconnectedInfraEnv(undefined); - navigate('/cluster-list'); - }, [navigate, setDisconnectedInfraEnv, addAlert, disconnectedClusterId]); + const handleCancel = React.useCallback(() => navigate('/cluster-list'), [navigate]); - const handleReset = React.useCallback( - () => resetSingleClusterDialog.open({ cluster }), - [resetSingleClusterDialog, cluster], - ); + const handleReset = React.useCallback(() => { + resetSingleClusterDialog.open({ cluster }); + }, [resetSingleClusterDialog, cluster]); const alertsSection = alerts.length ? : undefined; diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx index bb657e9dd3..a2f3943d12 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx @@ -4,7 +4,6 @@ import ClusterDetails from './ClusterDetails'; import { useClusterWizardContext } from './ClusterWizardContext'; import ReviewStep from './disconnected/ReviewStep'; import BasicStep from './disconnected/BasicStep'; -import OptionalConfigurationsStep from './disconnected/OptionalConfigurationsStep'; import { ClusterWizardStepsType } from './wizardTransition'; const getCurrentStep = (currentStepId: ClusterWizardStepsType) => { @@ -13,8 +12,6 @@ const getCurrentStep = (currentStepId: ClusterWizardStepsType) => { return ; case 'disconnected-basic': return ; - case 'disconnected-optional-configurations': - return ; default: return ; } diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/constants.ts b/libs/ui-lib/lib/ocm/components/clusterWizard/constants.ts index 869e940bae..0977dd0e0c 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/constants.ts +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/constants.ts @@ -14,7 +14,6 @@ export const wizardStepNames: { [key in ClusterWizardStepsType]: string } = { 'credentials-download': 'Download credentials', 'disconnected-review': 'Review and download ISO', 'disconnected-basic': 'Basic information', - 'disconnected-optional-configurations': 'Optional configurations', }; export const defaultWizardSteps: ClusterWizardStepsType[] = [ diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx index 184134c343..13858c63f5 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx @@ -15,53 +15,10 @@ import ClusterWizardNavigation from '../ClusterWizardNavigation'; import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary'; import InstallDisconnectedSwitch from './InstallDisconnectedSwitch'; import { Formik } from 'formik'; -import ClustersService from '../../../services/ClustersService'; -import { handleApiError, getApiErrorMessage } from '../../../../common/api'; -import { useAlerts } from '../../../../common/components/AlertsContextProvider'; -import { AlertVariant } from '@patternfly/react-core'; -import { ClusterWizardFlowStateNew } from '../wizardTransition'; -import { useLocation, useNavigate } from 'react-router-dom-v5-compat'; -import { AxiosResponse } from 'axios'; -import { Cluster } from '@openshift-assisted/types//assisted-installer-service'; const BasicStep = () => { const { t } = useTranslation(); const { moveNext } = useClusterWizardContext(); - const { addAlert } = useAlerts(); - const [isSubmitting, setIsSubmitting] = React.useState(false); - const navigate = useNavigate(); - const location = useLocation(); - const currentPath = location.pathname; - let disconnectedClusterId: string | undefined; - - const onNext = async () => { - try { - setIsSubmitting(true); - // Create cluster only - infraEnv will be created in OptionalConfigurationsStep - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - const { data: disconnectedCluster }: AxiosResponse = - // eslint-disable-next-line @typescript-eslint/no-unsafe-call - await ClustersService.registerDisconnected({ - name: 'disconnected-cluster', - openshiftVersion: '4.20', - }); - disconnectedClusterId = disconnectedCluster.id; - navigate(`${currentPath}/${disconnectedClusterId}`, { - state: ClusterWizardFlowStateNew, - }); - moveNext(); - } catch (error: unknown) { - handleApiError(error, () => { - addAlert({ - title: 'Failed to create disconnected cluster', - message: getApiErrorMessage(error), - variant: AlertVariant.danger, - }); - }); - } finally { - setIsSubmitting(false); - } - }; return ( { > } - footer={ - { - void onNext(); - }} - isSubmitting={isSubmitting} - disconnectedClusterId={disconnectedClusterId} - /> - } + footer={} > diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx deleted file mode 100644 index be3f90fe6c..0000000000 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx +++ /dev/null @@ -1,201 +0,0 @@ -import * as React from 'react'; -import { Formik, useFormikContext } from 'formik'; -import * as Yup from 'yup'; -import { - ClusterWizardStep, - TechnologyPreview, - getRichTextValidation, - sshPublicKeyValidationSchema, - pullSecretValidationSchema, - getFormikErrorFields, -} from '../../../../common'; -import { Split, SplitItem, Grid, GridItem, Form, Content, Checkbox } from '@patternfly/react-core'; -import { useClusterWizardContext } from '../ClusterWizardContext'; -import ClusterWizardFooter from '../ClusterWizardFooter'; -import ClusterWizardNavigation from '../ClusterWizardNavigation'; -import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary'; -import UploadSSH from '../../../../common/components/clusterConfiguration/UploadSSH'; -import PullSecretField from '../../../../common/components/ui/formik/PullSecretField'; -import { isInOcm, handleApiError, getApiErrorMessage } from '../../../../common/api'; -import { useAlerts } from '../../../../common/components/AlertsContextProvider'; -import { AlertVariant } from '@patternfly/react-core'; -import InfraEnvsService from '../../../services/InfraEnvsService'; -import { InfraEnvsAPI } from '../../../services/apis'; -import usePullSecret from '../../../hooks/usePullSecret'; -import { useParams } from 'react-router-dom-v5-compat'; -import ClustersService from '../../../services/ClustersService'; -import { Cluster } from '@openshift-assisted/types/assisted-installer-service'; - -type OptionalConfigurationsFormValues = { - sshPublicKey?: string; - pullSecret?: string; -}; - -const PullSecretSync: React.FC<{ pullSecret?: string }> = ({ pullSecret }) => { - const { setFieldValue } = useFormikContext(); - - React.useEffect(() => { - if (pullSecret !== undefined) { - setFieldValue('pullSecret', pullSecret); - } - }, [pullSecret, setFieldValue]); - - return null; -}; - -const OptionalConfigurationsStep = () => { - const pullSecret = usePullSecret() || ''; - const { clusterId } = useParams<{ clusterId: string }>(); - const [cluster, setCluster] = React.useState(null); - - const { moveNext, moveBack, setDisconnectedInfraEnv, disconnectedInfraEnv } = - useClusterWizardContext(); - const { addAlert } = useAlerts(); - const [editPullSecret, setEditPullSecret] = React.useState(false); - - React.useEffect(() => { - const fetchCluster = async () => { - if (!clusterId) { - return; - } - try { - const fetchedCluster = await ClustersService.get(clusterId); - setCluster(fetchedCluster); - } catch (error) { - handleApiError(error, () => { - addAlert({ - title: 'Failed to fetch cluster', - message: getApiErrorMessage(error), - variant: AlertVariant.danger, - }); - }); - } - }; - void fetchCluster(); - }, [clusterId, addAlert]); - - const validationSchema = React.useMemo( - () => - Yup.object().shape({ - sshPublicKey: sshPublicKeyValidationSchema, - pullSecret: pullSecretValidationSchema, - }), - [], - ); - - const initialValues: OptionalConfigurationsFormValues = { - sshPublicKey: '', - pullSecret: pullSecret, - }; - - return ( - (validationSchema)} - onSubmit={async (values) => { - if (!cluster || !cluster.id) { - addAlert({ - title: 'Missing cluster', - message: 'Cluster must be created before configuring infrastructure environment', - variant: AlertVariant.danger, - }); - return; - } - - try { - // Check if infraEnv already exists - if (disconnectedInfraEnv && disconnectedInfraEnv.id) { - // Update existing infraEnv - const updateParams = { - pullSecret: values.pullSecret || pullSecret, - ...(values.sshPublicKey && { sshAuthorizedKey: values.sshPublicKey }), - }; - const { data: updatedInfraEnv } = await InfraEnvsAPI.update( - disconnectedInfraEnv.id, - updateParams, - ); - setDisconnectedInfraEnv(updatedInfraEnv); - moveNext(); - } else { - // Create infraEnv with all params - const createParams = { - name: `disconnected-cluster_infra-env`, - pullSecret: values.pullSecret || pullSecret, - clusterId: cluster.id, - openshiftVersion: cluster.openshiftVersion, - cpuArchitecture: 'x86_64' as const, - ...(values.sshPublicKey && { sshAuthorizedKey: values.sshPublicKey }), - }; - const createdInfraEnv = await InfraEnvsService.create(createParams); - setDisconnectedInfraEnv(createdInfraEnv); - moveNext(); - } - } catch (error) { - handleApiError(error, () => { - addAlert({ - title: - disconnectedInfraEnv && disconnectedInfraEnv.id - ? 'Failed to update infrastructure environment' - : 'Failed to create infrastructure environment', - message: getApiErrorMessage(error), - variant: AlertVariant.danger, - }); - }); - } - }} - > - {({ submitForm, isValid, errors, touched, isSubmitting }) => { - const errorFields = getFormikErrorFields(errors, touched); - const handleNext = () => { - void submitForm(); // This will trigger onSubmit - }; - - return ( - } - footer={ - - } - > - - - - - - - Optional configurations - - - - - - - -
- - setEditPullSecret(checked)} - id="edit-pull-secret-checkbox" - /> - {(editPullSecret || !pullSecret) && } - -
-
-
-
- ); - }} -
- ); -}; - -export default OptionalConfigurationsStep; diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx index 8bc7035e35..70efeb2cca 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx @@ -26,18 +26,15 @@ import { } from '@patternfly/react-core'; import { Formik } from 'formik'; import { saveAs } from 'file-saver'; -import { useNavigate, useParams } from 'react-router-dom-v5-compat'; +import { useNavigate } from 'react-router-dom-v5-compat'; import { getOperatorSpecs } from '../../../../common/components/operators/operatorSpecs'; -import ClustersService from '../../../services/ClustersService'; -import { handleApiError, getApiErrorMessage } from '../../../../common/api'; -import { useAlerts } from '../../../../common/components/AlertsContextProvider'; -import { AlertVariant } from '@patternfly/react-core'; + +const downloadUrl = + 'https://mirror.openshift.com/pub/cgw/assisted-installer-disconnected/4.20.8/agent-ove.x86_64.iso'; const ReviewStep = () => { - const { moveBack, disconnectedInfraEnv, setDisconnectedInfraEnv } = useClusterWizardContext(); - const { clusterId } = useParams<{ clusterId: string }>(); - const { addAlert } = useAlerts(); + const { moveBack } = useClusterWizardContext(); const opSpecs = getOperatorSpecs(() => undefined); const navigate = useNavigate(); @@ -53,40 +50,11 @@ const ReviewStep = () => { footer={ { - void (async () => { - if (disconnectedInfraEnv?.downloadUrl) { - saveAs(disconnectedInfraEnv.downloadUrl); - } - if (clusterId) { - try { - await ClustersService.remove(clusterId); - // Remove infraEnv from wizard context after successful deregistration - setDisconnectedInfraEnv(undefined); - // Navigate to cluster-list only after successful deregistration - navigate('/cluster-list'); - } catch (error) { - handleApiError(error, () => { - addAlert({ - title: 'Failed to deregister cluster', - message: getApiErrorMessage(error), - variant: AlertVariant.danger, - }); - }); - // Error handling: continue with navigation even if deregistration fails - // Still clear the context to avoid stale data - setDisconnectedInfraEnv(undefined); - // Navigate even on error to avoid getting stuck - navigate('/cluster-list'); - } - } else { - // If there's no cluster to deregister, navigate immediately - navigate('/cluster-list'); - } - })(); + downloadUrl && saveAs(downloadUrl); + navigate('/cluster-list'); }} onBack={moveBack} nextButtonText="Download ISO" - disconnectedClusterId={clusterId} /> } > diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/index.ts b/libs/ui-lib/lib/ocm/components/clusterWizard/index.ts index 223c844670..f1e9e41f5b 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/index.ts +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/index.ts @@ -2,5 +2,4 @@ export { default as ClusterDetailsForm } from './ClusterDetailsForm'; export { default as NewClusterWizard } from './NewClusterWizard'; export { default as ClusterWizard } from './ClusterWizard'; export { default as ClusterWizardContextProvider } from './ClusterWizardContextProvider'; -export { useClusterWizardContext } from './ClusterWizardContext'; export { OpenShiftVersionsContextProvider } from './OpenShiftVersionsContext'; diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/wizardTransition.ts b/libs/ui-lib/lib/ocm/components/clusterWizard/wizardTransition.ts index 264064eea6..975858bc91 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/wizardTransition.ts +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/wizardTransition.ts @@ -31,8 +31,7 @@ export type ClusterWizardStepsType = | 'custom-manifests' | 'credentials-download' | 'disconnected-basic' - | 'disconnected-review' - | 'disconnected-optional-configurations'; + | 'disconnected-review'; const wizardStepsOrder: ClusterWizardStepsType[] = [ 'cluster-details', @@ -50,7 +49,6 @@ const wizardStepsOrder: ClusterWizardStepsType[] = [ export const disconnectedSteps: ClusterWizardStepsType[] = [ 'disconnected-basic', - 'disconnected-optional-configurations', 'disconnected-review', ]; @@ -262,7 +260,6 @@ const credentialsValidationMap = buildEmptyValidationsMap(); const customManifestsValidationsMap = buildEmptyValidationsMap(); const disconnectedReviewValidationsMap = buildEmptyValidationsMap(); const disconnectedBasicValidationsMap = buildEmptyValidationsMap(); -const disconnectedOptionalConfigurationsValidationsMap = buildEmptyValidationsMap(); export const wizardStepsValidationsMap: WizardStepsValidationMap = { 'cluster-details': clusterDetailsStepValidationsMap, @@ -278,7 +275,6 @@ export const wizardStepsValidationsMap: WizardStepsValidationMap { - if (!clusterId && !isSingleClusterFeatureEnabled) { + if (!clusterId) { setError('Missing clusterId to load infrastructure environment'); } else if (!infraEnvId) { void findInfraEnvId(); } - }, [clusterId, findInfraEnvId, infraEnvId, isSingleClusterFeatureEnabled]); + }, [clusterId, findInfraEnvId, infraEnvId]); return { infraEnvId, error }; } diff --git a/libs/ui-lib/lib/ocm/services/ClustersService.ts b/libs/ui-lib/lib/ocm/services/ClustersService.ts index b3467041cc..f6c5c94e9e 100644 --- a/libs/ui-lib/lib/ocm/services/ClustersService.ts +++ b/libs/ui-lib/lib/ocm/services/ClustersService.ts @@ -171,11 +171,5 @@ const ClustersService = { this.getUpdateManifestParams(existingManifest, updatedManifest), ); }, - registerDisconnected(params: { name: string; openshiftVersion: string }) { - return ClustersAPI.registerDisconnected({ - name: params.name, - openshiftVersion: params.openshiftVersion, - }); - }, }; export default ClustersService; diff --git a/libs/ui-lib/lib/ocm/services/InfraEnvsService.ts b/libs/ui-lib/lib/ocm/services/InfraEnvsService.ts index 35d5f7ceae..d122399700 100644 --- a/libs/ui-lib/lib/ocm/services/InfraEnvsService.ts +++ b/libs/ui-lib/lib/ocm/services/InfraEnvsService.ts @@ -21,10 +21,7 @@ const InfraEnvsService = { const { data: infraEnvs } = await InfraEnvsAPI.list( !isSingleClusterFeatureEnabled ? clusterId : '', ); - if (isSingleClusterFeatureEnabled) { - return infraEnvs[0].id; - } - if (infraEnvs.length > 0 && clusterId) { + if (infraEnvs.length > 0) { InfraEnvCache.updateInfraEnvs(clusterId, infraEnvs); infraEnvId = InfraEnvCache.getInfraEnvId(clusterId, cpuArchitecture); }