Revision 59922
Added by Konstantinos Triantafyllou over 3 years ago
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/users/users.component.html | ||
---|---|---|
3 | 3 |
<loading></loading> |
4 | 4 |
</div> |
5 | 5 |
</div> |
6 |
<dashboard-users *ngIf="!loading && alias" [id]="alias" [name]="name" [type]="type" [link]="link"></dashboard-users> |
|
6 |
<dashboard-users *ngIf="!loading && alias" [id]="alias" [name]="name" [type]="type" [link]="link" [messages]="messages"></dashboard-users>
|
|
7 | 7 |
|
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/users/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 |
} |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/general/general.component.ts | ||
---|---|---|
5 | 5 |
import { Subscription, zip} from "rxjs"; |
6 | 6 |
import {EditStakeholderComponent} from "./edit-stakeholder/edit-stakeholder.component"; |
7 | 7 |
import {properties} from "../../environments/environment"; |
8 |
import {Title} from "@angular/platform-browser"; |
|
8 | 9 |
|
9 | 10 |
@Component({ |
10 | 11 |
selector: 'general', |
... | ... | |
21 | 22 |
private subscriptions: any[] = []; |
22 | 23 |
@ViewChild('editStakeholderComponent') editStakeholderComponent: EditStakeholderComponent; |
23 | 24 |
|
24 |
constructor(private stakeholderService: StakeholderService) { |
|
25 |
constructor(private stakeholderService: StakeholderService, |
|
26 |
private title: Title) { |
|
25 | 27 |
} |
26 | 28 |
|
27 | 29 |
ngOnInit() { |
... | ... | |
29 | 31 |
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { |
30 | 32 |
this.stakeholder = stakeholder; |
31 | 33 |
if(this.stakeholder) { |
34 |
this.title.setTitle(this.stakeholder.name + " | General"); |
|
32 | 35 |
let data = zip( |
33 | 36 |
this.stakeholderService.getDefaultStakeholders(this.properties.monitorServiceAPIURL), |
34 | 37 |
this.stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL) |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/topic.component.ts | ||
---|---|---|
102 | 102 |
if (this.topicIndex === -1) { |
103 | 103 |
this.navigateToError(); |
104 | 104 |
} else { |
105 |
this.title.setTitle(stakeholder.name); |
|
105 |
this.title.setTitle(stakeholder.name + " | Indicators");
|
|
106 | 106 |
this.toggle = true; |
107 | 107 |
} |
108 | 108 |
} |
Also available in: Unified diff
[Monitor Dashboard | Trunk]: Add titles on users, general and topics