mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graphite: bug fix, strip white space from queries before comparing them (#60133)
strip white space from queries before comparing them
This commit is contained in:
parent
4be99c56f6
commit
d5d07894b1
@ -158,7 +158,7 @@ export function handleTargetChanged(state: GraphiteQueryEditorState): void {
|
||||
return;
|
||||
}
|
||||
|
||||
const oldTarget = state.queryModel.target.target;
|
||||
let oldTarget = state.queryModel.target.target;
|
||||
// Interpolate from other queries:
|
||||
// Because of mixed data sources the list may contain queries for non-Graphite data sources. To ensure a valid query
|
||||
// is used for interpolation we should check required properties are passed though in theory it allows to interpolate
|
||||
@ -167,7 +167,11 @@ export function handleTargetChanged(state: GraphiteQueryEditorState): void {
|
||||
(state.queries || []).filter((query) => 'target' in query && typeof (query as GraphiteQuery).target === 'string')
|
||||
);
|
||||
|
||||
if (state.queryModel.target.target !== oldTarget && !state.paused) {
|
||||
// remove spaces from old and new targets
|
||||
const newTarget = state.queryModel.target.target.replace(/\s+/g, '');
|
||||
oldTarget = oldTarget.replace(/\s+/g, '');
|
||||
|
||||
if (newTarget !== oldTarget && !state.paused) {
|
||||
state.refresh();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user