Skip to content
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
1 change: 1 addition & 0 deletions libs/locales/lib/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
"ai:HTTPS proxy URL": "HTTPS proxy URL",
"ai:HTTPS Proxy URL": "HTTPS Proxy URL",
"ai:I understand that I need to download credentials files prior of proceeding with the cluster installation.": "I understand that I need to download credentials files prior of proceeding with the cluster installation.",
"ai:I'm installing on a disconnected/air-gapped/secured environment": "I'm installing on a disconnected/air-gapped/secured environment",
"ai:If hosts are behind a firewall that requires the use of a proxy, provide additional information about the proxy.": "If hosts are behind a firewall that requires the use of a proxy, provide additional information about the proxy.",
"ai:If not, please start your VMs with the following configuration:": "If not, start your VMs with the following configuration:",
"ai:If the cluster hosts are in a network with a re-encrypting (MITM) proxy or the cluster needs to trust certificates for other purposes (e.g. container image registries).": "If the cluster hosts are in a network with a re-encrypting (MITM) proxy or the cluster needs to trust certificates for other purposes (e.g. container image registries).",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { useLocation } from 'react-router-dom-v5-compat';
import { Grid, GridItem, Switch } from '@patternfly/react-core';
import { Grid, GridItem } from '@patternfly/react-core';
import isUndefined from 'lodash-es/isUndefined.js';
import { Formik, FormikHelpers } from 'formik';
import {
Expand Down Expand Up @@ -32,6 +32,7 @@ import {
ManagedDomain,
} from '@openshift-assisted/types/assisted-installer-service';
import { useFeature } from '../../hooks/use-feature';
import InstallDisconnectedSwitch from './disconnected/InstallDisconnectedSwitch';

type ClusterDetailsFormProps = {
cluster?: Cluster;
Expand Down Expand Up @@ -62,8 +63,7 @@ const ClusterDetailsForm = (props: ClusterDetailsFormProps) => {
navigation,
} = props;

const { installDisconnected, setInstallDisconnected, customManifestsStep, moveNext } =
useClusterWizardContext();
const { customManifestsStep, moveNext } = useClusterWizardContext();
const { search } = useLocation();
const { isViewerMode } = useSelector(selectCurrentClusterPermissionsState);
const { clearAlerts } = useAlerts();
Expand Down Expand Up @@ -166,13 +166,7 @@ const ClusterDetailsForm = (props: ClusterDetailsFormProps) => {
</GridItem>
{!isSingleClusterFeatureEnabled && (
<GridItem>
<Switch
id="disconnected-install-switch"
label="I'm installing on a disconnected/air-gapped/secured environment"
isChecked={installDisconnected}
onChange={(_, checked) => setInstallDisconnected(checked)}
ouiaId="DisconnectedInstall"
/>
<InstallDisconnectedSwitch isDisabled={!!cluster} />
</GridItem>
)}
<GridItem span={12} lg={10} xl={9} xl2={7}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
useTranslation,
} from '../../../../common';
import {
Switch,
Split,
SplitItem,
TextContent,
Expand All @@ -24,10 +23,11 @@ import { useClusterWizardContext } from '../ClusterWizardContext';
import ClusterWizardFooter from '../ClusterWizardFooter';
import ClusterWizardNavigation from '../ClusterWizardNavigation';
import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
import InstallDisconnectedSwitch from './InstallDisconnectedSwitch';

const BasicStep = () => {
const { t } = useTranslation();
const { installDisconnected, setInstallDisconnected, moveNext } = useClusterWizardContext();
const { moveNext } = useClusterWizardContext();

return (
<Formik
Expand Down Expand Up @@ -55,13 +55,7 @@ const BasicStep = () => {
</Split>
</GridItem>
<GridItem>
<Switch
id="disconnected-install-switch"
label="I'm installing on a disconnected/air-gapped/secured environment"
isChecked={installDisconnected}
onChange={(_, checked) => setInstallDisconnected(checked)}
ouiaId="DisconnectedInstall"
/>
<InstallDisconnectedSwitch />
</GridItem>
<GridItem>
<Form id="wizard-cluster-basic-info__form">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as React from 'react';
import { Switch, Tooltip } from '@patternfly/react-core';
import { useClusterWizardContext } from '../ClusterWizardContext';
import { useTranslation } from '../../../../common';

const InstallDisconnectedSwitch = ({ isDisabled }: { isDisabled?: boolean }) => {
const { t } = useTranslation();
const { installDisconnected, setInstallDisconnected } = useClusterWizardContext();

const switchBtn = (
<Switch
id="disconnected-install-switch"
label={t("ai:I'm installing on a disconnected/air-gapped/secured environment")}
isChecked={installDisconnected}
onChange={(_, checked) => setInstallDisconnected(checked)}
ouiaId="DisconnectedInstall"
isDisabled={isDisabled}
/>
);

return isDisabled ? (
<Tooltip
content={<div>{t('ai:This option is not editable after the draft cluster is created')}</div>}
>
{switchBtn}
</Tooltip>
) : (
switchBtn
);
};

export default InstallDisconnectedSwitch;
Loading