mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Update Slate to 0.47.8 (#18412)
* Chore: Update Slate to 0.47.8 Closes #17430 * Add slate and immutable to grafana-ui deps * Fixes some small regressions introduced * Fix suggestions for multiple query fields * Pin upgraded dependencies * Prettier fix * Remove original slate-react dependency * Fix tiny-invariant dep * (Temporarily) comments out source maps for grafana-ui
This commit is contained in:
committed by
Dominik Prokop
parent
e3a69d8023
commit
601853fc84
@@ -16,13 +16,13 @@ export const processHistogramLabels = (labels: string[]) => {
|
||||
return { values: { __name__: result } };
|
||||
};
|
||||
|
||||
export function processLabels(labels: any, withName = false) {
|
||||
export function processLabels(labels: Array<{ [key: string]: string }>, withName = false) {
|
||||
const values: { [key: string]: string[] } = {};
|
||||
labels.forEach((l: any) => {
|
||||
labels.forEach(l => {
|
||||
const { __name__, ...rest } = l;
|
||||
if (withName) {
|
||||
values['__name__'] = values['__name__'] || [];
|
||||
if (values['__name__'].indexOf(__name__) === -1) {
|
||||
if (!values['__name__'].includes(__name__)) {
|
||||
values['__name__'].push(__name__);
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ export function processLabels(labels: any, withName = false) {
|
||||
if (!values[key]) {
|
||||
values[key] = [];
|
||||
}
|
||||
if (values[key].indexOf(rest[key]) === -1) {
|
||||
if (!values[key].includes(rest[key])) {
|
||||
values[key].push(rest[key]);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user