mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Template Variables: Input field in dashboard does not send network requests for query var with ${__searchFilter} (#67839)
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
This commit is contained in:
@@ -64,20 +64,24 @@ export const filterOrSearchOptions = (
|
|||||||
const { id, queryValue } = getVariablesState(rootStateKey, getState()).optionsPicker;
|
const { id, queryValue } = getVariablesState(rootStateKey, getState()).optionsPicker;
|
||||||
const identifier: KeyedVariableIdentifier = { id, rootStateKey: rootStateKey, type: 'query' };
|
const identifier: KeyedVariableIdentifier = { id, rootStateKey: rootStateKey, type: 'query' };
|
||||||
const variable = getVariable(identifier, getState());
|
const variable = getVariable(identifier, getState());
|
||||||
if (!hasOptions(variable)) {
|
|
||||||
|
if (!('options' in variable)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { query, options } = variable;
|
|
||||||
dispatch(toKeyedAction(rootStateKey, updateSearchQuery(searchQuery)));
|
dispatch(toKeyedAction(rootStateKey, updateSearchQuery(searchQuery)));
|
||||||
|
|
||||||
if (trim(queryValue) === trim(searchQuery)) {
|
if (trim(queryValue) === trim(searchQuery)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (containsSearchFilter(query)) {
|
const { query, options } = variable;
|
||||||
|
|
||||||
|
const queryTarget = typeof query === 'string' ? query : query.target;
|
||||||
|
if (containsSearchFilter(queryTarget)) {
|
||||||
return searchForOptionsWithDebounce(dispatch, getState, searchQuery, rootStateKey);
|
return searchForOptionsWithDebounce(dispatch, getState, searchQuery, rootStateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dispatch(toKeyedAction(rootStateKey, updateOptionsAndFilter(options)));
|
return dispatch(toKeyedAction(rootStateKey, updateOptionsAndFilter(options)));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user