Fix Pipeable operators

This commit is contained in:
Giuseppe Digilio
2018-12-16 20:22:01 +01:00
parent 7407740e3b
commit 3b2aebb649
35 changed files with 484 additions and 414 deletions

View File

@@ -1,7 +1,7 @@
import { ChangeDetectorRef, Directive, Input, OnDestroy, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { uniq } from 'lodash';
import { SectionsService } from './sections.service';
@@ -33,17 +33,17 @@ export class SectionsDirective implements OnDestroy, OnInit {
}
ngOnInit() {
this.valid = this.sectionService.isSectionValid(this.submissionId, this.sectionId)
.map((valid: boolean) => {
this.valid = this.sectionService.isSectionValid(this.submissionId, this.sectionId).pipe(
map((valid: boolean) => {
if (valid) {
this.resetErrors();
}
return valid;
});
}));
this.subs.push(
this.sectionService.getSectionState(this.submissionId, this.sectionId)
.map((state: SubmissionSectionObject) => state.errors)
this.sectionService.getSectionState(this.submissionId, this.sectionId).pipe(
map((state: SubmissionSectionObject) => state.errors))
.subscribe((errors: SubmissionSectionError[]) => {
if (isNotEmpty(errors)) {
errors.forEach((errorItem: SubmissionSectionError) => {