2020-10-05 15:16:15 +02:00
|
|
|
import {Component, OnInit} from "@angular/core";
|
|
|
|
import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service";
|
|
|
|
import {properties} from "../../environments/environment";
|
2020-10-01 11:18:13 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'users',
|
|
|
|
templateUrl: 'users.component.html'
|
|
|
|
})
|
2020-10-05 15:16:15 +02:00
|
|
|
export class UsersComponent implements OnInit{
|
|
|
|
|
|
|
|
public alias: string;
|
|
|
|
public name: string;
|
|
|
|
public type: string;
|
|
|
|
public link: string;
|
|
|
|
public loading: boolean;
|
|
|
|
|
|
|
|
constructor(private stakeholderService: StakeholderService) {
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.loading = true;
|
|
|
|
this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
|
|
|
if(stakeholder) {
|
|
|
|
this.alias = stakeholder.alias;
|
|
|
|
this.name = stakeholder.name;
|
|
|
|
this.type = stakeholder.type;
|
|
|
|
this.link = this.getURL(this.alias);
|
|
|
|
this.loading = false;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
private getURL(id: string): string {
|
|
|
|
return properties.domain + properties.baseLink + "/" + id + "?verify=";
|
|
|
|
}
|
|
|
|
}
|