From 015781235730cb59c495f435503ce888a68655ce Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Mon, 17 Aug 2020 14:19:38 +0200 Subject: [PATCH] AW-1435 Add links to package manager and widget manager --- .../components/user-menu/user-menu.component.html | 6 ++++++ .../fm/components/user-menu/user-menu.component.ts | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/projects/common/src/fm/components/user-menu/user-menu.component.html b/projects/common/src/fm/components/user-menu/user-menu.component.html index fa8895e..46cdb25 100644 --- a/projects/common/src/fm/components/user-menu/user-menu.component.html +++ b/projects/common/src/fm/components/user-menu/user-menu.component.html @@ -5,6 +5,12 @@
{{user.name}}
+
+  Package Manager +
+
+  Widget Manager +
logout
diff --git a/projects/common/src/fm/components/user-menu/user-menu.component.ts b/projects/common/src/fm/components/user-menu/user-menu.component.ts index 8e3f826..d403730 100644 --- a/projects/common/src/fm/components/user-menu/user-menu.component.ts +++ b/projects/common/src/fm/components/user-menu/user-menu.component.ts @@ -4,6 +4,7 @@ import { IUser } from '../../models/user'; import {Store} from '@ngrx/store'; import * as appReducers from '../../reducers/app-common.reducer'; import * as appActions from '../../actions/app-common.actions'; +import { Router } from '@angular/router'; @Component({ selector: 'fm-user-menu', @@ -15,7 +16,7 @@ export class UserMenuComponent implements OnInit { @Input() user:IUser; @Input() showMenu:boolean; - constructor(private oauthService:OAuthService, private store: Store) { } + constructor(private oauthService:OAuthService, private store: Store, private router$: Router) { } ngOnInit(): void { } @@ -29,9 +30,18 @@ export class UserMenuComponent implements OnInit { this.store.dispatch(new appActions.Logout()); } - toggle(event:MouseEvent) { event.stopPropagation(); this.store.dispatch(new appActions.ToggleAccountMenu()); } + + startPackageManager(event:MouseEvent) { + event.preventDefault(); + this.router$.navigate(['/editor/package-manager']); + } + + startWidgetManager(event:MouseEvent) { + event.preventDefault(); + this.router$.navigate(['/editor/widget-manager']); + } }