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/01/13 18:52:47 UTC

[GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #8949: [filter_box] Fix ; separated filter_box default values

graceguo-supercat commented on a change in pull request #8949: [filter_box] Fix ; separated filter_box default values
URL: https://github.com/apache/incubator-superset/pull/8949#discussion_r365968772
 
 

 ##########
 File path: superset/assets/src/dashboard/util/getFilterConfigsFromFormdata.js
 ##########
 @@ -31,9 +31,15 @@ export default function getFilterConfigsFromFormdata(form_data = {}) {
   } = form_data;
   let configs = filter_configs.reduce(
     ({ columns, labels }, config) => {
+      let defaultValues = config.defaultValue;
+      // defaultValue could be ; separated values,
+      // could be null or ''
+      if (config.defaultValue) {
+        defaultValues = config.defaultValue.split(';');
 
 Review comment:
   Yeah, this is how filter_box component handle initial values:
   https://github.com/apache/incubator-superset/blob/a96eae46af852ba22ba1f2427333bc7d03ebd6c1/superset/assets/src/visualizations/FilterBox/FilterBox.jsx#L241
   
   from the above line, i feel array is preferred type.

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


With regards,
Apache Git Services

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