[Library|Trunk ]

... pass properties as parameter (error/isRouteEnabled.guard.ts)


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55997 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-06-05 13:55:35 +00:00
parent f5d29ffc76
commit 779be7dd43
1 changed files with 3 additions and 3 deletions

View File

@ -33,12 +33,12 @@ export class IsRouteEnabled implements CanActivate {
if (!community) {
community = ConnectHelper.getCommunityFromDomain(res.domain);
}
return res['adminToolsAPIURL'];
}),mergeMap(url => {
return res;
}),mergeMap(prop => {
if (!community) { // no community to check - return true
return observableOf(true);
}
return this.config.isPageEnabled(url, community, '/' + path.split('?')[0].substring(1));
return this.config.isPageEnabled(prop, community, '/' + path.split('?')[0].substring(1));
}),);
obs.pipe(filter(enabled => !enabled))
.subscribe(() => this.router.navigate([redirect], {queryParams: {'page': path}}));