Skip to content

Commit b09c0ca

Browse files
author
Marco
committed
latest
1 parent 8cf4126 commit b09c0ca

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

components/webui/client/src/components/SqlEditor/index.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
useEffect,
44
useImperativeHandle,
55
useRef,
6-
useState,
76
} from "react";
87

98
import {
@@ -59,6 +58,7 @@ const SqlEditor = (props: SqlEditorProps) => {
5958
if (null === monacoEditor) {
6059
return;
6160
}
61+
6262
// Default theme to match AntD input
6363
monacoEditor.editor.defineTheme("default-theme", {
6464
base: "vs",
@@ -67,9 +67,10 @@ const SqlEditor = (props: SqlEditorProps) => {
6767
colors: {
6868
"editor.background": color(token.colorBgContainer).hexa(),
6969
"editor.foreground": color(token.colorText).hexa(),
70-
"focusBorder": "#0000", // transparent
70+
"focusBorder": "#0000",
7171
},
7272
});
73+
7374
// Disabled theme uses vs as base
7475
monacoEditor.editor.defineTheme("disabled-theme", {
7576
base: "vs",
@@ -78,7 +79,7 @@ const SqlEditor = (props: SqlEditorProps) => {
7879
colors: {
7980
"editor.background": color(token.colorBgContainerDisabled).hexa(),
8081
"editor.foreground": color(token.colorTextDisabled).hexa(),
81-
"focusBorder": "#0000", // transparent
82+
"focusBorder": "#0000",
8283
},
8384
});
8485
}, [
@@ -91,41 +92,41 @@ const SqlEditor = (props: SqlEditorProps) => {
9192
style={{
9293
border: `1px solid ${token.colorBorder}`,
9394
borderRadius: token.borderRadius,
94-
pointerEvents: disabled ? "none" : "auto",
95-
}
96-
}
95+
pointerEvents: disabled ?
96+
"none" :
97+
"auto",
98+
}}
9799
>
98100
<Editor
99101
language={"sql"}
100102
loading={
101103
<div
102-
style={{
103-
backgroundColor: token.colorBgContainer,
104-
height: "100%",
105-
width: "100%",
106-
}}/>
104+
style={{
105+
backgroundColor: token.colorBgContainer,
106+
height: "100%",
107+
width: "100%",
108+
}}/>
107109
}
108110
options={{
109111
automaticLayout: true,
110112
folding: false,
111113
lineNumbers: "off",
112114
minimap: {enabled: false},
113115
overviewRulerBorder: false,
116+
padding: {
117+
top: token.paddingXS,
118+
bottom: token.paddingXS,
119+
},
114120
placeholder: "Enter your SQL query",
115121
renderLineHighlight: "none",
116122
scrollBeyondLastLine: false,
117123
wordWrap: "on",
118-
padding: {
119-
top: token.paddingXS,
120-
bottom: token.paddingXS,
121-
},
122124
}}
123125
theme={disabled ?
124126
"disabled-theme" :
125127
"default-theme"}
126128
onMount={handleEditorDidMount}
127-
{...editorProps}
128-
/>
129+
{...editorProps}/>
129130
</div>
130131
);
131132
};

components/webui/client/src/components/SqlEditor/monaco-loader.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
/* eslint-disable import/default, @stylistic/max-len */
1+
/* eslint-disable import/default */
22
import {loader} from "@monaco-editor/react";
33
import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
44
import EditorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
5+
56
import "monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js";
67

78

8-
/* eslint-enable import/default, @stylistic/max-len */
9+
/* eslint-enable import/default */
910

1011

1112
self.MonacoEnvironment = {

components/webui/client/src/pages/SearchPage/SearchControls/QueryStatus/index.module.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

components/webui/client/src/pages/SearchPage/SearchControls/QueryStatus/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {Typography} from "antd";
22

33
import useSearchStore from "../../SearchState/index";
44
import {SEARCH_UI_STATE} from "../../SearchState/typings";
5-
import styles from "./index.module.css";
65
import Results from "./Results";
76

87

0 commit comments

Comments
 (0)