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