Skip to content

Commit ec43edd

Browse files
matyaxsvennergr
andauthored
Loki/Prometheus Query Editor: Disabled cmd/ctrl+f keybinding within the editor (grafana#86418)
* Prom: disable cmd f within the editor * Loki: disable cmd f within the editor * Update public/app/plugins/datasource/loki/components/monaco-query-field/MonacoQueryField.tsx Co-authored-by: Sven Grossmann <[email protected]> * Monaco: upgrade to 0.34.1 * Loki/Prometheus: allow native search to be displayed * Formatting * Monaco: upgrade to 0.34.1 microsoft/monaco-editor#102 (comment) --------- Co-authored-by: Sven Grossmann <[email protected]>
1 parent 9baf96d commit ec43edd

File tree

10 files changed

+32
-18
lines changed

10 files changed

+32
-18
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@
344344
"ml-regression-simple-linear": "^3.0.0",
345345
"moment": "2.30.1",
346346
"moment-timezone": "0.5.45",
347-
"monaco-editor": "0.34.0",
347+
"monaco-editor": "0.34.1",
348348
"monaco-promql": "1.7.4",
349349
"mousetrap": "1.6.5",
350350
"mousetrap-global-bind": "1.1.0",

packages/grafana-prometheus/src/components/monaco-query-field/MonacoQueryField.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ const MonacoQueryField = (props: Props) => {
222222
'isEditorFocused' + id
223223
);
224224

225+
// Fixes Monaco capturing the search key binding and displaying a useless search box within the Editor.
226+
// See https://github.com/grafana/grafana/issues/85850
227+
monaco.editor.addKeybindingRule({
228+
keybinding: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyF,
229+
command: null,
230+
});
231+
225232
/* Something in this configuration of monaco doesn't bubble up [mod]+K, which the
226233
command palette uses. Pass the event out of monaco manually
227234
*/

packages/grafana-ui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"lodash": "4.17.21",
7676
"micro-memoize": "^4.1.2",
7777
"moment": "2.30.1",
78-
"monaco-editor": "0.34.0",
78+
"monaco-editor": "0.34.1",
7979
"ol": "7.4.0",
8080
"prismjs": "1.29.0",
8181
"rc-cascader": "3.24.1",

public/app/plugins/datasource/azuremonitor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"i18next": "^23.0.0",
1616
"immer": "10.0.4",
1717
"lodash": "4.17.21",
18-
"monaco-editor": "0.34.0",
18+
"monaco-editor": "0.34.1",
1919
"prismjs": "1.29.0",
2020
"react": "18.2.0",
2121
"react-use": "17.5.0",

public/app/plugins/datasource/cloud-monitoring/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"i18next": "^23.0.0",
1717
"immer": "10.0.4",
1818
"lodash": "4.17.21",
19-
"monaco-editor": "0.34.0",
19+
"monaco-editor": "0.34.1",
2020
"prismjs": "1.29.0",
2121
"react": "18.2.0",
2222
"react-use": "17.5.0",

public/app/plugins/datasource/grafana-pyroscope-datasource/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@grafana/ui": "11.1.0-pre",
1212
"fast-deep-equal": "^3.1.3",
1313
"lodash": "4.17.21",
14-
"monaco-editor": "0.34.0",
14+
"monaco-editor": "0.34.1",
1515
"prismjs": "1.29.0",
1616
"react": "18.2.0",
1717
"react-dom": "18.2.0",

public/app/plugins/datasource/loki/components/monaco-query-field/MonacoQueryField.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ const MonacoQueryField = ({
264264
'isEditorFocused' + id
265265
);
266266

267+
// Fixes Monaco capturing the search key binding and displaying a useless search box within the Editor.
268+
// See https://github.com/grafana/grafana/issues/85850
269+
monaco.editor.addKeybindingRule({
270+
keybinding: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyF,
271+
command: null,
272+
});
273+
267274
editor.onDidFocusEditorText(() => {
268275
isEditorFocused.set(true);
269276
if (editor.getValue().trim() === '') {

public/app/plugins/datasource/parca/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@grafana/schema": "11.1.0-pre",
1111
"@grafana/ui": "11.1.0-pre",
1212
"lodash": "4.17.21",
13-
"monaco-editor": "0.34.0",
13+
"monaco-editor": "0.34.1",
1414
"react": "18.2.0",
1515
"react-use": "17.5.0",
1616
"rxjs": "7.8.1",

public/app/plugins/datasource/tempo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"i18next": "^23.0.0",
2626
"lodash": "4.17.21",
2727
"lru-cache": "10.2.0",
28-
"monaco-editor": "0.34.0",
28+
"monaco-editor": "0.34.1",
2929
"prismjs": "1.29.0",
3030
"react": "18.2.0",
3131
"react-dom": "18.2.0",

yarn.lock

+11-11
Original file line numberDiff line numberDiff line change
@@ -3323,7 +3323,7 @@ __metadata:
33233323
i18next: "npm:^23.0.0"
33243324
immer: "npm:10.0.4"
33253325
lodash: "npm:4.17.21"
3326-
monaco-editor: "npm:0.34.0"
3326+
monaco-editor: "npm:0.34.1"
33273327
prismjs: "npm:1.29.0"
33283328
react: "npm:18.2.0"
33293329
react-select-event: "npm:5.5.1"
@@ -3361,7 +3361,7 @@ __metadata:
33613361
fast-deep-equal: "npm:^3.1.3"
33623362
jest: "npm:29.7.0"
33633363
lodash: "npm:4.17.21"
3364-
monaco-editor: "npm:0.34.0"
3364+
monaco-editor: "npm:0.34.1"
33653365
prismjs: "npm:1.29.0"
33663366
react: "npm:18.2.0"
33673367
react-dom: "npm:18.2.0"
@@ -3461,7 +3461,7 @@ __metadata:
34613461
"@types/lodash": "npm:4.17.0"
34623462
"@types/react": "npm:18.2.78"
34633463
lodash: "npm:4.17.21"
3464-
monaco-editor: "npm:0.34.0"
3464+
monaco-editor: "npm:0.34.1"
34653465
react: "npm:18.2.0"
34663466
react-use: "npm:17.5.0"
34673467
rxjs: "npm:7.8.1"
@@ -3501,7 +3501,7 @@ __metadata:
35013501
i18next: "npm:^23.0.0"
35023502
immer: "npm:10.0.4"
35033503
lodash: "npm:4.17.21"
3504-
monaco-editor: "npm:0.34.0"
3504+
monaco-editor: "npm:0.34.1"
35053505
prismjs: "npm:1.29.0"
35063506
react: "npm:18.2.0"
35073507
react-select-event: "npm:5.5.1"
@@ -3555,7 +3555,7 @@ __metadata:
35553555
i18next: "npm:^23.0.0"
35563556
lodash: "npm:4.17.21"
35573557
lru-cache: "npm:10.2.0"
3558-
monaco-editor: "npm:0.34.0"
3558+
monaco-editor: "npm:0.34.1"
35593559
prismjs: "npm:1.29.0"
35603560
react: "npm:18.2.0"
35613561
react-dom: "npm:18.2.0"
@@ -4359,7 +4359,7 @@ __metadata:
43594359
micro-memoize: "npm:^4.1.2"
43604360
mock-raf: "npm:1.0.1"
43614361
moment: "npm:2.30.1"
4362-
monaco-editor: "npm:0.34.0"
4362+
monaco-editor: "npm:0.34.1"
43634363
ol: "npm:7.4.0"
43644364
prismjs: "npm:1.29.0"
43654365
process: "npm:^0.11.10"
@@ -18815,7 +18815,7 @@ __metadata:
1881518815
ml-regression-simple-linear: "npm:^3.0.0"
1881618816
moment: "npm:2.30.1"
1881718817
moment-timezone: "npm:0.5.45"
18818-
monaco-editor: "npm:0.34.0"
18818+
monaco-editor: "npm:0.34.1"
1881918819
monaco-promql: "npm:1.7.4"
1882018820
mousetrap: "npm:1.6.5"
1882118821
mousetrap-global-bind: "npm:1.1.0"
@@ -23202,10 +23202,10 @@ __metadata:
2320223202
languageName: node
2320323203
linkType: hard
2320423204

23205-
"monaco-editor@npm:0.34.0":
23206-
version: 0.34.0
23207-
resolution: "monaco-editor@npm:0.34.0"
23208-
checksum: 10/c7c2c88bc8f83817e67ab55d84a4469af7f5f566cc3df1c27bdd00ad2071b88688b23847608e8c948a445afa543929b7bcd9b5ff5b7b53da15f6f2b628eb76ac
23205+
"monaco-editor@npm:0.34.1":
23206+
version: 0.34.1
23207+
resolution: "monaco-editor@npm:0.34.1"
23208+
checksum: 10/50cde6f68f27cd66fbaadb7efe0e6ce46748e4bb552ddaa84451fbda18e5ff970a1fa79371c04618927c1f6348839747e3d4804fe383040bad2137527f8a38e4
2320923209
languageName: node
2321023210
linkType: hard
2321123211

0 commit comments

Comments
 (0)