fix(Annotation Layers): Error when render options with renamed columns (#22453)

This commit is contained in:
Stepan 2023-01-25 22:25:34 +03:00 committed by GitHub
parent 88a5d987da
commit 5da09bf341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,7 @@ import {
validateNonEmpty,
isValidExpression,
styled,
getColumnLabel,
withTheme,
} from '@superset-ui/core';
@ -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),
),
},
},
})),
});
},
);