mirror of https://github.com/apache/superset.git
fix(chart & alert): make to show metrics properly (#19939)
* fix(chart & alert): make to show metrics properly * fix(chart & alert): make to remove duplicate metrics * fix(chart & alert): make to restore metrics control alert slice * fix(chart & alert): make to fix lint issue
This commit is contained in:
parent
4126c365c5
commit
55aef4db3c
|
@ -109,15 +109,19 @@ export default class AlteredSliceTag extends React.Component {
|
|||
if (controlsMap[key]?.type === 'CollectionControl') {
|
||||
return value.map(v => safeStringify(v)).join(', ');
|
||||
}
|
||||
if (controlsMap[key]?.type === 'MetricsControl' && Array.isArray(value)) {
|
||||
const formattedValue = value.map(v => (v.label ? v.label : v));
|
||||
if (
|
||||
controlsMap[key]?.type === 'MetricsControl' &&
|
||||
value.constructor === Array
|
||||
) {
|
||||
const formattedValue = value.map(v => v?.label ?? v);
|
||||
return formattedValue.length ? formattedValue.join(', ') : '[]';
|
||||
}
|
||||
if (typeof value === 'boolean') {
|
||||
return value ? 'true' : 'false';
|
||||
}
|
||||
if (value.constructor === Array) {
|
||||
return value.length ? value.join(', ') : '[]';
|
||||
const formattedValue = value.map(v => v?.label ?? v);
|
||||
return formattedValue.length ? formattedValue.join(', ') : '[]';
|
||||
}
|
||||
if (typeof value === 'string' || typeof value === 'number') {
|
||||
return value;
|
||||
|
|
Loading…
Reference in New Issue