Skip to content

Commit

Permalink
fix(Annotation Layers): Error when render options with renamed columns (
Browse files Browse the repository at this point in the history
apache#22453)

(cherry picked from commit 5da09bf)
  • Loading branch information
Always-prog authored and AnushaErrabelli committed Jan 30, 2023
1 parent fba90f4 commit 59cac36
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
validateNonEmpty,
isValidExpression,
styled,
getColumnLabel,
withTheme,
} from '@superset-ui/core';

Expand Down Expand Up @@ -326,7 +327,19 @@ class AnnotationLayer extends React.PureComponent {
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),
),
},
},
})),
});
},
);
Expand Down Expand Up @@ -499,7 +512,7 @@ class AnnotationLayer extends React.PureComponent {
isSelected
title={t('Annotation Slice Configuration')}
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.INTERVAL) && (
Expand Down

0 comments on commit 59cac36

Please sign in to comment.