diff --git a/src/app/layout/common/shortcuts/shortcuts.component.ts b/src/app/layout/common/shortcuts/shortcuts.component.ts
index 20598f1d..99237746 100644
--- a/src/app/layout/common/shortcuts/shortcuts.component.ts
+++ b/src/app/layout/common/shortcuts/shortcuts.component.ts
@@ -1,4 +1,4 @@
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
@@ -15,14 +15,14 @@ import { ShortcutsService } from 'app/layout/common/shortcuts/shortcuts.service'
changeDetection: ChangeDetectionStrategy.OnPush,
exportAs : 'shortcuts'
})
-export class ShortcutsComponent implements OnChanges, OnInit, OnDestroy
+export class ShortcutsComponent implements OnInit, OnDestroy
{
- @Input() shortcuts: Shortcut[];
@ViewChild('shortcutsOrigin') private _shortcutsOrigin: MatButton;
@ViewChild('shortcutsPanel') private _shortcutsPanel: TemplateRef
;
mode: 'view' | 'modify' | 'add' | 'edit' = 'view';
shortcutForm: FormGroup;
+ shortcuts: Shortcut[];
private _overlayRef: OverlayRef;
private _unsubscribeAll: Subject = new Subject();
@@ -43,21 +43,6 @@ export class ShortcutsComponent implements OnChanges, OnInit, OnDestroy
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
- /**
- * On changes
- *
- * @param changes
- */
- ngOnChanges(changes: SimpleChanges): void
- {
- // Shortcuts
- if ( 'shortcuts' in changes )
- {
- // Store the shortcuts on the service
- this._shortcutsService.store(changes.shortcuts.currentValue);
- }
- }
-
/**
* On init
*/
diff --git a/src/app/layout/common/shortcuts/shortcuts.service.ts b/src/app/layout/common/shortcuts/shortcuts.service.ts
index 01f128f5..e2b045a0 100644
--- a/src/app/layout/common/shortcuts/shortcuts.service.ts
+++ b/src/app/layout/common/shortcuts/shortcuts.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, ReplaySubject } from 'rxjs';
-import { map, switchMap, take } from 'rxjs/operators';
+import { map, switchMap, take, tap } from 'rxjs/operators';
import { Shortcut } from 'app/layout/common/shortcuts/shortcuts.types';
@Injectable({
@@ -35,17 +35,15 @@ export class ShortcutsService
// -----------------------------------------------------------------------------------------------------
/**
- * Store shortcuts on the service
- *
- * @param shortcuts
+ * Get all messages
*/
- store(shortcuts: Shortcut[]): Observable
+ getAll(): Observable
{
- // Load the shortcuts
- this._shortcuts.next(shortcuts);
-
- // Return the shortcuts
- return this.shortcuts$;
+ return this._httpClient.get('api/common/shortcuts').pipe(
+ tap((shortcuts) => {
+ this._shortcuts.next(shortcuts);
+ })
+ );
}
/**
diff --git a/src/app/layout/common/user-menu/user-menu.component.html b/src/app/layout/common/user/user.component.html
similarity index 100%
rename from src/app/layout/common/user-menu/user-menu.component.html
rename to src/app/layout/common/user/user.component.html
diff --git a/src/app/layout/common/user-menu/user-menu.component.ts b/src/app/layout/common/user/user.component.ts
similarity index 91%
rename from src/app/layout/common/user-menu/user-menu.component.ts
rename to src/app/layout/common/user/user.component.ts
index 45a4bc4b..6fabe8dc 100644
--- a/src/app/layout/common/user-menu/user-menu.component.ts
+++ b/src/app/layout/common/user/user.component.ts
@@ -3,17 +3,17 @@ import { Router } from '@angular/router';
import { BooleanInput } from '@angular/cdk/coercion';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
-import { User } from 'app/core/user/user.model';
+import { User } from 'app/core/user/user.types';
import { UserService } from 'app/core/user/user.service';
@Component({
- selector : 'user-menu',
- templateUrl : './user-menu.component.html',
+ selector : 'user',
+ templateUrl : './user.component.html',
encapsulation : ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
- exportAs : 'userMenu'
+ exportAs : 'user'
})
-export class UserMenuComponent implements OnInit, OnDestroy
+export class UserComponent implements OnInit, OnDestroy
{
/* eslint-disable @typescript-eslint/naming-convention */
static ngAcceptInputType_showAvatar: BooleanInput;
diff --git a/src/app/layout/common/user-menu/user-menu.module.ts b/src/app/layout/common/user/user.module.ts
similarity index 76%
rename from src/app/layout/common/user-menu/user-menu.module.ts
rename to src/app/layout/common/user/user.module.ts
index d7ded69a..5cd0d06b 100644
--- a/src/app/layout/common/user-menu/user-menu.module.ts
+++ b/src/app/layout/common/user/user.module.ts
@@ -3,12 +3,12 @@ import { MatButtonModule } from '@angular/material/button';
import { MatDividerModule } from '@angular/material/divider';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
-import { UserMenuComponent } from 'app/layout/common/user-menu/user-menu.component';
+import { UserComponent } from 'app/layout/common/user/user.component';
import { SharedModule } from 'app/shared/shared.module';
@NgModule({
declarations: [
- UserMenuComponent
+ UserComponent
],
imports : [
MatButtonModule,
@@ -18,9 +18,9 @@ import { SharedModule } from 'app/shared/shared.module';
SharedModule
],
exports : [
- UserMenuComponent
+ UserComponent
]
})
-export class UserMenuModule
+export class UserModule
{
}
diff --git a/src/app/layout/layouts/horizontal/centered/centered.component.html b/src/app/layout/layouts/horizontal/centered/centered.component.html
index cb5344bc..fcabd73f 100644
--- a/src/app/layout/layouts/horizontal/centered/centered.component.html
+++ b/src/app/layout/layouts/horizontal/centered/centered.component.html
@@ -6,7 +6,7 @@
class="dark bg-gray-900 print:hidden"
[mode]="'over'"
[name]="'mainNavigation'"
- [navigation]="data.navigation.default"
+ [navigation]="navigation.default"
[opened]="false">
@@ -50,7 +50,7 @@
+ [navigation]="navigation.horizontal">
@@ -63,13 +63,13 @@
-
+
-
-
-
-
+
+
+
+
diff --git a/src/app/layout/layouts/horizontal/centered/centered.component.ts b/src/app/layout/layouts/horizontal/centered/centered.component.ts
index 94b0f5dc..c32f77c6 100644
--- a/src/app/layout/layouts/horizontal/centered/centered.component.ts
+++ b/src/app/layout/layouts/horizontal/centered/centered.component.ts
@@ -4,7 +4,8 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
import { FuseNavigationService, FuseVerticalNavigationComponent } from '@fuse/components/navigation';
-import { InitialData } from 'app/app.types';
+import { Navigation } from 'app/core/navigation/navigation.types';
+import { NavigationService } from 'app/core/navigation/navigation.service';
@Component({
selector : 'centered-layout',
@@ -13,7 +14,7 @@ import { InitialData } from 'app/app.types';
})
export class CenteredLayoutComponent implements OnInit, OnDestroy
{
- data: InitialData;
+ navigation: Navigation;
isScreenSmall: boolean;
private _unsubscribeAll: Subject