mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Fix wrongly escaped label values when using LabelFilter (#59812)
* change backticks to quotes * add unescaping to `addFilterAsLabelFilter` * fix removal of wrong quotes * change unescape order
This commit is contained in:
@@ -571,6 +571,21 @@ describe('buildVisualQueryFromString', () => {
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('parses simple query with quotes in label value', () => {
|
||||
expect(buildVisualQueryFromString('{app="\\"frontend\\""}')).toEqual(
|
||||
noErrors({
|
||||
labels: [
|
||||
{
|
||||
op: '=',
|
||||
value: '\\"frontend\\"',
|
||||
label: 'app',
|
||||
},
|
||||
],
|
||||
operations: [],
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
function noErrors(query: LokiVisualQuery) {
|
||||
|
||||
Reference in New Issue
Block a user