2018-01-26 16:00:07 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
2018-07-25 16:00:50 +02:00
|
|
|
import {Observable} from 'rxjs/Observable';
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'openaire-directLinking',
|
2018-07-25 16:00:50 +02:00
|
|
|
template: `<directLinking [communityId]=communityId></directLinking>`
|
2018-01-26 16:00:07 +01:00
|
|
|
})
|
|
|
|
export class OpenaireDirectLinkingComponent {
|
2018-07-25 16:00:50 +02:00
|
|
|
communityId:string;
|
|
|
|
constructor (
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private _router: Router
|
|
|
|
|
|
|
|
) {
|
2019-03-01 12:34:19 +01:00
|
|
|
this.route.data
|
|
|
|
.subscribe((data: { envSpecific: any }) => {
|
|
|
|
this.route.queryParams.subscribe(
|
|
|
|
communityId => {
|
2019-07-03 12:16:58 +02:00
|
|
|
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
|
|
|
if(!this.communityId) {
|
|
|
|
this.communityId = communityId['communityId'];
|
2019-03-01 12:34:19 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2018-07-25 16:00:50 +02:00
|
|
|
|
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|