Revision 60171
Added by Argiro Kokogiannaki over 3 years ago
result.component.ts | ||
---|---|---|
2 | 2 |
import {ActivatedRoute, Router} from "@angular/router"; |
3 | 3 |
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service"; |
4 | 4 |
import {Subscriber} from "rxjs"; |
5 |
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service"; |
|
5 | 6 |
|
6 | 7 |
@Component({ |
7 | 8 |
selector: 'monitor-result', |
8 | 9 |
template: ` |
9 | 10 |
<div id="page_content"> |
10 |
<result-landing *ngIf="initialized" type="result"></result-landing> |
|
11 |
<result-landing *ngIf="initialized" type="result" [communityId]="communityId" [piwikSiteId]="piwikSiteId"></result-landing>
|
|
11 | 12 |
</div>`, |
12 | 13 |
}) |
13 | 14 |
export class MonitorResultComponent { |
14 | 15 |
initialized: boolean = false; |
15 |
|
|
16 |
communityId; |
|
17 |
piwikSiteId; |
|
16 | 18 |
constructor(private route: ActivatedRoute, |
17 | 19 |
private router: Router, |
18 |
private stakeholderService: StakeholderService) { |
|
20 |
private stakeholderService: StakeholderService, private configurationService: ConfigurationService) {
|
|
19 | 21 |
} |
20 | 22 |
subscriptions = []; |
21 | 23 |
ngOnDestroy() { |
... | ... | |
31 | 33 |
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { |
32 | 34 |
if (stakeholder) { |
33 | 35 |
this.initialized = true; |
36 |
this.communityId = stakeholder.alias; |
|
37 |
this.subscriptions.push(this.configurationService.communityInformationState.subscribe(portal => { |
|
38 |
if (portal) { |
|
39 |
this.piwikSiteId = portal.piwik; |
|
40 |
} |
|
41 |
})); |
|
34 | 42 |
} |
35 | 43 |
})); |
36 | 44 |
} |
Also available in: Unified diff
[Monitor dashboard | Trunk]
Admin tools:
- move amdin tool components underadmin-tool folder
- create admin tool routing module
- remove guard from each module and put it in admin tool routing module
Piwik:
- add piwik from configuration service and pass it in search, landing, monitor
App component:
- when stakeholder changes: update or reset properties adminToolsCommunity, adminToolsPortalType and init community information