Skip to content

Commit

Permalink
Make onChange in CodeEditor optional (#107128)
Browse files Browse the repository at this point in the history
* Make onChang in CodeEditor optional

* Update api docs
  • Loading branch information
Tim Roes authored Jul 29, 2021
1 parent c98ffa5 commit ff3029f
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 44 deletions.
39 changes: 3 additions & 36 deletions api_docs/kibana_react.json
Original file line number Diff line number Diff line change
Expand Up @@ -3719,48 +3719,15 @@
"label": "onChange",
"description": [],
"signature": [
"(value: string, event: ",
"((value: string, event: ",
"editor",
".IModelContentChangedEvent) => void"
".IModelContentChangedEvent) => void) | undefined"
],
"source": {
"path": "src/plugins/kibana_react/public/url_template_editor/url_template_editor.tsx",
"lineNumber": 27
},
"deprecated": false,
"returnComment": [],
"children": [
{
"parentPluginId": "kibanaReact",
"id": "def-public.value",
"type": "string",
"tags": [],
"label": "value",
"description": [],
"source": {
"path": "src/plugins/kibana_react/public/code_editor/code_editor.tsx",
"lineNumber": 37
},
"deprecated": false
},
{
"parentPluginId": "kibanaReact",
"id": "def-public.event",
"type": "Object",
"tags": [],
"label": "event",
"description": [],
"signature": [
"editor",
".IModelContentChangedEvent"
],
"source": {
"path": "src/plugins/kibana_react/public/code_editor/code_editor.tsx",
"lineNumber": 37
},
"deprecated": false
}
]
"deprecated": false
},
{
"parentPluginId": "kibanaReact",
Expand Down
2 changes: 1 addition & 1 deletion api_docs/kibana_react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kibanaReactObj from './kibana_react.json';

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 260 | 5 | 230 | 4 |
| 258 | 5 | 228 | 4 |

## Client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const JsonCodeEditorCommon = ({
languageId={XJsonLang.ID}
width={width}
value={jsonValue || ''}
onChange={() => {}}
editorDidMount={onEditorDidMount}
aria-label={codeEditorAriaLabel}
options={{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const RequestCodeViewer = ({ json }: RequestCodeViewerProps) => (
<CodeEditor
languageId={XJsonLang.ID}
value={json}
onChange={() => {}}
options={{
readOnly: true,
lineNumbers: 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface Props {
value: string;

/** Function invoked when text in editor is changed */
onChange: (value: string, event: monaco.editor.IModelContentChangedEvent) => void;
onChange?: (value: string, event: monaco.editor.IModelContentChangedEvent) => void;

/**
* Options for the Monaco Code Editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export const SpecViewer = ({ vegaAdapter, ...rest }: SpecViewerProps) => {
<CodeEditor
languageId={XJsonLang.ID}
value={spec}
onChange={() => {}}
options={{
readOnly: true,
lineNumbers: 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const InspectFlyout = ({ uiSettings, searchSession }: InspectFlyoutProps) => {
<CodeEditor
languageId="json"
value={JSON.stringify(searchSession.initialState, null, 2)}
onChange={() => {}}
options={{
readOnly: true,
lineNumbers: 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class ImportCompleteView extends Component<Props, {}> {
<CodeEditor
languageId="json"
value={jsonAsString}
onChange={() => {}}
options={{
readOnly: true,
lineNumbers: 'off',
Expand Down

0 comments on commit ff3029f

Please sign in to comment.