2 |
3 |
4 |
{{ 'PAGES.SHORTCUTS.TITLE' | translate }}
5 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 | {{ key }} +
22 |
23 |
24 | {{ shortcut.description | translate }}
25 |
26 |
27 |
28 |
29 |
31 |
32 | {{ key }} +
34 |
35 |
36 | {{ shortcut.description | translate }}
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/teammapper-frontend/src/app/modules/application/pages/shortcuts/shortcuts.component.scss:
--------------------------------------------------------------------------------
1 | div.shortcuts {
2 | mat-toolbar {
3 | background-color: transparent;
4 |
5 | div.container {
6 | width: 100%;
7 | text-align: center;
8 | position: relative;
9 |
10 | button.close-button {
11 | position: absolute;
12 | top: -5px;
13 | right: -5px;
14 | }
15 | }
16 | }
17 |
18 | div.content {
19 | display: flex;
20 | justify-content: space-around;
21 | flex-wrap: wrap;
22 | padding-bottom: 10px;
23 |
24 | mat-list-item {
25 | color: #555555;
26 | }
27 |
28 | .key {
29 | padding: 6px 12px;
30 | background: gainsboro;
31 | border-radius: 3px;
32 | font-size: 15px;
33 | }
34 |
35 | .description {
36 | padding-left: 10px;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/teammapper-frontend/src/app/modules/application/pages/shortcuts/shortcuts.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ShortcutsService } from '../../../../core/services/shortcuts/shortcuts.service';
3 | import { Hotkey } from 'angular2-hotkeys';
4 | import { Location } from '@angular/common';
5 |
6 | interface Shortcut {
7 | keys: string[];
8 | // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
9 | description: string | Function;
10 | }
11 |
12 | @Component({
13 | selector: 'teammapper-shortcuts',
14 | templateUrl: './shortcuts.component.html',
15 | styleUrls: ['./shortcuts.component.scss'],
16 | standalone: false,
17 | })
18 | export class ShortcutsComponent implements OnInit {
19 | public shortcuts: Shortcut[];
20 |
21 | constructor(
22 | private shortcutsService: ShortcutsService,
23 | private location: Location
24 | ) {}
25 |
26 | public ngOnInit() {
27 | const hotKeys: Hotkey[] = this.shortcutsService.getHotKeys();
28 | this.shortcuts = hotKeys.map((hotKey: Hotkey) => {
29 | const keys = hotKey.combo[0];
30 |
31 | return {
32 | keys: keys === '+' ? [keys] : keys.split('+'),
33 | description: hotKey.description,
34 | };
35 | });
36 | }
37 |
38 | public back() {
39 | this.location.back();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/teammapper-frontend/src/app/root-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes } from '@angular/router';
3 | import { ToastGuard } from './guards/toast.guard';
4 |
5 | const routes: Routes = [
6 | {
7 | path: '',
8 | loadChildren: () =>
9 | import('./modules/about/about.module').then(m => m.AboutModule),
10 | canActivate: [ToastGuard],
11 | },
12 | {
13 | path: 'map',
14 | loadChildren: () =>
15 | import('./modules/application/application.module').then(
16 | m => m.ApplicationModule
17 | ),
18 | canActivate: [ToastGuard],
19 | },
20 | {
21 | path: 'map/:id',
22 | loadChildren: () =>
23 | import('./modules/application/application.module').then(
24 | m => m.ApplicationModule
25 | ),
26 | canActivate: [ToastGuard],
27 | },
28 | {
29 | path: 'app',
30 | loadChildren: () =>
31 | import('./modules/application/application.module').then(
32 | m => m.ApplicationModule
33 | ),
34 | },
35 | {
36 | path: '**',
37 | redirectTo: '',
38 | },
39 | ];
40 |
41 | @NgModule({
42 | imports: [
43 | RouterModule.forRoot(routes, {
44 | onSameUrlNavigation: 'reload',
45 | scrollPositionRestoration: 'enabled',
46 | }),
47 | ],
48 | exports: [RouterModule],
49 | })
50 | export class RootRoutingModule {}
51 |
--------------------------------------------------------------------------------
/teammapper-frontend/src/app/root.component.html:
--------------------------------------------------------------------------------
1 |