AW-1435 Add links to package manager and widget manager
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter (extern) 2020-08-17 14:19:38 +02:00
parent 329564d8f6
commit 0157812357
2 changed files with 18 additions and 2 deletions

View File

@ -5,6 +5,12 @@
<div class="card">
<div class="card-body">
<div class="username">{{user.name}}</div>
<div *fm-hasclaim="'http://claims.akkerweb.nl/tester'">
<a href="#" (click)="startPackageManager($event)" i18n><i class="fa fa-suitcase" aria-hidden="true"></i>&nbsp;Package Manager</a>
</div>
<div *fm-hasclaim="'http://claims.akkerweb.nl/tester'">
<a href="#" (click)="startWidgetManager($event)" i18n><i class="fa fa-plug" aria-hidden="true"></i>&nbsp;Widget Manager</a>
</div>
<div><a href="#" (click)="logout($event)" i18n>logout</a></div>
</div>
</div>

View File

@ -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<appReducers.State>) { }
constructor(private oauthService:OAuthService, private store: Store<appReducers.State>, 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']);
}
}