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/05/21 18:26:42 UTC

[GitHub] [incubator-superset] felixcodes commented on a change in pull request #7569: [WIP] Separate vis-specific controls from centralized controls

felixcodes commented on a change in pull request #7569: [WIP] Separate vis-specific controls from centralized controls
URL: https://github.com/apache/incubator-superset/pull/7569#discussion_r286164124
 
 

 ##########
 File path: superset/assets/src/explore/controlUtils.js
 ##########
 @@ -44,29 +44,37 @@ export function validateControl(control) {
   return control;
 }
 
-export function getControlKeys(vizType, datasourceType) {
-  const controlKeys = [];
-  sectionsToRender(vizType, datasourceType).forEach(
-    section => section.controlSetRows.forEach(
-      fieldsetRow => fieldsetRow.forEach(
-        (field) => {
-          if (typeof field === 'string') {
-            controlKeys.push(field);
-          }
-        })));
-  return controlKeys;
+function isControlObject(controlKey) {
+  return !(controlKey in controls);
 }
 
 export function getControlConfig(controlKey, vizType) {
   // Gets the control definition, applies overrides, and executes
   // the mapStatetoProps
   const vizConf = controlPanelConfigs[vizType] || {};
   const controlOverrides = vizConf.controlOverrides || {};
-  const control = {
+
+  if (isControlObject(controlKey)) {
+    for (const section of vizConf.controlPanelSections) {
 
 Review comment:
   TODO: flatmap + filter

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