ngx-techlify-core 14.9.4 → 14.9.6

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.
@@ -5,9 +5,9 @@ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
5
5
  import * as i7 from '@angular/flex-layout/flex';
6
6
  import * as i7$1 from '@angular/material/button';
7
7
  import { MatButtonModule } from '@angular/material/button';
8
+ import { __decorate } from 'tslib';
8
9
  import { debounceTime, catchError, takeUntil, tap, distinctUntilChanged, startWith, switchMap, finalize, map as map$1, filter } from 'rxjs/operators';
9
10
  import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
10
- import { __decorate } from 'tslib';
11
11
  import * as i11 from '@angular/material/table';
12
12
  import { MatTableDataSource, MatTableModule } from '@angular/material/table';
13
13
  import * as i10 from '@angular/material/sort';
@@ -171,7 +171,7 @@ class TechlifyFormComponentInterface {
171
171
  * - comments on more code
172
172
  * - save time, save energy
173
173
  */
174
- class TechlifyListingControllerInterface {
174
+ let TechlifyListingControllerInterface = class TechlifyListingControllerInterface {
175
175
  constructor() {
176
176
  this.models = [];
177
177
  this.page = 1;
@@ -216,7 +216,10 @@ class TechlifyListingControllerInterface {
216
216
  resetFilter(field) {
217
217
  this.filterForm.get(field).reset('');
218
218
  }
219
- }
219
+ };
220
+ TechlifyListingControllerInterface = __decorate([
221
+ UntilDestroy()
222
+ ], TechlifyListingControllerInterface);
220
223
 
221
224
  /**
222
225
  * Interface used to ensure we have a consistent structure across our listing pages
@@ -3960,6 +3963,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
3960
3963
  type: Output
3961
3964
  }] } });
3962
3965
 
3966
+ var UserTypeEnum;
3967
+ (function (UserTypeEnum) {
3968
+ UserTypeEnum[UserTypeEnum["ADMIN"] = 1] = "ADMIN";
3969
+ UserTypeEnum[UserTypeEnum["CLIENT_ADMIN"] = 2] = "CLIENT_ADMIN";
3970
+ UserTypeEnum[UserTypeEnum["CLIENT_USER"] = 3] = "CLIENT_USER";
3971
+ })(UserTypeEnum || (UserTypeEnum = {}));
3972
+
3963
3973
  /* tslint:disable:radix */
3964
3974
  class RequestHelperService {
3965
3975
  constructor(router, activatedRoute) {
@@ -4221,11 +4231,14 @@ let UsersViewAllComponent = class UsersViewAllComponent {
4221
4231
  * @param user User
4222
4232
  */
4223
4233
  getUserType(user) {
4224
- const userClient = user?.user_clients.find((item) => item?.client_id === this.currentUser?.client_id);
4225
- if (userClient) {
4226
- return userClient?.type?.title;
4234
+ let userClient;
4235
+ if (this.currentUserService.getUser()?.user_type_id === UserTypeEnum.ADMIN && !!this.clientId) {
4236
+ userClient = user?.user_clients.find((item) => item?.client_id === this.clientId);
4227
4237
  }
4228
- return '';
4238
+ else {
4239
+ userClient = user?.user_clients.find((item) => item?.client_id === this.currentUser?.client_id);
4240
+ }
4241
+ return userClient?.type?.title || '';
4229
4242
  }
4230
4243
  };
4231
4244
  UsersViewAllComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: UsersViewAllComponent, deps: [{ token: HttpService }, { token: AlertService }, { token: CurrentUserService }, { token: UserConfigService }, { token: i1.MatDialog }, { token: UserService }, { token: i1$4.UntypedFormBuilder }, { token: RequestHelperService }], target: i0.ɵɵFactoryTarget.Component });