mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fixes #42024
(cherry picked from commit 86a22a914d
)
Co-authored-by: Derik Evangelista <derik.evangelista@grafana.com>
This commit is contained in:
parent
4f45b44a71
commit
53140c5b50
@ -70,11 +70,11 @@ describe('Process simple display values', () => {
|
||||
});
|
||||
|
||||
it('array of text', () => {
|
||||
assertSame(['a', 'b', 'c'], processors, { text: 'a,b,c', numeric: NaN });
|
||||
assertSame(['a', 'b', 'c'], processors, { text: 'a, b, c', numeric: NaN });
|
||||
});
|
||||
|
||||
it('array of numbers', () => {
|
||||
assertSame([1, 2, 3], processors, { text: '1,2,3', numeric: NaN });
|
||||
assertSame([1, 2, 3], processors, { text: '1, 2, 3', numeric: NaN });
|
||||
});
|
||||
|
||||
it('empty object', () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Libraries
|
||||
import { toString, toNumber as _toNumber, isEmpty, isBoolean } from 'lodash';
|
||||
import { toString, toNumber as _toNumber, isEmpty, isBoolean, isArray, join } from 'lodash';
|
||||
|
||||
// Types
|
||||
import { Field, FieldType } from '../types/dataFrame';
|
||||
@ -116,6 +116,10 @@ export function getDisplayProcessor(options?: DisplayProcessorOptions): DisplayP
|
||||
}
|
||||
}
|
||||
|
||||
if (text == null && isArray(value)) {
|
||||
text = join(value, ', ');
|
||||
}
|
||||
|
||||
if (text == null) {
|
||||
text = toString(value);
|
||||
if (!text) {
|
||||
|
Loading…
Reference in New Issue
Block a user