[Library | Trunk]: Change cdeditor library
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59269 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
6243ab5b74
commit
e8a40e5e37
|
@ -1,5 +1,5 @@
|
|||
|
||||
import {filter, mergeMap} from 'rxjs/operators';
|
||||
import {filter, map, mergeMap} from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
Router,
|
||||
|
@ -20,26 +20,19 @@ export class ConnectCommunityGuard implements CanActivate {
|
|||
sub: Subscription = null;
|
||||
|
||||
constructor(private router: Router,
|
||||
private communityService: CommunityService,
|
||||
private propertiesService: EnvironmentSpecificService) {
|
||||
private communityService: CommunityService) {
|
||||
}
|
||||
|
||||
check(community: string): Observable<boolean> | boolean {
|
||||
const obs = this.communityService.isCommunityTypeByState(properties, properties['communityAPI'] + community);
|
||||
|
||||
this.sub = obs.pipe(filter(enabled => !enabled))
|
||||
.subscribe(() => this.router.navigate(['errorcommunity']));
|
||||
return obs;
|
||||
return this.communityService.isCommunityTypeByState(properties, properties['communityAPI'] + community).pipe(map(isCommunity => {
|
||||
if(!isCommunity) {
|
||||
this.router.navigate(['errorcommunity']);
|
||||
}
|
||||
return isCommunity;
|
||||
}));
|
||||
}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
|
||||
return this.check(route.queryParams['communityId']);
|
||||
}
|
||||
|
||||
canDeactivate() {
|
||||
if(this.sub) {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
|||
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
||||
import {DivContentFormComponent} from './div-help-content-form.component';
|
||||
import {CKEditorModule} from 'ng2-ckeditor';
|
||||
import {CKEditorModule} from 'ckeditor4-angular';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
|
@ -3,7 +3,7 @@ import {CommonModule} from '@angular/common';
|
|||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
||||
import {CKEditorModule} from 'ng2-ckeditor';
|
||||
import {CKEditorModule} from 'ckeditor4-angular';
|
||||
import {PageContentFormComponent} from './page-help-content-form.component';
|
||||
|
||||
@NgModule({
|
||||
|
|
Loading…
Reference in New Issue