rusackas commented on a change in pull request #19001:
URL: https://github.com/apache/superset/pull/19001#discussion_r823334996
##########
File path:
superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx
##########
@@ -385,11 +385,13 @@ export default class AnnotationLayer extends
React.PureComponent {
description = 'Select the Annotation Layer you would like to use.';
} else {
label = t('Chart');
- description = `Use a pre defined Superset Chart as a source for
annotations and overlays.
- your chart must be one of these visualization types:
- [${this.getSupportedSourceTypes(annotationType)
- .map(x => x.label)
- .join(', ')}]`;
+ description = t(
+ `Use another existing chart as a source for annotations and overlays.
+ Your chart must be one of these visualization types: [%s]`,
+ this.getSupportedSourceTypes(annotationType)
+ .map(x => x.label)
+ .join(', '),
+ );
Review comment:
If this seems to convoluted, you could do it like this:
```suggestion
const supportedTypes = this.getSupportedSourceTypes(annotationType)
.map(x => x.label)
.join(', '),
);
const supportedTypesInstructions = t(
`Use another existing chart as a source for annotations and
overlays.
Your chart must be one of these visualization types`
);
description = `${supportedTypesInstructions}: [{$supportedTypes}]`
```
... but either way works! ¯\\\_(ツ)_/¯
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]