ngx-techlify-core 14.9.4 → 14.9.5

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.
@@ -3960,6 +3960,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
3960
3960
  type: Output
3961
3961
  }] } });
3962
3962
 
3963
+ var UserTypeEnum;
3964
+ (function (UserTypeEnum) {
3965
+ UserTypeEnum[UserTypeEnum["ADMIN"] = 1] = "ADMIN";
3966
+ UserTypeEnum[UserTypeEnum["CLIENT_ADMIN"] = 2] = "CLIENT_ADMIN";
3967
+ UserTypeEnum[UserTypeEnum["CLIENT_USER"] = 3] = "CLIENT_USER";
3968
+ })(UserTypeEnum || (UserTypeEnum = {}));
3969
+
3963
3970
  /* tslint:disable:radix */
3964
3971
  class RequestHelperService {
3965
3972
  constructor(router, activatedRoute) {
@@ -4221,11 +4228,14 @@ let UsersViewAllComponent = class UsersViewAllComponent {
4221
4228
  * @param user User
4222
4229
  */
4223
4230
  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;
4231
+ let userClient;
4232
+ if (this.currentUserService.getUser()?.user_type_id === UserTypeEnum.ADMIN && !!this.clientId) {
4233
+ userClient = user?.user_clients.find((item) => item?.client_id === this.clientId);
4227
4234
  }
4228
- return '';
4235
+ else {
4236
+ userClient = user?.user_clients.find((item) => item?.client_id === this.currentUser?.client_id);
4237
+ }
4238
+ return userClient?.type?.title || '';
4229
4239
  }
4230
4240
  };
4231
4241
  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 });