Revision 59922
Added by Konstantinos Triantafyllou over 3 years ago
users.component.ts | ||
---|---|---|
1 |
import {Component, OnInit} from "@angular/core"; |
|
1 |
import {Component, Input, OnInit} from "@angular/core";
|
|
2 | 2 |
import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service"; |
3 | 3 |
import {properties} from "../../environments/environment"; |
4 | 4 |
import {Subscriber} from "rxjs"; |
5 |
import {Title} from "@angular/platform-browser"; |
|
5 | 6 |
|
6 | 7 |
@Component({ |
7 | 8 |
selector: 'users', |
... | ... | |
14 | 15 |
public type: string; |
15 | 16 |
public link: string; |
16 | 17 |
public loading: boolean; |
18 |
public messages: Map<"member" | "manager", string> = new Map<"member"|"manager", string>(); |
|
19 |
private subscription; |
|
17 | 20 |
|
18 |
constructor(private stakeholderService: StakeholderService) { |
|
21 |
constructor(private stakeholderService: StakeholderService, |
|
22 |
private title: Title) { |
|
19 | 23 |
} |
20 |
subscription; |
|
21 |
ngOnDestroy() { |
|
22 |
if (this.subscription instanceof Subscriber) { |
|
23 |
this.subscription.unsubscribe(); |
|
24 |
} |
|
25 |
} |
|
24 |
|
|
26 | 25 |
ngOnInit() { |
27 | 26 |
this.loading = true; |
28 | 27 |
this.subscription = this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { |
29 | 28 |
if(stakeholder) { |
30 | 29 |
this.alias = stakeholder.alias; |
31 | 30 |
this.name = stakeholder.name; |
31 |
this.title.setTitle(this.name + " | Users"); |
|
32 | 32 |
this.type = stakeholder.type; |
33 | 33 |
this.link = this.getURL(this.alias); |
34 |
this.messages.set("member", 'A member has the right to view the <b>restricted access</b> areas of this indicator\'s profile. ' + |
|
35 |
'A member has <b>no access</b> to the administration part of the profile.'); |
|
36 |
this.messages.set("manager", 'A manager has the right to access the administration part of this indicator\'s profile, ' + |
|
37 |
'where he is able to customize and manage indicators, and invite other users as members.'); |
|
34 | 38 |
this.loading = false; |
35 | 39 |
} |
36 | 40 |
}) |
37 | 41 |
} |
38 | 42 |
|
43 |
ngOnDestroy() { |
|
44 |
if (this.subscription instanceof Subscriber) { |
|
45 |
this.subscription.unsubscribe(); |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
39 | 49 |
private getURL(id: string): string { |
40 | 50 |
return properties.domain + properties.baseLink + "/" + id + "?verify="; |
41 | 51 |
} |
Also available in: Unified diff
[Monitor Dashboard | Trunk]: Add titles on users, general and topics