From 1a8323c15b141850fcddca56636e3227d6e9a380 Mon Sep 17 00:00:00 2001 From: Jackie Han Date: Tue, 11 Jun 2024 16:44:47 -0700 Subject: [PATCH 1/2] fix the bug that index field is not getting populated when editing a detector Signed-off-by: Jackie Han --- .../DefineDetector/components/Datasource/DataSource.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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]); From ee2bb57dcb2a35dcdc1a4100a3240258b0a50ad5 Mon Sep 17 00:00:00 2001 From: Jackie Han Date: Tue, 11 Jun 2024 16:54:24 -0700 Subject: [PATCH 2/2] update documentation Signed-off-by: Jackie Han --- ...search-anomaly-detection-dashboards.release-notes-2.15.0.0.md | 1 + 1 file changed, 1 insertion(+) 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