YuriyKrasilnikov commented on code in PR #37790:
URL: https://github.com/apache/superset/pull/37790#discussion_r2783889106


##########
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx:
##########
@@ -448,6 +481,19 @@ const PropertiesModal = ({
             t('An error occurred while fetching available themes'),
           );
         });
+
+      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:
   Intentional design. Commit \`c01af6ab12\` explicitly replaced 
\`handleErrorResponse\` with \`logging.error\` here.
   
   The old \`handleErrorResponse\` showed a red danger toast for a background 
auxiliary fetch that the user did not initiate — confusing UX. If the locales 
endpoint fails, the LocaleSwitcher simply renders with no locale options 
(\`allLocales\` stays \`[]\`), and the entire dashboard properties modal works 
normally. This is the correct graceful degradation.
   
   The pattern is consistent across all four integration points (Dashboard 
PropertiesModal, Chart PropertiesModal, FiltersConfigForm, 
AdhocMetricEditPopoverTitle) and follows the established Superset pattern for 
optional auxiliary fetches (cf. \`keyValue.tsx\`).



-- 
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]

Reply via email to