kgabryje commented on a change in pull request #10889:
URL: 
https://github.com/apache/incubator-superset/pull/10889#discussion_r490112300



##########
File path: superset-frontend/src/explore/controlUtils.js
##########
@@ -52,21 +52,18 @@ export function validateControl(control, processedState) {
  * Find control item from control panel config.
  */
 function findControlItem(controlPanelSections, controlKey) {
-  for (const section of controlPanelSections) {
-    for (const controlArr of section.controlSetRows) {
-      for (const control of controlArr) {
-        if (controlKey === control) return control;
-        if (
-          control !== null &&
-          typeof control === 'object' &&
-          control.name === controlKey
-        ) {
-          return control;
-        }
-      }
-    }
-  }
-  return null;
+  return (

Review comment:
       I added some tests and created a separate fixtures file for 
controlPanelSections




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