1. Change the way variable of type 'EnvProperties' is accessed in guards.
2. Add <ng-content> in modal of openaireLibrary. (e.g. for nested component) git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51672 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
30f9ee87a7
commit
8c8e9ca79c
|
@ -10,16 +10,7 @@ import { EnvProperties} from '../../utils/properties/env-properties';
|
|||
|
||||
@Injectable()
|
||||
export class ConnectAdminLoginGuard implements CanActivate {
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor(private route: ActivatedRouteSnapshot, private router: Router, private communityService: CommunityService, private propertiesService:EnvironmentSpecificService ) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
});
|
||||
}
|
||||
constructor(private router: Router, private communityService: CommunityService, private propertiesService:EnvironmentSpecificService ) {}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
|
||||
console.log(state.url);
|
||||
|
@ -27,6 +18,8 @@ export class ConnectAdminLoginGuard implements CanActivate {
|
|||
var loggedIn = false;
|
||||
var isAdmin = false;
|
||||
var errorCode = ErrorCodes.NOT_LOGGIN;
|
||||
var properties:EnvProperties = route.data.envSpecific;
|
||||
|
||||
let community = (route.queryParams["communityId"]);
|
||||
if(Session.isLoggedIn()){
|
||||
loggedIn = true;
|
||||
|
@ -42,7 +35,7 @@ export class ConnectAdminLoginGuard implements CanActivate {
|
|||
return true;
|
||||
}else {
|
||||
let obs = this.propertiesService.subscribeEnvironment().map(res=>res["communityAPI"]).mergeMap(url => {
|
||||
return this.communityService.iscommunityManager(this.properties, url+community,Session.getUserEmail())});
|
||||
return this.communityService.iscommunityManager(properties, url+community,Session.getUserEmail())});
|
||||
obs.filter(enabled => !enabled)
|
||||
.subscribe(() => this.router.navigate(['/user-info'], { queryParams: { "errorCode": errorCode, "redirectUrl": state.url } }));
|
||||
return obs;
|
||||
|
|
|
@ -10,16 +10,7 @@ import { EnvProperties} from '../../utils/properties/env-properties';
|
|||
|
||||
@Injectable()
|
||||
export class ConnectRIGuard implements CanActivate {
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor(private route: ActivatedRouteSnapshot, private router: Router, private communityService: CommunityService, private propertiesService:EnvironmentSpecificService ) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
});
|
||||
}
|
||||
constructor(private router: Router, private communityService: CommunityService, private propertiesService:EnvironmentSpecificService ) {}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
|
||||
console.log(state.url);
|
||||
|
@ -27,6 +18,8 @@ export class ConnectRIGuard implements CanActivate {
|
|||
var loggedIn = false;
|
||||
var isAdmin = false;
|
||||
var errorCode = ErrorCodes.NOT_LOGGIN;
|
||||
var properties:EnvProperties = route.data.envSpecific;
|
||||
|
||||
let community = (route.queryParams["communityId"]);
|
||||
if(Session.isLoggedIn()){
|
||||
loggedIn = true;
|
||||
|
@ -42,7 +35,7 @@ export class ConnectRIGuard implements CanActivate {
|
|||
}else {
|
||||
|
||||
let obs = this.propertiesService.subscribeEnvironment().map(res=>res["communityAPI"]).mergeMap(url => {
|
||||
return this.communityService.iscommunityRI(this.properties, url+community)});
|
||||
return this.communityService.iscommunityRI(properties, url+community)});
|
||||
obs.filter(enabled => !enabled)
|
||||
.subscribe(() => this.router.navigate(['/user-info'], { queryParams: { "errorCode": errorCode, "redirectUrl": state.url } }));
|
||||
return obs;
|
||||
|
|
|
@ -16,6 +16,7 @@ import {Open} from './open.component';
|
|||
<div [hidden]=!alertMessage>
|
||||
{{message}}
|
||||
</div>
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
<div class=" uk-text-right" [hidden]=!alertFooter>
|
||||
<span [hidden]=!okButton >
|
||||
|
|
Loading…
Reference in New Issue