@@ -25,6 +25,7 @@ import {
25
25
useNewFeatureSupportLevel ,
26
26
} from '../../../../common/components/newFeatureSupportLevels' ;
27
27
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge' ;
28
+ import { useFeature } from '../../../hooks/use-feature' ;
28
29
29
30
const INPUT_NAME = 'platform' ;
30
31
const fieldId = getFieldId ( INPUT_NAME , 'input' ) ;
@@ -66,35 +67,45 @@ const getDisabledReasonForExternalPlatform = (
66
67
}
67
68
} ;
68
69
70
+ const isAvailablePlatform = ( platform : PlatformType ) => ( isDisconnected ?: boolean ) => {
71
+ if ( isDisconnected && platform === 'nutanix' ) {
72
+ return false ;
73
+ }
74
+ return platform !== undefined ;
75
+ } ;
76
+
69
77
const getExternalPlatformTypes = (
70
78
isSNO : boolean ,
71
79
newFeatureSupportLevelContext : NewFeatureSupportLevelData ,
72
80
featureSupportLevelData ?: NewFeatureSupportLevelMap | null ,
73
81
cpuArchitecture ?: SupportedCpuArchitecture ,
82
+ isDisconnected ?: boolean ,
74
83
) : Partial < { [ key in PlatformType ] : ExternalPlatformInfo } > => {
75
84
const platforms = [ 'none' , 'nutanix' , 'external' , 'vsphere' ] as PlatformType [ ] ;
76
85
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
+ ) ;
98
109
} ;
99
110
100
111
export const areAllExternalPlatformIntegrationDisabled = (
@@ -124,6 +135,7 @@ export const ExternalPlatformDropdown = ({
124
135
const [ externalPlatformTypes , setExternalPlatformTypes ] = React . useState <
125
136
Partial < { [ key in PlatformType ] : ExternalPlatformInfo } >
126
137
> ( { } ) ;
138
+ const isSingleClusterFeatureEnabled = useFeature ( 'ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE' ) ;
127
139
128
140
const tooltipDropdownDisabled = getReasonForDropdownDisabled (
129
141
isSNO ,
@@ -142,6 +154,7 @@ export const ExternalPlatformDropdown = ({
142
154
newFeatureSupportLevelContext ,
143
155
featureSupportLevelData ,
144
156
cpuArchitecture ,
157
+ isSingleClusterFeatureEnabled ,
145
158
) ;
146
159
147
160
// Update the state with the new externalPlatformTypes
0 commit comments