rusackas commented on a change in pull request #11708:
URL:
https://github.com/apache/incubator-superset/pull/11708#discussion_r533130490
##########
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:
OK by me... I might even add a linting rule just for fun ;)
----------------------------------------------------------------
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]