File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
DefineDetector/components/Datasource
ReviewAndCreate/components/DataConnectionFlyout Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,15 @@ export function DataSource(props: DataSourceProps) {
146146 const localCluster : ClusterInfo [ ] = getLocalCluster (
147147 opensearchState . clusters
148148 ) ;
149- setFieldValue ( 'clusters' , getVisibleClusterOptions ( localCluster ) ) ;
149+ if ( props . formikProps . values . clusters && props . formikProps . values . clusters . length > 0 ) {
150+ const clusterInfoList : ClusterInfo [ ] = props . formikProps . values . clusters . map ( option => ( {
151+ name : option . cluster ,
152+ localCluster : option . localcluster === 'true' ,
153+ } ) ) ;
154+ setFieldValue ( 'clusters' , getVisibleClusterOptions ( clusterInfoList ) ) ;
155+ } else {
156+ setFieldValue ( 'clusters' , getVisibleClusterOptions ( localCluster ) ) ;
157+ }
150158 }
151159 } , [ opensearchState . clusters ] ) ;
152160
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ const getIndexItemsToDisplay = (props: DataConnectionFlyoutProps) => {
5353 const splitIndex = index . split ( ':' ) ;
5454 let clusterName = shouldSplit ? splitIndex [ 0 ] : props . localClusterName ;
5555 clusterName =
56- clusterName === props . localClusterName
56+ clusterName === props . localClusterName && ! shouldSplit
5757 ? `${ clusterName } (Local)`
5858 : `${ clusterName } (Remote)` ;
5959 const indexName = shouldSplit ? splitIndex [ 1 ] : index ;
You can’t perform that action at this time.
0 commit comments