File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/components/ClusterNodes Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -861,14 +861,34 @@ node-details-full-screen
861
861
862
862
const fullScreenClassWrapper = isFullScreen ? 'cluster-full_screen' : 'cluster-terminal-view-container'
863
863
864
+ const getNodeGroupOptions = ( ) => {
865
+ const nodeGroupOptions = nodeGroups . reduce ( ( acc , group ) => {
866
+ if ( group . label ) {
867
+ acc . push ( {
868
+ label : group . label ,
869
+ options : group . options ,
870
+ } )
871
+ } else {
872
+ const options = group . options . map ( ( option ) => ( {
873
+ label : option . label ,
874
+ value : option . value ,
875
+ } ) )
876
+ acc . push ( ...options ) // Flatten the array into the accumulator
877
+ }
878
+ return acc
879
+ } , [ ] )
880
+
881
+ return nodeGroupOptions
882
+ }
883
+
864
884
const selectionListData : TerminalSelectionListDataType = {
865
885
firstRow : [
866
886
{
867
887
type : TerminalWrapperType . REACT_SELECT ,
868
888
classNamePrefix : 'cluster-terminal-node' ,
869
889
title : SELECT_TITLE . NODE ,
870
890
placeholder : 'Select node' ,
871
- options : nodeGroups ,
891
+ options : getNodeGroupOptions ( ) ,
872
892
defaultValue : selectedNodeName ,
873
893
value : selectedNodeName ,
874
894
onChange : onChangeNodes ,
You can’t perform that action at this time.
0 commit comments