Skip to content

Commit 05c5f92

Browse files
jackiehanyanggithub-actions[bot]
authored andcommitted
fix the bug that index field is not getting populated when editing a … (#783)
* fix the bug that index field is not getting populated when editing a detector Signed-off-by: Jackie Han <jkhanjob@gmail.com> * update documentation Signed-off-by: Jackie Han <jkhanjob@gmail.com> --------- Signed-off-by: Jackie Han <jkhanjob@gmail.com> (cherry picked from commit 2198a20)
1 parent 98bf010 commit 05c5f92

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

public/pages/DefineDetector/components/Datasource/DataSource.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ export function DataSource(props: DataSourceProps) {
6161
const { setFieldValue } = useFormikContext();
6262

6363
useEffect(() => {
64-
setFieldValue('index', []);
65-
setFieldValue('timeField', undefined);
66-
setFieldValue('filters', []);
67-
6864
const getInitialIndices = async () => {
6965
await dispatch(getIndices(queryText, dataSourceId));
66+
setFieldValue('index', props.formikProps.values.index);
67+
setFieldValue('timeField', props.formikProps.values.timeField);
68+
setFieldValue('filters', props.formikProps.values.filters);
7069
};
7170
getInitialIndices();
7271
}, [dataSourceId]);

release-notes/opensearch-anomaly-detection-dashboards.release-notes-2.15.0.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Compatible with OpenSearch Dashboards 2.15.0
1313

1414
* Fix handling of special characters in categorical values ([#757](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/757))
1515
* Fix Warning Message About Custom Result Index Despite Existing Indices ([#759](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/759))
16+
* Fix index field not getting populated when editing a detector ([#783](https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/783))
1617

1718
### Maintenance
1819

0 commit comments

Comments
 (0)