diff --git a/public/pages/DefineDetector/components/Datasource/DataSource.tsx b/public/pages/DefineDetector/components/Datasource/DataSource.tsx index 904e1b0b..540605c6 100644 --- a/public/pages/DefineDetector/components/Datasource/DataSource.tsx +++ b/public/pages/DefineDetector/components/Datasource/DataSource.tsx @@ -61,12 +61,11 @@ export function DataSource(props: DataSourceProps) { const { setFieldValue } = useFormikContext(); useEffect(() => { - setFieldValue('index', []); - setFieldValue('timeField', undefined); - setFieldValue('filters', []); - const getInitialIndices = async () => { await dispatch(getIndices(queryText, dataSourceId)); + setFieldValue('index', props.formikProps.values.index); + setFieldValue('timeField', props.formikProps.values.timeField); + setFieldValue('filters', props.formikProps.values.filters); }; getInitialIndices(); }, [dataSourceId]); diff --git a/release-notes/opensearch-anomaly-detection-dashboards.release-notes-2.15.0.0.md b/release-notes/opensearch-anomaly-detection-dashboards.release-notes-2.15.0.0.md index cd288728..dd1c61c5 100644 --- a/release-notes/opensearch-anomaly-detection-dashboards.release-notes-2.15.0.0.md +++ b/release-notes/opensearch-anomaly-detection-dashboards.release-notes-2.15.0.0.md @@ -13,6 +13,7 @@ Compatible with OpenSearch Dashboards 2.15.0 * Fix handling of special characters in categorical values ([#757](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/757)) * Fix Warning Message About Custom Result Index Despite Existing Indices ([#759](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/759)) +* Fix index field not getting populated when editing a detector ([#783](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/783)) ### Maintenance