vogievetsky commented on a change in pull request #9587: Use auto-form for add 
an edit lookups
URL: https://github.com/apache/druid/pull/9587#discussion_r405116898
 
 

 ##########
 File path: web-console/src/dialogs/lookup-edit-dialog/lookup-edit-dialog.tsx
 ##########
 @@ -93,8 +136,45 @@ export const LookupEditDialog = React.memo(function 
LookupEditDialog(props: Look
     }
   }
 
-  const disableSubmit =
-    lookupName === '' || lookupVersion === '' || lookupTier === '' || 
!validJson(lookupSpec);
+  let disableSubmit =
+    lookupName === '' ||
+    lookupVersion === '' ||
+    lookupTier === '' ||
+    lookupSpec.type === '' ||
+    lookupSpec.type === undefined ||
+    (lookupSpec.type === 'map' && lookupSpec.map === undefined) ||
+    (lookupSpec.type === 'cachedNamespace' && lookupSpec.extractionNamespace 
=== undefined);
+
+  if (!disableSubmit && lookupSpec.type === 'cachedNamespace' && 
lookupSpec.extractionNamespace) {
+    const namespaceParseSpec = 
lookupSpec.extractionNamespace.namespaceParseSpec;
 
 Review comment:
   can you extract his whole check into a function please?

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


With regards,
Apache Git Services

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

Reply via email to