Skip to content

Commit

Permalink
fix(chart & alert): make to fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
prosdev0107 committed May 5, 2022
1 parent 30d7f09 commit 057e5d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions superset-frontend/src/components/AlteredSliceTag/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,18 @@ export default class AlteredSliceTag extends React.Component {
if (controlsMap[key]?.type === 'CollectionControl') {
return value.map(v => safeStringify(v)).join(', ');
}
if (controlsMap[key]?.type === 'MetricsControl' && value.constructor === Array) {
const formattedValue = value.map(v => (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) {
const formattedValue = value.map(v => (v?.label ?? v));
const formattedValue = value.map(v => v?.label ?? v);
return formattedValue.length ? formattedValue.join(', ') : '[]';
}
if (typeof value === 'string' || typeof value === 'number') {
Expand Down

0 comments on commit 057e5d3

Please sign in to comment.