[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 { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Router,
|
Router,
|
||||||
|
@ -20,26 +20,19 @@ export class ConnectCommunityGuard implements CanActivate {
|
||||||
sub: Subscription = null;
|
sub: Subscription = null;
|
||||||
|
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
private communityService: CommunityService,
|
private communityService: CommunityService) {
|
||||||
private propertiesService: EnvironmentSpecificService) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check(community: string): Observable<boolean> | boolean {
|
check(community: string): Observable<boolean> | boolean {
|
||||||
const obs = this.communityService.isCommunityTypeByState(properties, properties['communityAPI'] + community);
|
return this.communityService.isCommunityTypeByState(properties, properties['communityAPI'] + community).pipe(map(isCommunity => {
|
||||||
|
if(!isCommunity) {
|
||||||
this.sub = obs.pipe(filter(enabled => !enabled))
|
this.router.navigate(['errorcommunity']);
|
||||||
.subscribe(() => this.router.navigate(['errorcommunity']));
|
}
|
||||||
return obs;
|
return isCommunity;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
|
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
|
||||||
return this.check(route.queryParams['communityId']);
|
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 {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
|
||||||
import {DivContentFormComponent} from './div-help-content-form.component';
|
import {DivContentFormComponent} from './div-help-content-form.component';
|
||||||
import {CKEditorModule} from 'ng2-ckeditor';
|
import {CKEditorModule} from 'ckeditor4-angular';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {CommonModule} from '@angular/common';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||||
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.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';
|
import {PageContentFormComponent} from './page-help-content-form.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
Loading…
Reference in New Issue