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/02/27 22:12:44 UTC

[GitHub] kristw commented on issue #6956: [WIP] Adding custom control overrides

kristw commented on issue #6956: [WIP] Adding custom control overrides
URL: https://github.com/apache/incubator-superset/pull/6956#issuecomment-468051804
 
 
   Great work! I took a closer look at this and have a few suggestions.
   
   Instead of applying the overrides at individual control panel file (, which will be moved into plugins). Add a single hook at `explore/controlPanels/index.js` and pass all `controlPanelConfigs` to it. 
   
   Current `index.js`
   
   ```js
   const controlPanelConfigs = {
     area: Area,
     bar: Bar,
     big_number: BigNumber,
     ...
   }
   ```
   
   Modified `index.js`
   
   ```js
   import extraOverrides from './extraOverrides';
   
   const controlPanelConfigs = extraOverrides({
     area: Area,
     bar: Bar,
     big_number: BigNumber,
     ...
   })
   ```
   
   `extraOverride.js`
   
   ```js
   export default function extraOverrides(controlPanelConfigs) {
     return controlPanelConfigs;
   }
   ```
   
   Custom `extraOverride.js` in Airbnb deployment
   
   ```js
   export default function extraOverrides(controlPanelConfigs) {
     const newConfigs = {...controlPanelConfigs};
     newConfigs.line = {
       ...newConfigs.line
       controlOverrides: ... // apply override here
     };
     newConfigs.table = {
       ...newConfigs.table
       controlOverrides: ... // apply override here
     };
   
     return newConfigs;
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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