Skip to content

Commit 46cf16a

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

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

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

+34-21
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');
@@ -66,35 +67,45 @@ const getDisabledReasonForExternalPlatform = (
6667
}
6768
};
6869

70+
const isAvailablePlatform = (platform: PlatformType) => (isDisconnected?: boolean) => {
71+
if (isDisconnected && platform === 'nutanix') {
72+
return false;
73+
}
74+
return platform !== undefined;
75+
};
76+
6977
const getExternalPlatformTypes = (
7078
isSNO: boolean,
7179
newFeatureSupportLevelContext: NewFeatureSupportLevelData,
7280
featureSupportLevelData?: NewFeatureSupportLevelMap | null,
7381
cpuArchitecture?: SupportedCpuArchitecture,
82+
isDisconnected?: boolean,
7483
): Partial<{ [key in PlatformType]: ExternalPlatformInfo }> => {
7584
const platforms = ['none', 'nutanix', 'external', 'vsphere'] as PlatformType[];
7685

77-
return platforms.filter(Boolean).reduce(
78-
(a, platform) => ({
79-
...a,
80-
[platform]: {
81-
label: ExternalPlatformLabels[platform],
82-
href: ExternalPlatformLinks[platform],
83-
disabledReason: getDisabledReasonForExternalPlatform(
84-
isSNO,
85-
newFeatureSupportLevelContext,
86-
platform,
87-
featureSupportLevelData ?? undefined,
88-
cpuArchitecture,
89-
),
90-
supportLevel: newFeatureSupportLevelContext.getFeatureSupportLevel(
91-
ExternalPlaformIds[platform] as FeatureId,
92-
featureSupportLevelData ?? undefined,
93-
),
94-
},
95-
}),
96-
{},
97-
);
86+
return platforms
87+
.filter((platform) => isAvailablePlatform(platform)(isDisconnected))
88+
.reduce(
89+
(a, platform) => ({
90+
...a,
91+
[platform]: {
92+
label: ExternalPlatformLabels[platform],
93+
href: ExternalPlatformLinks[platform],
94+
disabledReason: getDisabledReasonForExternalPlatform(
95+
isSNO,
96+
newFeatureSupportLevelContext,
97+
platform,
98+
featureSupportLevelData ?? undefined,
99+
cpuArchitecture,
100+
),
101+
supportLevel: newFeatureSupportLevelContext.getFeatureSupportLevel(
102+
ExternalPlaformIds[platform] as FeatureId,
103+
featureSupportLevelData ?? undefined,
104+
),
105+
},
106+
}),
107+
{},
108+
);
98109
};
99110

100111
export const areAllExternalPlatformIntegrationDisabled = (
@@ -124,6 +135,7 @@ export const ExternalPlatformDropdown = ({
124135
const [externalPlatformTypes, setExternalPlatformTypes] = React.useState<
125136
Partial<{ [key in PlatformType]: ExternalPlatformInfo }>
126137
>({});
138+
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
127139

128140
const tooltipDropdownDisabled = getReasonForDropdownDisabled(
129141
isSNO,
@@ -142,6 +154,7 @@ export const ExternalPlatformDropdown = ({
142154
newFeatureSupportLevelContext,
143155
featureSupportLevelData,
144156
cpuArchitecture,
157+
isSingleClusterFeatureEnabled,
145158
);
146159

147160
// Update the state with the new externalPlatformTypes

0 commit comments

Comments
 (0)