Skip to content

Commit

Permalink
[EDR Workflows] Fix osquery missing theme in editor issue (#167749)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsonpl authored Oct 13, 2023
1 parent 8931a33 commit a82256b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion x-pack/plugins/osquery/public/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const OsqueryEditorComponent: React.FC<OsqueryEditorProps> = ({
}) => {
const [editorValue, setEditorValue] = useState(defaultValue ?? '');
const [height, setHeight] = useState(MIN_HEIGHT);

useDebounce(
() => {
onChange(editorValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const theme = {
export const initializeOsqueryEditor = () => {
let disposable: IDisposable | null = null;
if (monaco) {
monaco?.editor.defineTheme('osquery', theme);
disposable = monaco.languages.onLanguage('sql', () => {
monaco.languages.setMonarchTokensProvider('sql', {
ignoreCase: true,
Expand Down Expand Up @@ -175,7 +176,6 @@ export const initializeOsqueryEditor = () => {
],
},
});
monaco?.editor.defineTheme('osquery', theme);
monaco?.languages.registerCompletionItemProvider('sql', {
triggerCharacters: ['.'],
provideCompletionItems: (model: monaco.editor.ITextModel, position: monaco.Position) => {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/osquery/public/live_queries/form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { usePacks } from '../../packs/use_packs';
import { useCreateLiveQuery } from '../use_create_live_query_action';
import { useLiveQueryDetails } from '../../actions/use_live_query_details';
import type { AgentSelection } from '../../agents/types';
import { LiveQueryQueryField } from './live_query_query_field';
import LiveQueryQueryField from './live_query_query_field';
import { AgentsTableField } from './agents_table_field';
import { savedQueryDataSerializer } from '../../saved_queries/form/use_saved_query_form';
import { PackFieldWrapper } from '../../shared_components/osquery_response_action_type/pack_field_wrapper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const LiveQueryQueryFieldComponent: React.FC<LiveQueryQueryFieldProps> = ({
);
};

export const LiveQueryQueryField = React.memo(LiveQueryQueryFieldComponent);
const LiveQueryQueryField = React.memo(LiveQueryQueryFieldComponent);

// eslint-disable-next-line import/no-default-export
export { LiveQueryQueryField as default };
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { ECSMapping } from '@kbn/osquery-io-ts-types';
import { usePack } from '../../packs/use_pack';
import { QueryPackSelectable } from '../../live_queries/form/query_pack_selectable';
import { useKibana } from '../../common/lib/kibana';
import { LiveQueryQueryField } from '../../live_queries/form/live_query_query_field';
import LiveQueryQueryField from '../../live_queries/form/live_query_query_field';
import { PackFieldWrapper } from './pack_field_wrapper';

interface OsqueryResponseActionsValues {
Expand Down

0 comments on commit a82256b

Please sign in to comment.