Link to RC dashboards available only for development enviroment

This commit is contained in:
Alex Martzios 2021-10-11 12:53:31 +03:00
parent 9da11820aa
commit 7a375ee6f7
1 changed files with 24 additions and 24 deletions

View File

@ -48,31 +48,31 @@ export class RelatedToComponent {
}
ngOnInit() {
this.contexts.forEach( context => {
if(context.idContext) {
this.subscriptions.push(
this.userManagementService.getUserInfo().subscribe( user => {
//- handling subscribe errors?
this.subscriptions.push(
this.communityService.getCommunity(context.idContext).subscribe( community => {
// swap the == of the last condition to != // testing this way for now
if(community && !ConnectHelper.isPrivate(community,user) && (ConnectHelper.getCommunityFromDomain(properties.domain) != context.idContext)) {
// creating the link, based on the enviroment
let url = '';
if(properties.environment == "beta") {
url = 'https://beta.' + context.idContext + '.openaire.eu';
} else {
url = 'https://' + context.idContext + '.openaire.eu';
if(properties.environment === "development") {
this.contexts.forEach( context => {
if(context.idContext) {
this.subscriptions.push(
this.userManagementService.getUserInfo().subscribe( user => {
//- handling subscribe errors?
this.subscriptions.push(
this.communityService.getCommunity(context.idContext).subscribe( community => {
if(community && !ConnectHelper.isPrivate(community,user) && (ConnectHelper.getCommunityFromDomain(properties.domain) != context.idContext)) {
// creating the link, based on the enviroment
let url = '';
if(properties.environment == "beta") {
url = 'https://beta.' + context.idContext + '.openaire.eu';
} else {
url = 'https://' + context.idContext + '.openaire.eu';
}
context.link = url;
}
console.log(url);
context.link = url;
}
})
);
})
);
}
});
})
);
})
);
}
});
}
}
ngOnDestroy() {