1
|
import {Component, OnInit} from '@angular/core';
|
2
|
import {ActivatedRoute} from '@angular/router';
|
3
|
import {properties} from '../../../environments/environment';
|
4
|
import {Subscriber} from 'rxjs';
|
5
|
import {Title} from "@angular/platform-browser";
|
6
|
|
7
|
@Component({
|
8
|
selector: 'claims',
|
9
|
template: `
|
10
|
<div page-content class="admin-pages">
|
11
|
<div header>
|
12
|
<users-tabs tab="claims"></users-tabs>
|
13
|
</div>
|
14
|
<div inner>
|
15
|
<claims-admin fetchBy="Context" [fetchId]=communityId [isConnect]="true" [claimsInfoURL]=claimsInfoURL
|
16
|
[externalPortalUrl]="externalPortalUrl">
|
17
|
</claims-admin>
|
18
|
</div>
|
19
|
</div>
|
20
|
`,
|
21
|
})
|
22
|
|
23
|
export class ClaimsComponent implements OnInit {
|
24
|
communityId: string;
|
25
|
claimsInfoURL: string;
|
26
|
externalPortalUrl = '';
|
27
|
sub;
|
28
|
|
29
|
constructor(private route: ActivatedRoute,
|
30
|
private title: Title) {
|
31
|
}
|
32
|
|
33
|
ngOnInit() {
|
34
|
this.sub = this.route.params.subscribe(params => {
|
35
|
this.communityId = params['community'];
|
36
|
this.title.setTitle(this.communityId.toUpperCase() + ' | Manage Links');
|
37
|
this.claimsInfoURL = properties.claimsInformationLink;
|
38
|
this.externalPortalUrl = 'https://' + (properties.environment == 'beta' ? 'beta.' : '') + ((this.communityId == 'openaire') ? 'explore' : this.communityId) + '.openaire.eu';
|
39
|
});
|
40
|
|
41
|
}
|
42
|
|
43
|
ngOnDestroy() {
|
44
|
if (this.sub instanceof Subscriber) {
|
45
|
this.sub.unsubscribe();
|
46
|
}
|
47
|
}
|
48
|
}
|