Files
zitadel/console/src/app/modules/keyboard-shortcuts/keyboard-shortcuts.component.ts
T
b099a26a16 feat(console): MDC components (#6482)
mdc components

---------

Co-authored-by: Elio Bischof <[email protected]>
2023-10-26 08:29:06 +00:00

31 lines
1.0 KiB
TypeScript

import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { KeyboardShortcut, ORGSHORTCUTS, SIDEWIDESHORTCUTS } from 'src/app/services/keyboard-shortcuts/keyboard-shortcuts';
@Component({
selector: 'cnsl-keyboard-shortcuts',
templateUrl: './keyboard-shortcuts.component.html',
styleUrls: ['./keyboard-shortcuts.component.scss'],
})
export class KeyboardShortcutsComponent {
public orgShortcuts: KeyboardShortcut[] = ORGSHORTCUTS;
public shortcuts: KeyboardShortcut[] = SIDEWIDESHORTCUTS;
constructor(
public dialogRef: MatDialogRef<KeyboardShortcutsComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private router: Router,
) {}
public closeDialog(): void {
this.dialogRef.close(false);
}
public get isNotOnSystem(): boolean {
return !(
['/instance', '/views', '/failed-events'].includes(this.router.url) ||
new RegExp('/instance/policy/*').test(this.router.url)
);
}
}