mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] AIOps: Fix query string for the metric chart (#181314)
## Summary Fixes https://github.com/elastic/kibana/issues/179814 Query string from the Unified Search query bar was applying to the change point agg request, but wasn't in sync with the query service to correctly render the chart preview. With the PR the query string is synchronized and metric charts are rendered correctly. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This commit is contained in:
parent
e2c39c93ac
commit
2bd49f5ae4
1 changed files with 9 additions and 2 deletions
|
@ -132,7 +132,7 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => {
|
|||
const {
|
||||
uiSettings,
|
||||
data: {
|
||||
query: { filterManager },
|
||||
query: { filterManager, queryString },
|
||||
},
|
||||
} = useAiopsAppContext();
|
||||
|
||||
|
@ -241,11 +241,18 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => {
|
|||
if (requestParamsFromUrl.filters) {
|
||||
filterManager.setFilters(requestParamsFromUrl.filters);
|
||||
}
|
||||
if (requestParamsFromUrl.query) {
|
||||
queryString.setQuery(requestParamsFromUrl.query);
|
||||
}
|
||||
if (globalFilters) {
|
||||
filterManager?.addFilters(globalFilters);
|
||||
}
|
||||
return () => {
|
||||
filterManager?.removeAll();
|
||||
queryString.clearQuery();
|
||||
};
|
||||
},
|
||||
[requestParamsFromUrl.filters, filterManager]
|
||||
[requestParamsFromUrl.filters, requestParamsFromUrl.query, filterManager, queryString]
|
||||
);
|
||||
|
||||
const combinedQuery = useMemo(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue