* rxjs update done
This commit is contained in:
parent
1eccb8de8c
commit
0a16c232d2
5
package-lock.json
generated
5
package-lock.json
generated
@ -8331,11 +8331,6 @@
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"rxjs-compat": {
|
||||
"version": "6.3.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.3.3.tgz",
|
||||
"integrity": "sha512-caGN7ixiabHpOofginKEquuHk7GgaCrC7UpUQ9ZqGp80tMc68msadOeP/2AKy2R4YJsT1+TX5GZCtxO82qWkyA=="
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
|
||||
@ -26,8 +26,7 @@
|
||||
"core-js": "^2.5.4",
|
||||
"jquery": "^3.3.1",
|
||||
"rxjs": "~6.3.3",
|
||||
"zone.js": "~0.8.26",
|
||||
"rxjs-compat": "^6.0.0-rc.0"
|
||||
"zone.js": "~0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.10.0",
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AuthService } from "./auth/auth.service";
|
||||
import { Subscription } from "rxjs/Subscription";
|
||||
import { TimerObservable } from "rxjs/observable/TimerObservable";
|
||||
|
||||
import { FaultManagerService } from "./fault-manager/fault-manager.service";
|
||||
import { Subscription, timer } from "rxjs";
|
||||
|
||||
// timers are in milliseconds
|
||||
const RENEW_TIMER_INITIAL = 300000; // 5min
|
||||
@ -25,14 +24,14 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
private faultManager: FaultManagerService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
let authRenewObservable = TimerObservable.create(RENEW_TIMER_INITIAL, RENEW_TIMER_PERIOD);
|
||||
const authRenewObservable = timer(RENEW_TIMER_INITIAL, RENEW_TIMER_PERIOD);
|
||||
this.authRenewTimer = authRenewObservable.subscribe(() => {
|
||||
if (this.authService.isLoggedIn) {
|
||||
this.authService.renew();
|
||||
}
|
||||
});
|
||||
|
||||
let faultReloadObservable = TimerObservable.create(FAULT_RELOAD_PERIOD, FAULT_RELOAD_PERIOD);
|
||||
const faultReloadObservable = timer(FAULT_RELOAD_PERIOD, FAULT_RELOAD_PERIOD);
|
||||
this.faultReloadTimer = faultReloadObservable.subscribe(() => {
|
||||
if (this.authService.isLoggedIn) {
|
||||
this.faultManager.list().subscribe(faults => this.faultManager.faults = faults);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from "@angular/router";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import 'rxjs/Rx';
|
||||
import { JwtHelperService } from '@auth0/angular-jwt';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Title } from "@angular/platform-browser";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { finalize } from 'rxjs/operators';
|
||||
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { FaultManagerService } from "../fault-manager.service";
|
||||
@ -31,15 +32,15 @@ export class ConfirmExpensiveFaultComponent implements OnInit {
|
||||
|
||||
public confirm() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.confirmFault(this.fault)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.confirmFault(this.fault).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
public reject() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.reject(this.fault, 'rej', this.rejectReason)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.reject(this.fault, 'rej', this.rejectReason).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { Title } from "@angular/platform-browser";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { finalize } from 'rxjs/operators';
|
||||
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { FaultManagerService } from "../fault-manager.service";
|
||||
@ -61,16 +62,16 @@ export class ConfirmFaultComponent implements OnInit {
|
||||
public confirm() {
|
||||
this.submitInProgress = true;
|
||||
// this.fault.costEstimate = this.costEstimate;
|
||||
this.faultManager.confirmFault(this.fault)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.confirmFault(this.fault).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
public setHighExpenseFault() {
|
||||
this.submitInProgress = true;
|
||||
// this.fault.costEstimate = this.costEstimate;
|
||||
this.faultManager.setHighExpenseFault(this.fault)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.setHighExpenseFault(this.fault).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(fault => {
|
||||
this.faultManager.attachPdf(this.fault.id, this.pdfUpload.nativeElement.files).subscribe(
|
||||
attRes => this.router.navigate(['/hiba/feladat-lista']),
|
||||
@ -81,8 +82,8 @@ export class ConfirmFaultComponent implements OnInit {
|
||||
|
||||
public attachImages() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.attachImages(this.fault.id, this.photoUpload.nativeElement.files)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.attachImages(this.fault.id, this.photoUpload.nativeElement.files).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(
|
||||
attRes => this.photoUpload.nativeElement.value = null,
|
||||
attErr => alert("Hiba történt a képfeltöltés közben.")
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { HttpClient, HttpHeaders, HttpRequest } from "@angular/common/http";
|
||||
import { Observable } from "rxjs";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
import { Fault } from "./shared/fault";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { Fault } from "./shared/fault";
|
||||
import { environment } from "../../environments/environment";
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from "@angular/router";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import 'rxjs/Rx';
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { ErrorCategory } from "../shared";
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from "@angular/router";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import 'rxjs/Rx';
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { ErrorOrigin } from "../shared/error-origin";
|
||||
import { ErrorOrigin } from "../shared";
|
||||
|
||||
@Injectable()
|
||||
export class ErrorOriginService implements Resolve<false|Array<ErrorOrigin>> {
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from "@angular/router";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import 'rxjs/Rx';
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { FacilityLocation } from "../shared";
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from "@angular/router";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import 'rxjs/Rx';
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { SolutionTimeInterval } from "../shared/solution-time-interval";
|
||||
import { SolutionTimeInterval } from "../shared";
|
||||
|
||||
@Injectable()
|
||||
export class SolutionTimeIntervalService implements Resolve<false|Array<SolutionTimeInterval>> {
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
|
||||
import {finalize} from 'rxjs/operators';
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { Title } from "@angular/platform-browser";
|
||||
@ -83,8 +85,8 @@ export class ReadonlyDisplayComponent implements OnInit {
|
||||
|
||||
public attachImages() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.attachImages(this.fault.id, this.photoUpload.nativeElement.files)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.attachImages(this.fault.id, this.photoUpload.nativeElement.files).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(
|
||||
attRes => this.photoUpload.nativeElement.value = null,
|
||||
attErr => alert("Hiba történt a képfeltöltés közben.")
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
|
||||
import {finalize} from 'rxjs/operators';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { ErrorCategory } from "../shared/error-category";
|
||||
@ -91,9 +93,9 @@ export class RecordFaultComponent implements OnInit, AfterViewInit {
|
||||
};
|
||||
this.faultService.create(fault).subscribe(fault => {
|
||||
if (this.photoUpload.nativeElement.files.length > 0) {
|
||||
this.faultService.attachImages(fault.id, this.photoUpload.nativeElement.files).finally(
|
||||
this.faultService.attachImages(fault.id, this.photoUpload.nativeElement.files).pipe(finalize(
|
||||
() => this.submitInProgress = false
|
||||
).subscribe(
|
||||
)).subscribe(
|
||||
attRes => this.router.navigate(['/hiba/feladat-lista']),
|
||||
attErr => {
|
||||
console.log("File upload error");
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
|
||||
import {finalize} from 'rxjs/operators';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { Fault } from "../shared/fault";
|
||||
@ -30,15 +32,15 @@ export class RepairCompleteComponent implements OnInit {
|
||||
|
||||
public confirm() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.acknowledgeRepair(this.fault)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.acknowledgeRepair(this.fault).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
public reject() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.reject(this.fault, 'cnf', this.rejectReason)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.reject(this.fault, 'cnf', this.rejectReason).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
|
||||
import {finalize} from 'rxjs/operators';
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { Title } from "@angular/platform-browser";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
@ -78,8 +80,8 @@ export class RepairFaultComponent implements OnInit {
|
||||
|
||||
public addComment() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.addComment(this.fault.id, this.comment.trim())
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.addComment(this.fault.id, this.comment.trim()).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(fault => {
|
||||
this.fault = fault;
|
||||
this.comments = fault.comments.reverse();
|
||||
@ -89,8 +91,8 @@ export class RepairFaultComponent implements OnInit {
|
||||
|
||||
public attachImages() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.attachImages(this.fault.id, this.photoUpload.nativeElement.files)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.attachImages(this.fault.id, this.photoUpload.nativeElement.files).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(
|
||||
attRes => this.photoUpload.nativeElement.value = null,
|
||||
attErr => alert("Hiba történt a képfeltöltés közben.")
|
||||
@ -99,8 +101,8 @@ export class RepairFaultComponent implements OnInit {
|
||||
|
||||
public confirmRepair() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.repairDone(this.fault)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
this.faultManager.repairDone(this.fault).pipe(
|
||||
finalize(() => this.submitInProgress = false))
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
@ -166,11 +168,11 @@ export class RepairFaultComponent implements OnInit {
|
||||
|
||||
saveWorkData() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.update(this.fault)
|
||||
.finally(() => {
|
||||
this.faultManager.update(this.fault).pipe(
|
||||
finalize(() => {
|
||||
this.submitInProgress = false;
|
||||
this.costChanged = false;
|
||||
})
|
||||
}))
|
||||
.subscribe(fault => this.fault = fault);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
import { HttpClient, HttpHeaders, HttpRequest } from "@angular/common/http";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from "@angular/common/http";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
@Injectable()
|
||||
export class JsonRequestInterceptorService implements HttpInterceptor {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
import { User } from "./shared/user";
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UserService } from "../user.service";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { Title } from "@angular/platform-browser";
|
||||
import { finalize } from 'rxjs/operators';
|
||||
|
||||
import { User } from "../shared/user";
|
||||
import { UserService } from "../user.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
@ -32,8 +34,8 @@ export class SettingsComponent implements OnInit {
|
||||
public changePassword() {
|
||||
this.submitInProgress=true;
|
||||
if (this.user.canChangePassword) {
|
||||
this.userService.changeOwnPassword(this.oldPassword, this.newPassword)
|
||||
.finally(()=>this.submitInProgress=false)
|
||||
this.userService.changeOwnPassword(this.oldPassword, this.newPassword).pipe(
|
||||
finalize(()=>this.submitInProgress=false))
|
||||
.subscribe(
|
||||
ok => {
|
||||
if (ok) {
|
||||
@ -54,7 +56,7 @@ export class SettingsComponent implements OnInit {
|
||||
this.submitInProgress=true;
|
||||
this.userService.changeSettings({
|
||||
wantsEmail: this.user.wantsEmail
|
||||
}).finally(()=>this.submitInProgress=false)
|
||||
}).pipe(finalize(()=>this.submitInProgress=false))
|
||||
.subscribe(okResult => this.router.navigate(['/']));
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
import { User } from "./shared/user";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user