You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/18 17:23:11 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #12116: fix: properly render booleans in FilterBox and explore page data preview

etr2460 commented on a change in pull request #12116:
URL: https://github.com/apache/incubator-superset/pull/12116#discussion_r545976544



##########
File path: superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
##########
@@ -216,7 +216,13 @@ class FilterBox extends React.PureComponent {
       const color = 'lightgrey';
       const backgroundImage = `linear-gradient(to right, ${color}, ${color} ${perc}%, rgba(0,0,0,0) ${perc}%`;
       const style = { backgroundImage };
-      return { value: opt.id, label: opt.id, style };
+      let label = opt.id;
+      if (label === true) {
+        label = t('True');
+      } else if (label === false) {
+        label = t('False');

Review comment:
       I'm actually not sure we want translations here (I know, goes against my usual comments!).
   
   The reason being, we want to display the data as it exists in the table, and I don't know of any SQL dialects that translate the keywords for boolean values. I think `"TRUE"` and `"FALSE"` are probably best here, although would also accept `"true"` and `"false"`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org