From 8578ba3173bd3e4fa90d8910a20729cc3b743b4e Mon Sep 17 00:00:00 2001 From: YONGJAE LEE Date: Sat, 12 Jul 2025 18:00:03 +0900 Subject: [PATCH 1/5] [ZEPPELIN-6203] fix: connect shortcut for info button --- .../action-bar/action-bar.component.ts | 7 +- .../src/app/share/share.module.ts | 2 + .../share/shortcut/shortcut.component.html | 339 ++++++++++++++++++ .../app/share/shortcut/shortcut.component.ts | 21 ++ 4 files changed, 368 insertions(+), 1 deletion(-) create mode 100644 zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html create mode 100644 zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts diff --git a/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts b/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts index 878648c0c88..fe2f92ec331 100644 --- a/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts +++ b/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts @@ -31,6 +31,7 @@ import { MessageService, NoteStatusService, SaveAsService, TicketService } from import { NotebookService } from '@zeppelin/services/notebook.service'; import { NoteCreateComponent } from '@zeppelin/share/note-create/note-create.component'; +import { ShortcutComponent } from '@zeppelin/share/shortcut/shortcut.component'; @Component({ selector: 'zeppelin-notebook-action-bar', @@ -246,7 +247,11 @@ export class NotebookActionBarComponent extends MessageListenersManager implemen } showShortCut() { - // TODO(hsuanxyz) + this.nzModalService.info({ + nzTitle: `Shortcut Info`, + nzWidth: '600px', + nzContent: ShortcutComponent + }); } togglePermissions() { diff --git a/zeppelin-web-angular/src/app/share/share.module.ts b/zeppelin-web-angular/src/app/share/share.module.ts index e864e9a6965..25cf7fc2f8c 100644 --- a/zeppelin-web-angular/src/app/share/share.module.ts +++ b/zeppelin-web-angular/src/app/share/share.module.ts @@ -51,6 +51,7 @@ import { NoteTocComponent } from '@zeppelin/share/note-toc/note-toc.component'; import { PageHeaderComponent } from '@zeppelin/share/page-header/page-header.component'; import { HumanizeBytesPipe } from '@zeppelin/share/pipes'; import { RunScriptsDirective } from '@zeppelin/share/run-scripts/run-scripts.directive'; +import { ShortcutComponent } from '@zeppelin/share/shortcut/shortcut.component'; import { SpinComponent } from '@zeppelin/share/spin/spin.component'; import { ResizeHandleComponent } from './resize-handle'; @@ -58,6 +59,7 @@ const MODAL_LIST = [ AboutZeppelinComponent, NoteImportComponent, NoteCreateComponent, + ShortcutComponent, NoteRenameComponent, FolderRenameComponent ]; diff --git a/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html new file mode 100644 index 00000000000..5ede0537c26 --- /dev/null +++ b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html @@ -0,0 +1,339 @@ + + + diff --git a/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts new file mode 100644 index 00000000000..b91815b4615 --- /dev/null +++ b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts @@ -0,0 +1,21 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'zeppelin-shortcut', + templateUrl: './shortcut.component.html' +}) +export class ShortcutComponent implements OnInit { + ngOnInit() {} +} From 87c4d19e9afc432341414fe3bc069ee0177383b7 Mon Sep 17 00:00:00 2001 From: YONGJAE LEE Date: Sat, 6 Sep 2025 15:41:26 +0900 Subject: [PATCH 2/5] [ZEPPELIN-6203] fix: add variable for handling the isMac condition --- .../src/app/share/shortcut/shortcut.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts index b91815b4615..623f2dd890d 100644 --- a/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts +++ b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.ts @@ -17,5 +17,6 @@ import { Component, OnInit } from '@angular/core'; templateUrl: './shortcut.component.html' }) export class ShortcutComponent implements OnInit { + isMac = navigator.appVersion.indexOf('Mac') !== -1; ngOnInit() {} } From 6e75ed66da5b303da68e463cf46f9c1ae85161b5 Mon Sep 17 00:00:00 2001 From: YONGJAE LEE Date: Sat, 6 Sep 2025 15:44:43 +0900 Subject: [PATCH 3/5] [ZEPPELIN-6203] fix: remove auto comletion shortcut in modal Because in the current Monaco editor, autocomplete works by default without requiring a shortcut. --- zeppelin-web/src/app/notebook/shortcut.html | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/zeppelin-web/src/app/notebook/shortcut.html b/zeppelin-web/src/app/notebook/shortcut.html index cfa57f8bd5f..7a8ca62acf3 100644 --- a/zeppelin-web/src/app/notebook/shortcut.html +++ b/zeppelin-web/src/app/notebook/shortcut.html @@ -262,17 +262,6 @@

Keyboard shortcuts

- - -
Auto-completion
- - -
- Ctrl + . -
- - -
Cut the line
From 79ca7fa1758babd64aefdffd7e940a2598bd71dd Mon Sep 17 00:00:00 2001 From: YONGJAE LEE Date: Sun, 7 Sep 2025 00:20:13 +0900 Subject: [PATCH 4/5] Revert "[ZEPPELIN-6203] fix: remove auto comletion shortcut in modal" This reverts commit 6e75ed66da5b303da68e463cf46f9c1ae85161b5. --- zeppelin-web/src/app/notebook/shortcut.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zeppelin-web/src/app/notebook/shortcut.html b/zeppelin-web/src/app/notebook/shortcut.html index 7a8ca62acf3..cfa57f8bd5f 100644 --- a/zeppelin-web/src/app/notebook/shortcut.html +++ b/zeppelin-web/src/app/notebook/shortcut.html @@ -262,6 +262,17 @@

Keyboard shortcuts

+ + +
Auto-completion
+ + +
+ Ctrl + . +
+ + +
Cut the line
From 2dd2a6cde7b87112703785b44c6fffe59d55c9d4 Mon Sep 17 00:00:00 2001 From: YONGJAE LEE Date: Sun, 7 Sep 2025 00:20:52 +0900 Subject: [PATCH 5/5] [ZEPPELIN-6203] fix: remove auto comletion shortcut in modal --- .../src/app/share/shortcut/shortcut.component.html | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html index 5ede0537c26..62b0437f0e8 100644 --- a/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html +++ b/zeppelin-web-angular/src/app/share/shortcut/shortcut.component.html @@ -256,17 +256,6 @@ - - -
Auto-completion
- - -
- Ctrl + . -
- - -
Cut the line