vogievetsky commented on a change in pull request #7242: [Console] Add 
compaction dialog in druid console which allows users to add/edit data source 
compaction configuration
URL: https://github.com/apache/incubator-druid/pull/7242#discussion_r265852188
 
 

 ##########
 File path: web-console/src/components/auto-form.tsx
 ##########
 @@ -100,6 +103,15 @@ export class AutoForm<T> extends 
React.Component<AutoFormProps<T>, AutoFormState
     </HTMLSelect>
   }
 
+  private renderJSONInput(field: Field): JSX.Element {
+    const { model, onChange, JSONErrors, updateJSONErrors } = this.props;
+    return <JSONInput
+      value={(model as any)[field.name]}
+      onChange={(e: any) => onChange(Object.assign({}, model, { [field.name]: 
parseStringToJSON(e)}))}
+      updateErrors={(e: any) => updateJSONErrors!(Object.assign({}, 
JSONErrors, { [field.name]: validJson(e) || e === ''}))}
 
 Review comment:
   why do you force TypeScript here with a `!` ? this is in fact an error and 
will throw an NPE if updateJSONErrors is not provided (it is optional in the API

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