Skip to content

Commit

Permalink
fix the bug that index field is not getting populated when editing a … (
Browse files Browse the repository at this point in the history
#783)

* fix the bug that index field is not getting populated when editing a detector

Signed-off-by: Jackie Han <[email protected]>

* update documentation

Signed-off-by: Jackie Han <[email protected]>

---------

Signed-off-by: Jackie Han <[email protected]>
  • Loading branch information
jackiehanyang authored Jun 11, 2024
1 parent 17003ad commit 2198a20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2198a20

Please sign in to comment.