Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const availableModes = getAvailableEditorModes(readonly)
const onChangeHandler = this.handleEditorContentChange
const onErrorHandler = this.handleEditorError
const options = {
search: false, // TODO: fix search width
mode: defaultMode,
schema: configSchema,
modes: availableModes,
onChange: onChangeHandler,
onError: onErrorHandler,
}
/** external library which does not be managed by React */
const editor = new JSONEditor(document.getElementById(ELEM_ID_EDITOR_DIALOG), options, initialJSON)
if (defaultMode !== JsonEditorMode.CODE) editor.expandAll()
this.setState({ editor, }) // eslint-disable-line react/no-did-mount-set-state,react/no-set-state
}const defaultMode = getDefaultEditorMode()
const availableModes = getAvailableEditorModes()
const onChangeHandler = this.handleEditorContentChange
const onErrorHandler = this.handleEditorError
const options = {
search: false, // TODO: fix search width
schema: configSchema,
mode: defaultMode,
modes: availableModes,
onChange: onChangeHandler,
onError: onErrorHandler,
}
/** external library which does not be managed by React */
const editor = new JSONEditor(document.getElementById(ELEM_ID), options)
editor.set(SchemaUtil.InitialConnectorConfig)
if (defaultMode !== JsonEditorMode.CODE) editor.expandAll()
this.setState({ editor, }) // eslint-disable-line react/no-did-mount-set-state,react/no-set-state
}