Skip to content

Commit 0458245

Browse files
committed
Disable Nutanix platform integration
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
1 parent 2aca314 commit 0458245

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

libs/ui-lib/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx

+18-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
useNewFeatureSupportLevel,
2626
} from '../../../../common/components/newFeatureSupportLevels';
2727
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
28+
import { useFeature } from '../../../hooks/use-feature';
2829

2930
const INPUT_NAME = 'platform';
3031
const fieldId = getFieldId(INPUT_NAME, 'input');
@@ -47,10 +48,13 @@ const getDisabledReasonForExternalPlatform = (
4748
isSNO: boolean,
4849
newFeatureSupportLevelContext: NewFeatureSupportLevelData,
4950
platform: PlatformType,
51+
isDisconnected: boolean,
5052
featureSupportLevelData?: NewFeatureSupportLevelMap | null,
5153
cpuArchitecture?: SupportedCpuArchitecture,
5254
): string | undefined => {
53-
if (isSNO && (platform === 'nutanix' || platform === 'vsphere')) {
55+
if (isDisconnected && platform === 'nutanix') {
56+
return `Platform integration is not supported for disconnected clusters.`;
57+
} else if (isSNO && (platform === 'nutanix' || platform === 'vsphere')) {
5458
return `${ExternalPlatformLabels[platform]} integration is not supported for Single-Node OpenShift.`;
5559
} else if (
5660
isSNO &&
@@ -69,6 +73,7 @@ const getDisabledReasonForExternalPlatform = (
6973
const getExternalPlatformTypes = (
7074
isSNO: boolean,
7175
newFeatureSupportLevelContext: NewFeatureSupportLevelData,
76+
isDisconnected: boolean,
7277
featureSupportLevelData?: NewFeatureSupportLevelMap | null,
7378
cpuArchitecture?: SupportedCpuArchitecture,
7479
): Partial<{ [key in PlatformType]: ExternalPlatformInfo }> => {
@@ -84,6 +89,7 @@ const getExternalPlatformTypes = (
8489
isSNO,
8590
newFeatureSupportLevelContext,
8691
platform,
92+
isDisconnected,
8793
featureSupportLevelData ?? undefined,
8894
cpuArchitecture,
8995
),
@@ -105,9 +111,15 @@ export const areAllExternalPlatformIntegrationDisabled = (
105111
.every((info) => info.disabledReason !== undefined);
106112
};
107113

108-
const getReasonForDropdownDisabled = (isSNO: boolean, labelCpuArch: string): string => {
109-
if (!isSNO) {
114+
const getReasonForDropdownDisabled = (
115+
isSNO: boolean,
116+
labelCpuArch: string,
117+
isDisconnected: boolean,
118+
): string => {
119+
if (!isSNO && !isDisconnected) {
110120
return `Platform integration is not supported when ${labelCpuArch} is selected`;
121+
} else if (isDisconnected) {
122+
return `Platform integration is not supported for disconnected clusters`;
111123
} else {
112124
return `Platform integration is not supported for SNO clusters`;
113125
}
@@ -124,10 +136,12 @@ export const ExternalPlatformDropdown = ({
124136
const [externalPlatformTypes, setExternalPlatformTypes] = React.useState<
125137
Partial<{ [key in PlatformType]: ExternalPlatformInfo }>
126138
>({});
139+
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
127140

128141
const tooltipDropdownDisabled = getReasonForDropdownDisabled(
129142
isSNO,
130143
cpuArchitecture ? architectureData[cpuArchitecture].label : '',
144+
isSingleClusterFeatureEnabled,
131145
);
132146

133147
const handleClick = (event: MouseEvent<HTMLButtonElement>, href: string) => {
@@ -140,6 +154,7 @@ export const ExternalPlatformDropdown = ({
140154
const updatedExternalPlatformTypes = getExternalPlatformTypes(
141155
isSNO,
142156
newFeatureSupportLevelContext,
157+
isSingleClusterFeatureEnabled,
143158
featureSupportLevelData,
144159
cpuArchitecture,
145160
);

0 commit comments

Comments
 (0)