taxtank-core 0.32.27 → 0.32.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/services/account-setup/account-setup.service.mjs +2 -2
- package/esm2022/lib/services/http/firm/employee/employee.service.mjs +13 -43
- package/esm2022/lib/services/http/google/google.service.mjs +4 -6
- package/esm2022/lib/services/http/rest/rest-old.service.mjs +8 -2
- package/esm2022/lib/services/http/rest/rest.service.mjs +10 -3
- package/esm2022/lib/services/pdf/pdf-from-dom-element/file-settings.mjs +3 -5
- package/esm2022/lib/validators/unique-email.validator.mjs +3 -3
- package/fesm2022/taxtank-core.mjs +77 -96
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/lib/services/http/firm/employee/employee.service.d.ts +9 -11
- package/lib/services/http/google/google.service.d.ts +1 -3
- package/lib/services/http/rest/rest-old.service.d.ts +4 -0
- package/lib/services/http/rest/rest.service.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
|
-
import { catchError,
|
|
2
|
+
import { catchError, debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators';
|
|
3
3
|
import { Injectable } from '@angular/core';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "../services";
|
|
@@ -8,7 +8,7 @@ export class UniqueEmailValidator {
|
|
|
8
8
|
this.userService = userService;
|
|
9
9
|
}
|
|
10
10
|
validate(control) {
|
|
11
|
-
return this.userService.search(
|
|
11
|
+
return control.valueChanges.pipe(debounceTime(500), distinctUntilChanged(), switchMap((value) => this.userService.search(value)), map((user) => (user ? { emailIsUsed: true } : null)), catchError(() => of(null)));
|
|
12
12
|
}
|
|
13
13
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, deps: [{ token: i1.UserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
14
14
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, providedIn: 'root' }); }
|
|
@@ -17,4 +17,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
17
17
|
type: Injectable,
|
|
18
18
|
args: [{ providedIn: 'root' }]
|
|
19
19
|
}], ctorParameters: function () { return [{ type: i1.UserService }]; } });
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pcXVlLWVtYWlsLnZhbGlkYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi92YWxpZGF0b3JzL3VuaXF1ZS1lbWFpbC52YWxpZGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsT0FBTyxFQUFjLEVBQUUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUN0QyxPQUFPLEVBQUUsVUFBVSxFQUFFLFlBQVksRUFBUyxvQkFBb0IsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFHdkcsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7O0FBRzNDLE1BQU0sT0FBTyxvQkFBb0I7SUFDL0IsWUFBb0IsV0FBd0I7UUFBeEIsZ0JBQVcsR0FBWCxXQUFXLENBQWE7SUFBRyxDQUFDO0lBRWhELFFBQVEsQ0FBQyxPQUF3QjtRQUMvQixPQUFPLE9BQU8sQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUM5QixZQUFZLENBQUMsR0FBRyxDQUFDLEVBQ2pCLG9CQUFvQixFQUFFLEVBQ3RCLFNBQVMsQ0FBQyxDQUFDLEtBQWEsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsRUFDNUQsR0FBRyxDQUFDLENBQUMsSUFBVSxFQUFFLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxXQUFXLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQzFELFVBQVUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FDM0IsQ0FBQztJQUNKLENBQUM7K0dBWFUsb0JBQW9CO21IQUFwQixvQkFBb0IsY0FEUCxNQUFNOzs0RkFDbkIsb0JBQW9CO2tCQURoQyxVQUFVO21CQUFDLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIEFic3RyYWN0Q29udHJvbCwgQXN5bmNWYWxpZGF0b3IsXG4gIFZhbGlkYXRpb25FcnJvcnMsXG59IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IE9ic2VydmFibGUsIG9mIH0gZnJvbSAncnhqcyc7XG5pbXBvcnQgeyBjYXRjaEVycm9yLCBkZWJvdW5jZVRpbWUsIGRlbGF5LCBkaXN0aW5jdFVudGlsQ2hhbmdlZCwgbWFwLCBzd2l0Y2hNYXAgfSBmcm9tICdyeGpzL29wZXJhdG9ycyc7XG5pbXBvcnQgeyBVc2VyU2VydmljZSB9IGZyb20gJy4uL3NlcnZpY2VzJztcbmltcG9ydCB7IFVzZXIgfSBmcm9tICcuLi9tb2RlbHMnO1xuaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5ASW5qZWN0YWJsZSh7IHByb3ZpZGVkSW46ICdyb290JyB9KVxuZXhwb3J0IGNsYXNzIFVuaXF1ZUVtYWlsVmFsaWRhdG9yIGltcGxlbWVudHMgQXN5bmNWYWxpZGF0b3Ige1xuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHVzZXJTZXJ2aWNlOiBVc2VyU2VydmljZSkge31cblxuICB2YWxpZGF0ZShjb250cm9sOiBBYnN0cmFjdENvbnRyb2wpOiBPYnNlcnZhYmxlPFZhbGlkYXRpb25FcnJvcnMgfCBudWxsPiB7XG4gICAgcmV0dXJuIGNvbnRyb2wudmFsdWVDaGFuZ2VzLnBpcGUoXG4gICAgICBkZWJvdW5jZVRpbWUoNTAwKSxcbiAgICAgIGRpc3RpbmN0VW50aWxDaGFuZ2VkKCksXG4gICAgICBzd2l0Y2hNYXAoKHZhbHVlOiBzdHJpbmcpID0+IHRoaXMudXNlclNlcnZpY2Uuc2VhcmNoKHZhbHVlKSksXG4gICAgICBtYXAoKHVzZXI6IFVzZXIpID0+ICh1c2VyID8geyBlbWFpbElzVXNlZDogdHJ1ZSB9IDogbnVsbCkpLFxuICAgICAgY2F0Y2hFcnJvcigoKSA9PiBvZihudWxsKSlcbiAgICApO1xuICB9XG59XG4iXX0=
|
|
@@ -4,7 +4,7 @@ import * as i1$1 from '@angular/common';
|
|
|
4
4
|
import { formatDate, CommonModule, CurrencyPipe, DatePipe } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
6
|
import { HttpParams, HttpClient, HttpErrorResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
7
|
-
import { map, mergeMap, filter, first as first$1, catchError, take, switchMap, finalize, debounceTime, distinctUntilChanged, startWith
|
|
7
|
+
import { map, mergeMap, filter, first as first$1, catchError, take, switchMap, finalize, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
8
8
|
import { ReplaySubject, Subject, BehaviorSubject, Observable, throwError, combineLatest, forkJoin, of, from, merge as merge$1 } from 'rxjs';
|
|
9
9
|
import { plainToClass, Type, Transform, Exclude, Expose, classToPlain } from 'class-transformer';
|
|
10
10
|
import get from 'lodash/get';
|
|
@@ -10668,6 +10668,12 @@ let RestService$1 = class RestService extends DataService {
|
|
|
10668
10668
|
this.cache = undefined;
|
|
10669
10669
|
this.get();
|
|
10670
10670
|
}
|
|
10671
|
+
/**
|
|
10672
|
+
* perform a shallow copy of the emitted data to make it immutable
|
|
10673
|
+
*/
|
|
10674
|
+
getCacheSubjectObservable() {
|
|
10675
|
+
return this.cacheSubject.asObservable().pipe(map((cache) => clone(cache)));
|
|
10676
|
+
}
|
|
10671
10677
|
/**
|
|
10672
10678
|
* Get data from backend and fill the cache
|
|
10673
10679
|
*/
|
|
@@ -10675,7 +10681,7 @@ let RestService$1 = class RestService extends DataService {
|
|
|
10675
10681
|
this.handleAccessError('get');
|
|
10676
10682
|
if (!this.hasRoles()) {
|
|
10677
10683
|
this.setCache([], true);
|
|
10678
|
-
return this.
|
|
10684
|
+
return this.getCacheSubjectObservable();
|
|
10679
10685
|
}
|
|
10680
10686
|
// Set cache as empty collection to avoid multiple requests before cache filled
|
|
10681
10687
|
this.setCache([]);
|
|
@@ -10689,7 +10695,7 @@ let RestService$1 = class RestService extends DataService {
|
|
|
10689
10695
|
if (!this.cache) {
|
|
10690
10696
|
this.fetch(path).pipe(first$1()).subscribe();
|
|
10691
10697
|
}
|
|
10692
|
-
return this.
|
|
10698
|
+
return this.getCacheSubjectObservable();
|
|
10693
10699
|
}
|
|
10694
10700
|
getFirst() {
|
|
10695
10701
|
this.handleAccessError('get');
|
|
@@ -11901,12 +11907,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
11901
11907
|
* https://developers.google.com/identity/gsi/web/guides/overview
|
|
11902
11908
|
*/
|
|
11903
11909
|
class GoogleService {
|
|
11904
|
-
constructor(http, toastService, jwtService, router,
|
|
11910
|
+
constructor(http, toastService, jwtService, router, environment) {
|
|
11905
11911
|
this.http = http;
|
|
11906
11912
|
this.toastService = toastService;
|
|
11907
11913
|
this.jwtService = jwtService;
|
|
11908
11914
|
this.router = router;
|
|
11909
|
-
this.mpService = mpService;
|
|
11910
11915
|
this.environment = environment;
|
|
11911
11916
|
this.isLoggedInSubject = new BehaviorSubject(!this.jwtService.isTokenExpired());
|
|
11912
11917
|
this.isGoogleEnabled = !!this.environment['googleClientId'];
|
|
@@ -11953,7 +11958,7 @@ class GoogleService {
|
|
|
11953
11958
|
logout() {
|
|
11954
11959
|
google.accounts.id.disableAutoSelect();
|
|
11955
11960
|
}
|
|
11956
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GoogleService, deps: [{ token: i1.HttpClient }, { token: ToastService }, { token: JwtService }, { token: i4.Router }, { token:
|
|
11961
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GoogleService, deps: [{ token: i1.HttpClient }, { token: ToastService }, { token: JwtService }, { token: i4.Router }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11957
11962
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GoogleService, providedIn: 'root' }); }
|
|
11958
11963
|
}
|
|
11959
11964
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GoogleService, decorators: [{
|
|
@@ -11961,7 +11966,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
11961
11966
|
args: [{
|
|
11962
11967
|
providedIn: 'root'
|
|
11963
11968
|
}]
|
|
11964
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: ToastService }, { type: JwtService }, { type: i4.Router }, { type:
|
|
11969
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: ToastService }, { type: JwtService }, { type: i4.Router }, { type: undefined, decorators: [{
|
|
11965
11970
|
type: Inject,
|
|
11966
11971
|
args: ['environment']
|
|
11967
11972
|
}] }]; } });
|
|
@@ -12198,6 +12203,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
12198
12203
|
args: ['environment']
|
|
12199
12204
|
}] }]; } });
|
|
12200
12205
|
|
|
12206
|
+
var EmployeeMessagesEnum;
|
|
12207
|
+
(function (EmployeeMessagesEnum) {
|
|
12208
|
+
EmployeeMessagesEnum["ROLE_GRANTED"] = "Manager role granted to ";
|
|
12209
|
+
EmployeeMessagesEnum["ROLE_REMOVED"] = "Manager role took away from ";
|
|
12210
|
+
EmployeeMessagesEnum["CONFIRM_GRANT"] = "Are you sure you want to make this user manager?";
|
|
12211
|
+
EmployeeMessagesEnum["CONFIRM_REMOVE"] = "Are you sure you want to remove manager right from this user?";
|
|
12212
|
+
EmployeeMessagesEnum["CONFIRM_DEACTIVATE"] = "Are you sure you want to deactivate the employee account?";
|
|
12213
|
+
EmployeeMessagesEnum["CONFIRM_ACTIVATE"] = "Are you sure you want to activate the employee account?";
|
|
12214
|
+
EmployeeMessagesEnum["ACTIVATED"] = "Employee account activated";
|
|
12215
|
+
EmployeeMessagesEnum["DEACTIVATED"] = "Employee account deactivated";
|
|
12216
|
+
EmployeeMessagesEnum["DEACTIVATE_ERROR"] = "All clients must be transferred prior to removing an accountant";
|
|
12217
|
+
})(EmployeeMessagesEnum || (EmployeeMessagesEnum = {}));
|
|
12218
|
+
|
|
12219
|
+
class EmployeeService extends RestService$1 {
|
|
12220
|
+
constructor() {
|
|
12221
|
+
super(...arguments);
|
|
12222
|
+
this.endpointUri = 'employees';
|
|
12223
|
+
this.modelClass = User;
|
|
12224
|
+
this.collectionClass = (Collection);
|
|
12225
|
+
this.disabledMethods = ['postBatch', 'putBatch'];
|
|
12226
|
+
this.messages = EmployeeMessagesEnum;
|
|
12227
|
+
}
|
|
12228
|
+
activateEmployee(employee) {
|
|
12229
|
+
return super.put(employee, `${this.environment.apiV2}/${this.endpointUri}/${employee.id}/activate`);
|
|
12230
|
+
}
|
|
12231
|
+
deactivateEmployee(employee) {
|
|
12232
|
+
return super.put(employee, `${this.environment.apiV2}/${this.endpointUri}/${employee.id}/deactivate`)
|
|
12233
|
+
.pipe(catchError((error) => {
|
|
12234
|
+
// Show error when user provided another login (not login he used before)
|
|
12235
|
+
if (error.status === 400) {
|
|
12236
|
+
this.toastService.error(this.messages.DEACTIVATE_ERROR);
|
|
12237
|
+
}
|
|
12238
|
+
return throwError(error);
|
|
12239
|
+
}));
|
|
12240
|
+
}
|
|
12241
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12242
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeService, providedIn: 'root' }); }
|
|
12243
|
+
}
|
|
12244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeService, decorators: [{
|
|
12245
|
+
type: Injectable,
|
|
12246
|
+
args: [{
|
|
12247
|
+
providedIn: 'root'
|
|
12248
|
+
}]
|
|
12249
|
+
}] });
|
|
12250
|
+
|
|
12251
|
+
class EmployeeInvite extends EmployeeInvite$1 {
|
|
12252
|
+
}
|
|
12253
|
+
__decorate([
|
|
12254
|
+
Type(() => RegistrationInvite)
|
|
12255
|
+
], EmployeeInvite.prototype, "registrationInvite", void 0);
|
|
12256
|
+
__decorate([
|
|
12257
|
+
Type(() => User)
|
|
12258
|
+
], EmployeeInvite.prototype, "employee", void 0);
|
|
12259
|
+
|
|
12201
12260
|
/**
|
|
12202
12261
|
* Abstract base service that implements common services functionality
|
|
12203
12262
|
* and describe abstract methods/properties that have to be implemented in child services
|
|
@@ -12241,7 +12300,7 @@ class RestService {
|
|
|
12241
12300
|
if (!this.cache) {
|
|
12242
12301
|
this.fetch(path).pipe(first$1()).subscribe();
|
|
12243
12302
|
}
|
|
12244
|
-
return this.
|
|
12303
|
+
return this.getCacheSubjectObservable();
|
|
12245
12304
|
}
|
|
12246
12305
|
/**
|
|
12247
12306
|
* get instance by id from cache
|
|
@@ -12402,6 +12461,12 @@ class RestService {
|
|
|
12402
12461
|
updateCache() {
|
|
12403
12462
|
this.cacheSubject.next(this.cache.slice());
|
|
12404
12463
|
}
|
|
12464
|
+
/**
|
|
12465
|
+
* perform a shallow copy of the emitted data to make it immutable
|
|
12466
|
+
*/
|
|
12467
|
+
getCacheSubjectObservable() {
|
|
12468
|
+
return this.cacheSubject.asObservable().pipe(map((cache) => cache.slice()));
|
|
12469
|
+
}
|
|
12405
12470
|
/**
|
|
12406
12471
|
* @TODO use excludeExtraneousValues when all models refactored (exposed all needed properties)
|
|
12407
12472
|
* Create new instance of class
|
|
@@ -12423,88 +12488,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
12423
12488
|
args: ['environment']
|
|
12424
12489
|
}] }]; } });
|
|
12425
12490
|
|
|
12426
|
-
var EmployeeMessagesEnum;
|
|
12427
|
-
(function (EmployeeMessagesEnum) {
|
|
12428
|
-
EmployeeMessagesEnum["ROLE_GRANTED"] = "Manager role granted to ";
|
|
12429
|
-
EmployeeMessagesEnum["ROLE_REMOVED"] = "Manager role took away from ";
|
|
12430
|
-
EmployeeMessagesEnum["CONFIRM_GRANT"] = "Are you sure you want to make this user manager?";
|
|
12431
|
-
EmployeeMessagesEnum["CONFIRM_REMOVE"] = "Are you sure you want to remove manager right from this user?";
|
|
12432
|
-
EmployeeMessagesEnum["CONFIRM_DEACTIVATE"] = "Are you sure you want to deactivate the employee account?";
|
|
12433
|
-
EmployeeMessagesEnum["CONFIRM_ACTIVATE"] = "Are you sure you want to activate the employee account?";
|
|
12434
|
-
EmployeeMessagesEnum["ACTIVATED"] = "Employee account activated";
|
|
12435
|
-
EmployeeMessagesEnum["DEACTIVATED"] = "Employee account deactivated";
|
|
12436
|
-
EmployeeMessagesEnum["DEACTIVATE_ERROR"] = "All clients must be transferred prior to removing an accountant";
|
|
12437
|
-
})(EmployeeMessagesEnum || (EmployeeMessagesEnum = {}));
|
|
12438
|
-
|
|
12439
|
-
class EmployeeService extends RestService {
|
|
12440
|
-
constructor() {
|
|
12441
|
-
super(...arguments);
|
|
12442
|
-
this.url = 'employees';
|
|
12443
|
-
this.modelClass = User;
|
|
12444
|
-
this.messages = EmployeeMessagesEnum;
|
|
12445
|
-
}
|
|
12446
|
-
/**
|
|
12447
|
-
* Grant/Remove Manager role to employee
|
|
12448
|
-
* @param employee
|
|
12449
|
-
*/
|
|
12450
|
-
toggleManagerRole(employee) {
|
|
12451
|
-
return this.http.put(`${this.environment.apiV2}/${this.url}/${employee.id}`, {})
|
|
12452
|
-
.pipe(map((updatedEmployeeBase) => {
|
|
12453
|
-
const tempCache = this.cache;
|
|
12454
|
-
const updatedEmployee = plainToClass(User, updatedEmployeeBase);
|
|
12455
|
-
replace(tempCache, updatedEmployee);
|
|
12456
|
-
this.cache = _.cloneDeep(tempCache);
|
|
12457
|
-
this.updateCache();
|
|
12458
|
-
return updatedEmployee;
|
|
12459
|
-
}));
|
|
12460
|
-
}
|
|
12461
|
-
activateEmployee(employee, path = `${this.environment.apiV2}/${this.url}/${employee.id}/activate`) {
|
|
12462
|
-
return this.http.put(path, {})
|
|
12463
|
-
.pipe(map((updatedEmployeeBase) => {
|
|
12464
|
-
const tempCache = this.cache;
|
|
12465
|
-
const updatedEmployee = plainToClass(User, updatedEmployeeBase);
|
|
12466
|
-
replace(tempCache, updatedEmployee);
|
|
12467
|
-
this.cache = _.cloneDeep(tempCache);
|
|
12468
|
-
this.updateCache();
|
|
12469
|
-
return updatedEmployee;
|
|
12470
|
-
}));
|
|
12471
|
-
}
|
|
12472
|
-
deactivateEmployee(employee, path = `${this.environment.apiV2}/${this.url}/${employee.id}/deactivate`) {
|
|
12473
|
-
return this.http.put(path, {})
|
|
12474
|
-
.pipe(map((updatedEmployeeBase) => {
|
|
12475
|
-
const tempCache = this.cache;
|
|
12476
|
-
const updatedEmployee = plainToClass(User, updatedEmployeeBase);
|
|
12477
|
-
replace(tempCache, updatedEmployee);
|
|
12478
|
-
this.cache = _.cloneDeep(tempCache);
|
|
12479
|
-
this.updateCache();
|
|
12480
|
-
return updatedEmployee;
|
|
12481
|
-
}), catchError((error) => {
|
|
12482
|
-
// Show error when user provided another login (not login he used before)
|
|
12483
|
-
if (error.status === 400) {
|
|
12484
|
-
this.toastService.error(this.messages.DEACTIVATE_ERROR);
|
|
12485
|
-
}
|
|
12486
|
-
return throwError(error);
|
|
12487
|
-
}));
|
|
12488
|
-
}
|
|
12489
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12490
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeService, providedIn: 'root' }); }
|
|
12491
|
-
}
|
|
12492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeService, decorators: [{
|
|
12493
|
-
type: Injectable,
|
|
12494
|
-
args: [{
|
|
12495
|
-
providedIn: 'root'
|
|
12496
|
-
}]
|
|
12497
|
-
}] });
|
|
12498
|
-
|
|
12499
|
-
class EmployeeInvite extends EmployeeInvite$1 {
|
|
12500
|
-
}
|
|
12501
|
-
__decorate([
|
|
12502
|
-
Type(() => RegistrationInvite)
|
|
12503
|
-
], EmployeeInvite.prototype, "registrationInvite", void 0);
|
|
12504
|
-
__decorate([
|
|
12505
|
-
Type(() => User)
|
|
12506
|
-
], EmployeeInvite.prototype, "employee", void 0);
|
|
12507
|
-
|
|
12508
12491
|
class EmployeeInviteService extends RestService {
|
|
12509
12492
|
constructor() {
|
|
12510
12493
|
super(...arguments);
|
|
@@ -17929,7 +17912,7 @@ class AccountSetupService {
|
|
|
17929
17912
|
batch.push(
|
|
17930
17913
|
// Invite team item is completed when firm has employees except firm owner or firm has invited employees.
|
|
17931
17914
|
this.setItemStatus(this.items.findBy('isInviteTeam', true), combineLatest([
|
|
17932
|
-
this.employeeService.
|
|
17915
|
+
this.employeeService.getArray(),
|
|
17933
17916
|
this.employeeInviteService.get()
|
|
17934
17917
|
]).pipe(map(([employees, invites]) => {
|
|
17935
17918
|
// we always have at least 1 employee (firm owner), so we should check other employees except firm owner
|
|
@@ -18318,13 +18301,11 @@ const FILE_SETTINGS$1 = {
|
|
|
18318
18301
|
scale: 2,
|
|
18319
18302
|
useCORS: true,
|
|
18320
18303
|
},
|
|
18321
|
-
pagebreak: {
|
|
18322
|
-
mode: 'avoid-all'
|
|
18323
|
-
},
|
|
18324
18304
|
jsPDF: {
|
|
18325
18305
|
unit: 'mm',
|
|
18326
18306
|
format: 'a3',
|
|
18327
|
-
orientation: 'portrait'
|
|
18307
|
+
orientation: 'portrait',
|
|
18308
|
+
font: 'times'
|
|
18328
18309
|
}
|
|
18329
18310
|
};
|
|
18330
18311
|
|
|
@@ -20702,7 +20683,7 @@ class UniqueEmailValidator {
|
|
|
20702
20683
|
this.userService = userService;
|
|
20703
20684
|
}
|
|
20704
20685
|
validate(control) {
|
|
20705
|
-
return this.userService.search(
|
|
20686
|
+
return control.valueChanges.pipe(debounceTime(500), distinctUntilChanged(), switchMap((value) => this.userService.search(value)), map((user) => (user ? { emailIsUsed: true } : null)), catchError(() => of(null)));
|
|
20706
20687
|
}
|
|
20707
20688
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, deps: [{ token: UserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
20708
20689
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, providedIn: 'root' }); }
|