Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make onChange in CodeEditor optional #107128

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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