rusackas commented on code in PR #22772:
URL: https://github.com/apache/superset/pull/22772#discussion_r1086916463
##########
superset-frontend/src/utils/getChartRequiredFieldsMissingMessage.ts:
##########
@@ -19,8 +19,12 @@
import { t } from '@superset-ui/core';
+const CREATE_CHART = t('Create chart');
+const UPDATE_CHART = t('Update chart');
+
export const getChartRequiredFieldsMissingMessage = (isCreating: boolean) =>
t(
'Select values in highlighted field(s) in the control panel. Then run the
query by clicking on the %s button.',
- isCreating ? '"Create chart"' : '"Update chart"',
+ // eslint-disable-next-line prefer-template
+ isCreating ? '"' + CREATE_CHART + '"' : '"' + UPDATE_CHART + '"',
Review Comment:
```suggestion
isCreating ? `"${CREATE_CHART}"` : `"${UPDATE_CHART}"`,
```
Or I guess it could even be
```js
`"${isCreating ? CREATE_CHART : UPDATE_CHART}"`,
```
Or if you don't want the constants, just...
```js
`"${isCreating ? t('Create chart') : t('Update chart')}"`,
```
¯\\\_(ツ)_/¯
--
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]