File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
ResourceBrowser/ResourceList Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,15 @@ export default function ClusterSelectionList({
36
36
const [ searchApplied , setSearchApplied ] = useState ( false )
37
37
38
38
useEffect ( ( ) => {
39
+ let filteredClusterOptions = clusterOptions
39
40
if ( window . _env_ . HIDE_DEFAULT_CLUSTER ) {
40
- clusterOptions = clusterOptions . filter ( ( item ) => item . id !== DEFAULT_CLUSTER_ID )
41
+ filteredClusterOptions = clusterOptions . filter ( ( item ) => item . id !== DEFAULT_CLUSTER_ID )
41
42
}
42
43
setClusterList ( [ ] )
43
44
setFilteredClusterList ( [ ] )
44
45
setLastDataSync ( ! lastDataSync )
45
- setClusterList ( clusterOptions )
46
- setFilteredClusterList ( clusterOptions )
46
+ setClusterList ( filteredClusterOptions )
47
+ setFilteredClusterList ( filteredClusterOptions )
47
48
setMinLoader ( false )
48
49
} , [ clusterOptions ] )
49
50
Original file line number Diff line number Diff line change @@ -19,15 +19,16 @@ interface ClusterSelectorType {
19
19
}
20
20
21
21
export default function ClusterSelector ( { onChange, clusterList, clusterId } : ClusterSelectorType ) {
22
+ let filteredClusterList = clusterList
22
23
if ( window . _env_ . HIDE_DEFAULT_CLUSTER ) {
23
- clusterList = clusterList . filter ( ( item ) => Number ( item . value ) !== DEFAULT_CLUSTER_ID )
24
+ filteredClusterList = clusterList . filter ( ( item ) => Number ( item . value ) !== DEFAULT_CLUSTER_ID )
24
25
}
25
- const defaultOption = clusterList . find ( ( item ) => item . value == clusterId )
26
+ const defaultOption = filteredClusterList . find ( ( item ) => item . value == clusterId )
26
27
27
28
return (
28
29
< ReactSelect
29
30
classNamePrefix = "cluster-select-header"
30
- options = { clusterList }
31
+ options = { filteredClusterList }
31
32
onChange = { onChange }
32
33
components = { {
33
34
IndicatorSeparator : null ,
You can’t perform that action at this time.
0 commit comments