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 2019/08/19 07:47:57 UTC

[GitHub] [incubator-superset] LilianXie commented on issue #8057: Adding support for filter box in annotations

LilianXie commented on issue #8057: Adding support for filter box in annotations
URL: https://github.com/apache/incubator-superset/pull/8057#issuecomment-522453868
 
 
   src/visualizations/FilterBox/FilterBox.jsx
   ```
       // Add created options to filtersChoices, even though it doesn't exist,
       // or these options will exist in query sql but invisible to end user.
       Object.keys(selectedValues)
         .filter(key => !selectedValues.hasOwnProperty(key)
           || !(key in filtersChoices))
         .forEach((key) => {
           const choices = filtersChoices[key] || [];
           const choiceIds = new Set(choices.map(f => f.id));
           Array.isArray(selectedValues[key])?selectedValues[key]:[selectedValues[key]]
             .filter(value => !choiceIds.has(value))
             .forEach((value) => {
               choices.unshift({
                 filter: key,
                 id: value,
                 text: value,
                 metric: 0,
               });
             });
         });
   ```

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