dididy commented on code in PR #5080:
URL: https://github.com/apache/zeppelin/pull/5080#discussion_r2390952276
##########
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.ts:
##########
@@ -490,146 +473,46 @@ export class NotebookParagraphComponent extends
ParagraphBase implements OnInit,
constructor(
public messageService: MessageService,
private heliumService: HeliumService,
- private nzModalService: NzModalService,
+ private host: ElementRef,
private noteVarShareService: NoteVarShareService,
+ private nzModalService: NzModalService,
private shortcutService: ShortcutService,
- private host: ElementRef,
noteStatusService: NoteStatusService,
cdr: ChangeDetectorRef,
ngZService: NgZService
) {
super(messageService, noteStatusService, ngZService, cdr);
+ this.keyBinderService = new KeyBinder(this.destroy$, this.host,
this.shortcutService);
}
- ngOnInit() {
- const shortcutService =
this.shortcutService.forkByElement(this.host.nativeElement);
- const observables: Array<Observable<{
- action: ParagraphActions;
- event: KeyboardEvent;
- }>> = [];
- Object.entries(ShortcutsMap).forEach(([action, keys]) => {
- const keysArr: string[] = Array.isArray(keys) ? keys : [keys];
- keysArr.forEach(key => {
- observables.push(
- shortcutService
- .bindShortcut({
- keybindings: key
- })
- .pipe(
- takeUntil(this.destroy$),
- map(({ event }) => {
- return {
- event,
- action: action as ParagraphActions
- };
- })
- )
- );
- });
- });
+ private handleKeyEvent(action: ParagraphActions, event:
NullableKeyboardEvent) {
Review Comment:
Oh, I see. That’s unavoidable then. I think it’s fine to leave it as is.
Thanks for the explanation. I’ve reviewed all the changes mentioned above
comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]