feat(ui): allow readonly flux editor

pull/5767/head
Pavel Zavora 2021-06-11 11:42:29 +02:00
parent 98e95d0493
commit e9523f8ffd
1 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,7 @@ interface Props {
onSubmitScript: () => void
suggestions: Suggestion[]
onCursorChange?: (position: Position) => void
readOnly?: boolean
}
interface Widget extends LineWidget {
@ -85,12 +86,12 @@ class FluxScriptEditor extends PureComponent<Props, State> {
}
public render() {
const {children} = this.props
const {children, readOnly} = this.props
const options = {
tabIndex: 1,
mode: 'flux',
readonly: false,
readOnly: !!readOnly,
lineNumbers: true,
autoRefresh: true,
indentUnit: 2,
@ -101,6 +102,7 @@ class FluxScriptEditor extends PureComponent<Props, State> {
gutters: ['error-gutter'],
autoFocus: true,
}
console.log(options)
return (
<div className="flux-script-editor" onMouseEnter={this.handleMouseEnter}>