| /* |
| ****************************************************************************** |
| * Copyright © 2018 PTA GmbH. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| ****************************************************************************** |
| */ |
| import { Globals } from './../../common/globals'; |
| import { Component, OnInit } from '@angular/core'; |
| import { SessionContext } from '../../common/session-context'; |
| import { User } from '../../model/user'; |
| import { Router } from '@angular/router'; |
| |
| @Component({ |
| selector: 'app-overview', |
| templateUrl: './overview.component.html', |
| styleUrls: ['./overview.component.css'] |
| }) |
| |
| export class OverviewComponent implements OnInit { |
| |
| user: User; |
| view: any = 'list'; |
| createGridMeasureAllowed = false; |
| |
| constructor(public router: Router, |
| public sessionContext: SessionContext) { } |
| |
| ngOnInit() { |
| this.user = this.sessionContext.getCurrUser(); |
| this.createGridMeasureAllowed = this.user.roles.includes(Globals.OAUTH2CONF_SUPERUSER_ROLE) || |
| this.user.roles.includes(Globals.OAUTH2CONF_MEASUREAPPLICANT_ROLE); |
| this.sessionContext.setCancelStage(false); |
| } |
| |
| goToGridMeasureDetail() { |
| this.router.navigate(['/gridMeasureDetail']); |
| } |
| } |