mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Only add option to values dropdown if there is a value (#72524)
Only add option to list if there is a values
This commit is contained in:
parent
f169151143
commit
ab94c9d730
@ -121,11 +121,15 @@ export default class TempoLanguageProvider extends LanguageProvider {
|
|||||||
const response = await this.request(`/api/v2/search/tag/${tag}/values`, query ? { q: query } : {});
|
const response = await this.request(`/api/v2/search/tag/${tag}/values`, query ? { q: query } : {});
|
||||||
let options: Array<SelectableValue<string>> = [];
|
let options: Array<SelectableValue<string>> = [];
|
||||||
if (response && response.tagValues) {
|
if (response && response.tagValues) {
|
||||||
options = response.tagValues.map((v: { type: string; value: string }) => ({
|
response.tagValues.forEach((v: { type: string; value?: string }) => {
|
||||||
type: v.type,
|
if (v.value) {
|
||||||
value: v.value,
|
options.push({
|
||||||
label: v.value,
|
type: v.type,
|
||||||
}));
|
value: v.value,
|
||||||
|
label: v.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user