2019-07-24 18:01:38 +02:00
|
|
|
import {Component} from '@angular/core';
|
|
|
|
import {ActivatedRoute} from '@angular/router';
|
|
|
|
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
|
2020-11-12 16:59:26 +01:00
|
|
|
import {Subscriber} from "rxjs";
|
2020-11-30 18:04:05 +01:00
|
|
|
import {properties} from "../../../environments/environment";
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'openaire-my-claims',
|
|
|
|
template: `
|
2024-02-13 11:16:04 +01:00
|
|
|
<my-claims [claimsInfoURL]="claimsInfoURL" [communityId]=communityId></my-claims>
|
2018-01-26 16:00:07 +01:00
|
|
|
`
|
|
|
|
|
|
|
|
})
|
|
|
|
export class OpenaireMyClaimsComponent {
|
2019-08-02 16:56:03 +02:00
|
|
|
claimsInfoURL:string;
|
2019-07-24 18:01:38 +02:00
|
|
|
communityId:string;
|
2023-07-13 10:48:23 +02:00
|
|
|
sub;
|
2018-01-26 16:00:07 +01:00
|
|
|
|
2019-08-02 16:56:03 +02:00
|
|
|
constructor (private route: ActivatedRoute) {}
|
2023-07-13 10:48:23 +02:00
|
|
|
|
2020-11-12 16:59:26 +01:00
|
|
|
ngOnDestroy() {
|
|
|
|
if (this.sub instanceof Subscriber) {
|
|
|
|
this.sub.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|
2023-07-13 10:48:23 +02:00
|
|
|
|
2019-08-02 16:56:03 +02:00
|
|
|
public ngOnInit() {
|
2024-02-13 11:16:04 +01:00
|
|
|
this.claimsInfoURL = properties.claimsInformationLink;
|
2020-11-30 18:04:05 +01:00
|
|
|
this.sub = this.route.queryParams.subscribe(
|
|
|
|
communityId => {
|
|
|
|
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
|
|
|
if(!this.communityId) {
|
|
|
|
this.communityId = communityId['communityId'];
|
|
|
|
}
|
|
|
|
});
|
2019-08-02 16:56:03 +02:00
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|