Skip to content

Commit

Permalink
Update editor.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Ibragimov committed Mar 30, 2022
1 parent 74342d5 commit e50a0aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function DevToolsSettingsModal(props: Props) {
<FormattedMessage
id="console.settingsPage.refreshingDataDescription"
defaultMessage="Console refreshes autocomplete suggestions by querying Elasticsearch.
Less frequent refresh is recommended to reduce bandwith costs."
Less frequent refresh is recommended to reduce bandwidth costs."
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Legacy (Ace) Console Editor Component Smoke Test', () => {
<ServicesContextProvider value={mockedAppContextValue}>
<RequestContextProvider>
<EditorContextProvider settings={{} as unknown as DevToolsSettings}>
<Editor initialTextValue="" />
<Editor initialTextValue="" setEditorInstance={() => {}} />
</EditorContextProvider>
</RequestContextProvider>
</ServicesContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ function EditorUI({ initialTextValue, setEditorInstance }: EditorProps) {
editor!.getCoreEditor().getContainer().focus();
}, [settings]);

const { keyboardShortcutsDisabled } = settingsService.toJSON();
useEffect(() => {
const { keyboardShortcutsDisabled } = settings;
if (!keyboardShortcutsDisabled) {
registerCommands({
senseEditor: editorInstanceRef.current!,
sendCurrentRequestToES,
openDocumentation,
});
}
}, [sendCurrentRequestToES, openDocumentation, keyboardShortcutsDisabled]);
}, [sendCurrentRequestToES, openDocumentation, settings]);

useEffect(() => {
const { current: editor } = editorInstanceRef;
Expand Down

0 comments on commit e50a0aa

Please sign in to comment.