YuriyKrasilnikov commented on code in PR #37790:
URL: https://github.com/apache/superset/pull/37790#discussion_r2783892774
##########
superset-frontend/src/explore/components/PropertiesModal/index.tsx:
##########
@@ -258,6 +292,18 @@ function PropertiesModal({
// get the owners of this slice
useEffect(() => {
fetchChartProperties();
+ if (isFeatureEnabled(FeatureFlag.EnableContentLocalization)) {
+ SupersetClient.get({
+ endpoint: '/api/v1/localization/available_locales',
+ }).then(
+ response => {
+ const { locales, default_locale } = response.json.result;
+ setAllLocales(locales);
+ setDefaultLocale(default_locale);
+ },
+ err => logging.error('Failed to fetch available locales', err),
Review Comment:
Same intentional design as Dashboard PropertiesModal (commit \`c01af6ab12\`).
\`showError\` calls \`addDangerToast\` — showing a red error toast for a
background locales fetch that the user didn't trigger is poor UX. Additionally,
\`showError\` expects \`getClientErrorObject\` output (\`{error, statusText,
message}\`), not a raw rejection — using it directly would require extra
wrapping for no user benefit.
The modal works perfectly without locales — title, description, owners,
cache timeout, certification, tags all function normally. Silent
\`logging.error\` is the correct choice.
--
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]