2019-07-23 14:23:41 +02:00
|
|
|
import {Component} from '@angular/core';
|
|
|
|
import {ActivatedRoute} from '@angular/router';
|
2018-07-09 14:13:38 +02:00
|
|
|
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-linking-generic',
|
2023-07-13 10:48:23 +02:00
|
|
|
template: `<linking-generic [communityId]=communityId pageTitle="Linking"></linking-generic>`
|
2018-01-26 16:00:07 +01:00
|
|
|
})
|
|
|
|
export class OpenaireLinkingComponent {
|
2018-07-09 14:13:38 +02:00
|
|
|
communityId:string;
|
2020-11-12 16:59:26 +01:00
|
|
|
sub;
|
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-07-23 14:23:41 +02:00
|
|
|
constructor (private route: ActivatedRoute) {
|
2020-11-30 18:04:05 +01:00
|
|
|
this.route.queryParams.subscribe(
|
|
|
|
communityId => {
|
|
|
|
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
|
|
|
if(!this.communityId) {
|
|
|
|
this.communityId = communityId['communityId'];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|