mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(Annotation Layers): Error when render options with renamed columns (#22453)
This commit is contained in:
parent
88a5d987da
commit
5da09bf341
@ -28,6 +28,7 @@ import {
|
|||||||
validateNonEmpty,
|
validateNonEmpty,
|
||||||
isValidExpression,
|
isValidExpression,
|
||||||
styled,
|
styled,
|
||||||
|
getColumnLabel,
|
||||||
withTheme,
|
withTheme,
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
|
|
||||||
@ -326,7 +327,19 @@ class AnnotationLayer extends React.PureComponent {
|
|||||||
metadata && metadata.canBeAnnotationType(annotationType)
|
metadata && metadata.canBeAnnotationType(annotationType)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.map(x => ({ value: x.id, label: x.title, slice: x })),
|
.map(x => ({
|
||||||
|
value: x.id,
|
||||||
|
label: x.title,
|
||||||
|
slice: {
|
||||||
|
...x,
|
||||||
|
data: {
|
||||||
|
...x.data,
|
||||||
|
groupby: x.data.groupby.map(column =>
|
||||||
|
getColumnLabel(column),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -499,7 +512,7 @@ class AnnotationLayer extends React.PureComponent {
|
|||||||
isSelected
|
isSelected
|
||||||
title={t('Annotation Slice Configuration')}
|
title={t('Annotation Slice Configuration')}
|
||||||
info={t(`This section allows you to configure how to use the slice
|
info={t(`This section allows you to configure how to use the slice
|
||||||
to generate annotations.`)}
|
to generate annotations.`)}
|
||||||
>
|
>
|
||||||
{(annotationType === ANNOTATION_TYPES.EVENT ||
|
{(annotationType === ANNOTATION_TYPES.EVENT ||
|
||||||
annotationType === ANNOTATION_TYPES.INTERVAL) && (
|
annotationType === ANNOTATION_TYPES.INTERVAL) && (
|
||||||
|
Loading…
Reference in New Issue
Block a user