ktmud commented on a change in pull request #11708:
URL: 
https://github.com/apache/incubator-superset/pull/11708#discussion_r525359405



##########
File path: superset-frontend/src/explore/components/ControlPanelsContainer.jsx
##########
@@ -185,23 +185,17 @@ class ControlPanelsContainer extends React.Component {
     const querySectionsToRender = [];
     const displaySectionsToRender = [];
     this.sectionsToRender().forEach(section => {
-      // if at least one control in the section is not `renderTrigger`
-      // or asks to be displayed at the Data tab
-      if (
-        section.tabOverride === 'data' ||
-        section.controlSetRows.some(rows =>
-          rows.some(
-            control =>
-              control &&
-              control.config &&
-              (!control.config.renderTrigger ||
-                control.config.tabOverride === 'data'),
-          ),
-        )
-      ) {
+      if (section.tabOverride === 'customize') {
+        displaySectionsToRender.push(section);
+      } else if (section.tabOverride === 'data') {
         querySectionsToRender.push(section);
       } else {
-        displaySectionsToRender.push(section);
+        const allRenderTriggers = section.controlSetRows.every(rows =>
+          rows.every(control => control?.config?.renderTrigger),
+        );
+        // if at least one control in the section is not `renderTrigger`, it 
goes to the query section
+        if (allRenderTriggers) displaySectionsToRender.push(section);
+        else querySectionsToRender.push(section);

Review comment:
       Nit: can we wrap the branches in braces still?

##########
File path: superset-frontend/src/explore/controls.jsx
##########
@@ -49,7 +49,8 @@
      show a warning based on the value of another component. It's also 
possible to bind
      arbitrary data from the redux store to the component this way.
  * - tabOverride: set to 'data' if you want to force a renderTrigger to show 
up on the `Data`
-     tab, otherwise `renderTrigger: true` components will show up on the 
`Style` tab.
+     tab, or 'customize' if you want it to show up on that tam. Otherwise 
sections with ALL 

Review comment:
       ```suggestion
        (default) tab, or 'customize' if you want it to show up on that tab. 
Otherwise sections with ALL 
   ```

##########
File path: superset-frontend/src/explore/controls.jsx
##########
@@ -49,7 +49,8 @@
      show a warning based on the value of another component. It's also 
possible to bind
      arbitrary data from the redux store to the component this way.
  * - tabOverride: set to 'data' if you want to force a renderTrigger to show 
up on the `Data`
-     tab, otherwise `renderTrigger: true` components will show up on the 
`Style` tab.
+     tab, or 'customize' if you want it to show up on that tam. Otherwise 
sections with ALL 

Review comment:
       These are comments for control item, not control section. Since you 
removed this config option for control item, maybe we should just clean this up 
and update the doc for `renderTrigger` instead?




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to