2017-12-19 18:34:00 +01:00
|
|
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
2017-11-15 16:11:35 +01:00
|
|
|
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute, NavigationExtras } from '@angular/router';
|
2017-12-14 11:41:26 +01:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2017-09-14 12:37:36 +02:00
|
|
|
|
2017-11-08 14:33:14 +01:00
|
|
|
|
2017-11-27 11:52:52 +01:00
|
|
|
declare const gapi: any;
|
2017-11-08 14:33:14 +01:00
|
|
|
|
2017-12-19 18:34:00 +01:00
|
|
|
declare var $: any;
|
2017-09-14 12:37:36 +02:00
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
2017-11-01 18:18:27 +01:00
|
|
|
templateUrl: './app.component.html',
|
2017-12-19 18:34:00 +01:00
|
|
|
styleUrls: ['./app.component.scss'],
|
|
|
|
providers: [],
|
2017-12-11 09:10:54 +01:00
|
|
|
encapsulation: ViewEncapsulation.None
|
2017-09-14 12:37:36 +02:00
|
|
|
})
|
2017-11-02 15:19:12 +01:00
|
|
|
export class AppComponent implements OnInit {
|
2017-11-14 15:06:00 +01:00
|
|
|
|
2017-12-19 18:34:00 +01:00
|
|
|
constructor(private router: Router, private route: ActivatedRoute, private translate: TranslateService) {
|
|
|
|
// this language will be used as a fallback when a translation isn't found in the current language
|
|
|
|
translate.setDefaultLang('en');
|
|
|
|
// the lang to use, if the lang isn't available, it will use the current loader to get them
|
|
|
|
translate.use('en');
|
2017-11-01 18:18:27 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-11-02 15:19:12 +01:00
|
|
|
ngOnInit() {
|
2017-11-27 11:52:52 +01:00
|
|
|
}
|
|
|
|
|
2017-12-19 18:34:00 +01:00
|
|
|
login() {
|
2017-11-01 18:18:27 +01:00
|
|
|
//redirect to login page
|
2017-12-19 18:34:00 +01:00
|
|
|
this.router.navigate(['/login'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
2017-11-01 18:18:27 +01:00
|
|
|
}
|
|
|
|
|
2017-12-19 18:34:00 +01:00
|
|
|
logout() {
|
2017-11-01 18:18:27 +01:00
|
|
|
|
2017-11-13 18:13:49 +01:00
|
|
|
}
|
|
|
|
|
2017-12-19 18:34:00 +01:00
|
|
|
goToDMPs() {
|
|
|
|
this.router.navigate(['/dmps'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
2017-11-13 18:13:49 +01:00
|
|
|
}
|
|
|
|
|
2017-12-19 18:34:00 +01:00
|
|
|
goToProjects() {
|
|
|
|
this.router.navigate(['/projects'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
|
|
|
}
|
2017-09-14 12:37:36 +02:00
|
|
|
}
|
2017-11-01 18:18:27 +01:00
|
|
|
|