@flusys/ng-auth 5.0.3 → 5.1.0

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.
@@ -1,11 +1,11 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, Injectable, signal, computed, effect, PLATFORM_ID, InjectionToken, Component, untracked, DestroyRef, input, Injector, output, resource, makeStateKey, TransferState } from '@angular/core';
4
- import { APP_CONFIG, getServiceUrl, TRANSLATE_ADAPTER, isCompanyFeatureEnabled, isEmailFeatureEnabled, isSignUpEnabled, isFeatureEnabled, getPermissionMode, getDefaultCompanySlug, getDefaultBranchSlug } from '@flusys/ng-core';
4
+ import { APP_CONFIG, getServiceUrl, isCompanyFeatureEnabled, isServiceEnabled, isSignUpEnabled, getPermissionMode, getDefaultCompanySlug, getDefaultBranchSlug } from '@flusys/ng-core';
5
5
  import { of, timeout, switchMap, map, tap, catchError, shareReplay, finalize, BehaviorSubject, throwError, filter, take, from, forkJoin, firstValueFrom } from 'rxjs';
6
6
  import * as i2$1 from '@angular/router';
7
7
  import { Router, RouterOutlet, RouterLink, RouterLinkActive, ActivatedRoute } from '@angular/router';
8
- import { PlatformService, ApiResourceService, CookieService, resolveTranslationModule, SHARED_MESSAGES, permissionGuard, USER_PERMISSIONS, COMPANY_PERMISSIONS, BRANCH_PERMISSIONS, USER_PROVIDER, COMPANY_API_PROVIDER, USER_PERMISSION_PROVIDER, AUTH_STATE_PROVIDER, PermissionValidatorService, TranslatePipe, AngularModule, PrimeModule, HasPermissionDirective, FileUrlService, FILE_PROVIDER, PROFILE_PERMISSION_PROVIDER, FileUploaderComponent } from '@flusys/ng-shared';
8
+ import { PlatformService, TranslateService, ApiResourceService, CookieService, resolveTranslationModule, SHARED_MESSAGES, permissionGuard, USER_PERMISSIONS, COMPANY_PERMISSIONS, BRANCH_PERMISSIONS, USER_PROVIDER, COMPANY_API_PROVIDER, USER_PERMISSION_PROVIDER, AUTH_STATE_PROVIDER, PermissionValidatorService, TranslatePipe, AngularModule, PrimeModule, HasPermissionDirective, FileUrlService, FILE_PROVIDER, PROFILE_PERMISSION_PROVIDER, FileUploaderComponent } from '@flusys/ng-shared';
9
9
  import { map as map$1, catchError as catchError$1, tap as tap$1 } from 'rxjs/operators';
10
10
  import * as i1$1 from '@angular/common';
11
11
  import { isPlatformBrowser, CommonModule } from '@angular/common';
@@ -113,7 +113,7 @@ class AuthStateService {
113
113
  appConfig = inject(APP_CONFIG);
114
114
  router = inject(Router);
115
115
  platform = inject(PlatformService);
116
- translateAdapter = inject(TRANSLATE_ADAPTER, {
116
+ translateAdapter = inject(TranslateService, {
117
117
  optional: true,
118
118
  });
119
119
  // Core State (private writable, public readonly)
@@ -372,7 +372,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
372
372
  */
373
373
  class BranchApiService extends ApiResourceService {
374
374
  constructor() {
375
- super('branch', inject(HttpClient), 'administration');
375
+ super('branch', 'administration');
376
376
  }
377
377
  fetchByCompany(companyId, search = '') {
378
378
  this.fetchList(search, { filter: { companyId } });
@@ -391,7 +391,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
391
391
  */
392
392
  class CompanyApiService extends ApiResourceService {
393
393
  constructor() {
394
- super('company', inject(HttpClient), 'administration');
394
+ super('company', 'administration');
395
395
  }
396
396
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: CompanyApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
397
397
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: CompanyApiService, providedIn: 'root' });
@@ -436,7 +436,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
436
436
  */
437
437
  class UserApiService extends ApiResourceService {
438
438
  constructor() {
439
- super('users', inject(HttpClient), 'administration');
439
+ super('users', 'administration');
440
440
  }
441
441
  updateProfile(data) {
442
442
  return this.http.post(`${this.baseUrl}/profile`, data);
@@ -636,7 +636,7 @@ function tokenRefreshInterceptor(req, next) {
636
636
  const platformId = inject(PLATFORM_ID);
637
637
  const isBrowser = isPlatformBrowser(platformId);
638
638
  const refreshState = inject(TokenRefreshStateService);
639
- const translateAdapter = inject(TRANSLATE_ADAPTER, { optional: true });
639
+ const translateAdapter = inject(TranslateService, { optional: true });
640
640
  const t = (key) => translateAdapter?.translate(key) ?? key;
641
641
  // Skip refresh for these endpoints to prevent infinite loops
642
642
  const isRefreshRequest = isEndpoint(req.url, AUTH_ENDPOINTS.REFRESH);
@@ -1554,7 +1554,7 @@ class BranchFormComponent {
1554
1554
  branchService = inject(BranchApiService);
1555
1555
  companyService = inject(CompanyApiService);
1556
1556
  authState = inject(AuthStateService);
1557
- translateAdapter = inject(TRANSLATE_ADAPTER, {
1557
+ translateAdapter = inject(TranslateService, {
1558
1558
  optional: true,
1559
1559
  });
1560
1560
  translate(key, vars) {
@@ -2047,7 +2047,7 @@ class BranchListComponent {
2047
2047
  branchService = inject(BranchApiService);
2048
2048
  companyService = inject(CompanyApiService);
2049
2049
  authState = inject(AuthStateService);
2050
- translateAdapter = inject(TRANSLATE_ADAPTER, {
2050
+ translateAdapter = inject(TranslateService, {
2051
2051
  optional: true,
2052
2052
  });
2053
2053
  translate(key, vars) {
@@ -2408,7 +2408,7 @@ class CompanyFormComponent {
2408
2408
  route = inject(ActivatedRoute);
2409
2409
  messageService = inject(MessageService);
2410
2410
  companyService = inject(CompanyApiService);
2411
- translateAdapter = inject(TRANSLATE_ADAPTER, {
2411
+ translateAdapter = inject(TranslateService, {
2412
2412
  optional: true,
2413
2413
  });
2414
2414
  translate(key, vars) {
@@ -2847,7 +2847,7 @@ class CompanyListComponent {
2847
2847
  messageService = inject(MessageService);
2848
2848
  confirmationService = inject(ConfirmationService);
2849
2849
  companyService = inject(CompanyApiService);
2850
- translateAdapter = inject(TRANSLATE_ADAPTER, {
2850
+ translateAdapter = inject(TranslateService, {
2851
2851
  optional: true,
2852
2852
  });
2853
2853
  translate(key, vars) {
@@ -3142,7 +3142,7 @@ class ForgotPasswordPageComponent {
3142
3142
  destroyRef = inject(DestroyRef);
3143
3143
  messageService = inject(MessageService);
3144
3144
  authApi = inject(AuthApiService);
3145
- translateAdapter = inject(TRANSLATE_ADAPTER, {
3145
+ translateAdapter = inject(TranslateService, {
3146
3146
  optional: true,
3147
3147
  });
3148
3148
  translate(key, vars) {
@@ -3415,7 +3415,7 @@ class LoginPageComponent {
3415
3415
  messageService = inject(MessageService);
3416
3416
  authApi = inject(AuthApiService);
3417
3417
  authState = inject(AuthStateService);
3418
- translateAdapter = inject(TRANSLATE_ADAPTER, {
3418
+ translateAdapter = inject(TranslateService, {
3419
3419
  optional: true,
3420
3420
  });
3421
3421
  validationConfig = inject(AUTH_VALIDATION_CONFIG, {
@@ -3487,7 +3487,7 @@ class LoginPageComponent {
3487
3487
  });
3488
3488
  isSelectionFormValid = computed(() => this.selectionForm().valid(), ...(ngDevMode ? [{ debugName: "isSelectionFormValid" }] : []));
3489
3489
  companyFeatureEnabled = computed(() => isCompanyFeatureEnabled(this.appConfig), ...(ngDevMode ? [{ debugName: "companyFeatureEnabled" }] : []));
3490
- emailFeatureEnabled = computed(() => isEmailFeatureEnabled(this.appConfig), ...(ngDevMode ? [{ debugName: "emailFeatureEnabled" }] : []));
3490
+ emailFeatureEnabled = computed(() => isServiceEnabled(this.appConfig, 'email'), ...(ngDevMode ? [{ debugName: "emailFeatureEnabled" }] : []));
3491
3491
  signUpEnabled = computed(() => isSignUpEnabled(this.appConfig), ...(ngDevMode ? [{ debugName: "signUpEnabled" }] : []));
3492
3492
  sessionId = null;
3493
3493
  companies = signal([], ...(ngDevMode ? [{ debugName: "companies" }] : []));
@@ -4273,7 +4273,7 @@ class ProfilePageComponent {
4273
4273
  userFormExtension = inject(AUTH_USER_FORM_EXTENSION, {
4274
4274
  optional: true,
4275
4275
  });
4276
- translateAdapter = inject(TRANSLATE_ADAPTER, {
4276
+ translateAdapter = inject(TranslateService, {
4277
4277
  optional: true,
4278
4278
  });
4279
4279
  translate(key, vars) {
@@ -4335,9 +4335,9 @@ class ProfilePageComponent {
4335
4335
  }, ...(ngDevMode ? [{ debugName: "userInitials" }] : []));
4336
4336
  companyName = computed(() => this.authState.companyName(), ...(ngDevMode ? [{ debugName: "companyName" }] : []));
4337
4337
  branchName = computed(() => this.authState.branchName(), ...(ngDevMode ? [{ debugName: "branchName" }] : []));
4338
- showUploadSection = computed(() => isFeatureEnabled(this.appConfig, 'storage') && this.fileProvider !== null, ...(ngDevMode ? [{ debugName: "showUploadSection" }] : []));
4338
+ showUploadSection = computed(() => isServiceEnabled(this.appConfig, 'storage') && this.fileProvider !== null, ...(ngDevMode ? [{ debugName: "showUploadSection" }] : []));
4339
4339
  showCompanySection = computed(() => isCompanyFeatureEnabled(this.appConfig), ...(ngDevMode ? [{ debugName: "showCompanySection" }] : []));
4340
- showPermissionsSection = computed(() => isFeatureEnabled(this.appConfig, 'iam') &&
4340
+ showPermissionsSection = computed(() => isServiceEnabled(this.appConfig, 'iam') &&
4341
4341
  this.permissionProvider !== null, ...(ngDevMode ? [{ debugName: "showPermissionsSection" }] : []));
4342
4342
  permissionMode = computed(() => getPermissionMode(this.appConfig), ...(ngDevMode ? [{ debugName: "permissionMode" }] : []));
4343
4343
  showRoles = computed(() => {
@@ -4446,7 +4446,7 @@ class ProfilePageComponent {
4446
4446
  this.originalFormModel.set(initialValues);
4447
4447
  this.formModel.set(initialValues);
4448
4448
  if (user.profilePictureId &&
4449
- isFeatureEnabled(this.appConfig, 'storage')) {
4449
+ isServiceEnabled(this.appConfig, 'storage')) {
4450
4450
  this.fileUrlService
4451
4451
  .fetchSingleFileUrl(user.profilePictureId)
4452
4452
  .pipe(takeUntilDestroyed(this.destroyRef))
@@ -4740,7 +4740,7 @@ class ProfilePageComponent {
4740
4740
  @for (field of editableFields(); track field.key) {
4741
4741
  <div class="flex flex-col gap-2">
4742
4742
  <label [for]="field.key" class="font-medium text-color">
4743
- {{ field.labelKey | translate : null : field.label
4743
+ {{ field.labelKey | translate: null : field.label
4744
4744
  }}{{ field.required ? ' *' : '' }}
4745
4745
  </label>
4746
4746
  @if (field.component) {
@@ -4794,7 +4794,9 @@ class ProfilePageComponent {
4794
4794
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
4795
4795
  @for (field of viewOnlyFields(); track field.key) {
4796
4796
  <div class="flex flex-col gap-1">
4797
- <label class="text-sm text-muted-color">{{ field.labelKey | translate : null : field.label }}</label>
4797
+ <label class="text-sm text-muted-color">{{
4798
+ field.labelKey | translate: null : field.label
4799
+ }}</label>
4798
4800
  <span class="text-color font-medium">
4799
4801
  @if (field.type === 'select') {
4800
4802
  {{
@@ -4821,7 +4823,8 @@ class ProfilePageComponent {
4821
4823
  pInputText
4822
4824
  [id]="field.key"
4823
4825
  [placeholder]="
4824
- field.placeholderKey | translate : null : (field.placeholder ?? '')
4826
+ field.placeholderKey
4827
+ | translate: null : field.placeholder ?? ''
4825
4828
  "
4826
4829
  [value]="getExtraFieldValue(field.key) ?? ''"
4827
4830
  [disabled]="field.editable === false"
@@ -4837,7 +4840,8 @@ class ProfilePageComponent {
4837
4840
  type="number"
4838
4841
  [id]="field.key"
4839
4842
  [placeholder]="
4840
- field.placeholderKey | translate : null : (field.placeholder ?? '')
4843
+ field.placeholderKey
4844
+ | translate: null : field.placeholder ?? ''
4841
4845
  "
4842
4846
  [value]="getExtraFieldValue(field.key) ?? ''"
4843
4847
  [disabled]="field.editable === false"
@@ -4855,7 +4859,8 @@ class ProfilePageComponent {
4855
4859
  pInputTextarea
4856
4860
  [id]="field.key"
4857
4861
  [placeholder]="
4858
- field.placeholderKey | translate : null : (field.placeholder ?? '')
4862
+ field.placeholderKey
4863
+ | translate: null : field.placeholder ?? ''
4859
4864
  "
4860
4865
  [value]="getExtraFieldValue(field.key) ?? ''"
4861
4866
  [disabled]="field.editable === false"
@@ -4876,11 +4881,16 @@ class ProfilePageComponent {
4876
4881
  (ngModelChange)="updateExtraField(field.key, $event)"
4877
4882
  >
4878
4883
  <option value="">
4879
- {{ field.placeholderKey | translate : null : (field.placeholder ?? ('shared.select' | translate)) }}
4884
+ {{
4885
+ field.placeholderKey
4886
+ | translate
4887
+ : null
4888
+ : field.placeholder ?? ('shared.select' | translate)
4889
+ }}
4880
4890
  </option>
4881
4891
  @for (opt of field.options; track opt.value) {
4882
4892
  <option [value]="opt.value">
4883
- {{ opt.labelKey | translate : null : opt.label }}
4893
+ {{ opt.labelKey | translate: null : opt.label }}
4884
4894
  </option>
4885
4895
  }
4886
4896
  </select>
@@ -4896,7 +4906,13 @@ class ProfilePageComponent {
4896
4906
  updateExtraField(field.key, $any($event.target).checked)
4897
4907
  "
4898
4908
  />
4899
- <span>{{ field.placeholderKey | translate : null : (field.placeholder ?? (field.labelKey | translate : null : field.label)) }}</span>
4909
+ <span>{{
4910
+ field.placeholderKey
4911
+ | translate
4912
+ : null
4913
+ : field.placeholder ??
4914
+ (field.labelKey | translate: null : field.label)
4915
+ }}</span>
4900
4916
  </label>
4901
4917
  }
4902
4918
  @case ('date') {
@@ -5014,7 +5030,9 @@ class ProfilePageComponent {
5014
5030
  @if (section.icon) {
5015
5031
  <i [class]="section.icon + ' text-primary'"></i>
5016
5032
  }
5017
- <span class="font-semibold text-color">{{ section.titleKey | translate : null : section.title }}</span>
5033
+ <span class="font-semibold text-color">{{
5034
+ section.titleKey | translate: null : section.title
5035
+ }}</span>
5018
5036
  </div>
5019
5037
  <div class="section-content">
5020
5038
  @if (section.component) {
@@ -5028,7 +5046,9 @@ class ProfilePageComponent {
5028
5046
  @if (section.icon) {
5029
5047
  <i [class]="section.icon + ' text-primary'"></i>
5030
5048
  }
5031
- <span class="font-semibold text-color">{{ section.titleKey | translate : null : section.title }}</span>
5049
+ <span class="font-semibold text-color">{{
5050
+ section.titleKey | translate: null : section.title
5051
+ }}</span>
5032
5052
  </div>
5033
5053
  <div class="section-content">
5034
5054
  @if (section.component) {
@@ -5270,7 +5290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5270
5290
  @for (field of editableFields(); track field.key) {
5271
5291
  <div class="flex flex-col gap-2">
5272
5292
  <label [for]="field.key" class="font-medium text-color">
5273
- {{ field.labelKey | translate : null : field.label
5293
+ {{ field.labelKey | translate: null : field.label
5274
5294
  }}{{ field.required ? ' *' : '' }}
5275
5295
  </label>
5276
5296
  @if (field.component) {
@@ -5324,7 +5344,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5324
5344
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
5325
5345
  @for (field of viewOnlyFields(); track field.key) {
5326
5346
  <div class="flex flex-col gap-1">
5327
- <label class="text-sm text-muted-color">{{ field.labelKey | translate : null : field.label }}</label>
5347
+ <label class="text-sm text-muted-color">{{
5348
+ field.labelKey | translate: null : field.label
5349
+ }}</label>
5328
5350
  <span class="text-color font-medium">
5329
5351
  @if (field.type === 'select') {
5330
5352
  {{
@@ -5351,7 +5373,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5351
5373
  pInputText
5352
5374
  [id]="field.key"
5353
5375
  [placeholder]="
5354
- field.placeholderKey | translate : null : (field.placeholder ?? '')
5376
+ field.placeholderKey
5377
+ | translate: null : field.placeholder ?? ''
5355
5378
  "
5356
5379
  [value]="getExtraFieldValue(field.key) ?? ''"
5357
5380
  [disabled]="field.editable === false"
@@ -5367,7 +5390,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5367
5390
  type="number"
5368
5391
  [id]="field.key"
5369
5392
  [placeholder]="
5370
- field.placeholderKey | translate : null : (field.placeholder ?? '')
5393
+ field.placeholderKey
5394
+ | translate: null : field.placeholder ?? ''
5371
5395
  "
5372
5396
  [value]="getExtraFieldValue(field.key) ?? ''"
5373
5397
  [disabled]="field.editable === false"
@@ -5385,7 +5409,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5385
5409
  pInputTextarea
5386
5410
  [id]="field.key"
5387
5411
  [placeholder]="
5388
- field.placeholderKey | translate : null : (field.placeholder ?? '')
5412
+ field.placeholderKey
5413
+ | translate: null : field.placeholder ?? ''
5389
5414
  "
5390
5415
  [value]="getExtraFieldValue(field.key) ?? ''"
5391
5416
  [disabled]="field.editable === false"
@@ -5406,11 +5431,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5406
5431
  (ngModelChange)="updateExtraField(field.key, $event)"
5407
5432
  >
5408
5433
  <option value="">
5409
- {{ field.placeholderKey | translate : null : (field.placeholder ?? ('shared.select' | translate)) }}
5434
+ {{
5435
+ field.placeholderKey
5436
+ | translate
5437
+ : null
5438
+ : field.placeholder ?? ('shared.select' | translate)
5439
+ }}
5410
5440
  </option>
5411
5441
  @for (opt of field.options; track opt.value) {
5412
5442
  <option [value]="opt.value">
5413
- {{ opt.labelKey | translate : null : opt.label }}
5443
+ {{ opt.labelKey | translate: null : opt.label }}
5414
5444
  </option>
5415
5445
  }
5416
5446
  </select>
@@ -5426,7 +5456,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5426
5456
  updateExtraField(field.key, $any($event.target).checked)
5427
5457
  "
5428
5458
  />
5429
- <span>{{ field.placeholderKey | translate : null : (field.placeholder ?? (field.labelKey | translate : null : field.label)) }}</span>
5459
+ <span>{{
5460
+ field.placeholderKey
5461
+ | translate
5462
+ : null
5463
+ : field.placeholder ??
5464
+ (field.labelKey | translate: null : field.label)
5465
+ }}</span>
5430
5466
  </label>
5431
5467
  }
5432
5468
  @case ('date') {
@@ -5544,7 +5580,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5544
5580
  @if (section.icon) {
5545
5581
  <i [class]="section.icon + ' text-primary'"></i>
5546
5582
  }
5547
- <span class="font-semibold text-color">{{ section.titleKey | translate : null : section.title }}</span>
5583
+ <span class="font-semibold text-color">{{
5584
+ section.titleKey | translate: null : section.title
5585
+ }}</span>
5548
5586
  </div>
5549
5587
  <div class="section-content">
5550
5588
  @if (section.component) {
@@ -5558,7 +5596,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
5558
5596
  @if (section.icon) {
5559
5597
  <i [class]="section.icon + ' text-primary'"></i>
5560
5598
  }
5561
- <span class="font-semibold text-color">{{ section.titleKey | translate : null : section.title }}</span>
5599
+ <span class="font-semibold text-color">{{
5600
+ section.titleKey | translate: null : section.title
5601
+ }}</span>
5562
5602
  </div>
5563
5603
  <div class="section-content">
5564
5604
  @if (section.component) {
@@ -5704,7 +5744,7 @@ class RegisterPageComponent {
5704
5744
  registrationExtension = inject(AUTH_REGISTRATION_EXTENSION, {
5705
5745
  optional: true,
5706
5746
  });
5707
- translateAdapter = inject(TRANSLATE_ADAPTER, {
5747
+ translateAdapter = inject(TranslateService, {
5708
5748
  optional: true,
5709
5749
  });
5710
5750
  translate(key, vars) {
@@ -6102,7 +6142,7 @@ class RegisterPageComponent {
6102
6142
  @for (field of extraFields(); track field.key) {
6103
6143
  <div [class]="field.containerClass ?? ''">
6104
6144
  <label [for]="field.key" class="block font-medium mb-2">
6105
- {{ field.labelKey | translate : null : field.label
6145
+ {{ field.labelKey | translate: null : field.label
6106
6146
  }}{{ field.required ? ' *' : '' }}
6107
6147
  </label>
6108
6148
  @if (field.component) {
@@ -6126,7 +6166,8 @@ class RegisterPageComponent {
6126
6166
  pInputText
6127
6167
  [id]="field.key"
6128
6168
  [placeholder]="
6129
- field.placeholderKey | translate : null : (field.placeholder ?? '')
6169
+ field.placeholderKey
6170
+ | translate: null : field.placeholder ?? ''
6130
6171
  "
6131
6172
  [value]="
6132
6173
  extraFieldsModel()[field.key] ??
@@ -6148,7 +6189,8 @@ class RegisterPageComponent {
6148
6189
  type="number"
6149
6190
  [id]="field.key"
6150
6191
  [placeholder]="
6151
- field.placeholderKey | translate : null : (field.placeholder ?? '')
6192
+ field.placeholderKey
6193
+ | translate: null : field.placeholder ?? ''
6152
6194
  "
6153
6195
  [value]="
6154
6196
  extraFieldsModel()[field.key] ??
@@ -6169,7 +6211,8 @@ class RegisterPageComponent {
6169
6211
  pInputTextarea
6170
6212
  [id]="field.key"
6171
6213
  [placeholder]="
6172
- field.placeholderKey | translate : null : (field.placeholder ?? '')
6214
+ field.placeholderKey
6215
+ | translate: null : field.placeholder ?? ''
6173
6216
  "
6174
6217
  [value]="
6175
6218
  extraFieldsModel()[field.key] ??
@@ -6203,11 +6246,19 @@ class RegisterPageComponent {
6203
6246
  "
6204
6247
  >
6205
6248
  <option value="">
6206
- {{ field.placeholderKey | translate : null : (field.placeholder ?? ('shared.select' | translate)) }}
6249
+ {{
6250
+ field.placeholderKey
6251
+ | translate
6252
+ : null
6253
+ : field.placeholder ??
6254
+ ('shared.select' | translate)
6255
+ }}
6207
6256
  </option>
6208
6257
  @for (opt of field.options; track opt.value) {
6209
6258
  <option [value]="opt.value">
6210
- {{ opt.labelKey | translate : null : opt.label }}
6259
+ {{
6260
+ opt.labelKey | translate: null : opt.label
6261
+ }}
6211
6262
  </option>
6212
6263
  }
6213
6264
  </select>
@@ -6229,7 +6280,14 @@ class RegisterPageComponent {
6229
6280
  )
6230
6281
  "
6231
6282
  />
6232
- <span>{{ field.placeholderKey | translate : null : (field.placeholder ?? (field.labelKey | translate : null : field.label)) }}</span>
6283
+ <span>{{
6284
+ field.placeholderKey
6285
+ | translate
6286
+ : null
6287
+ : field.placeholder ??
6288
+ (field.labelKey
6289
+ | translate: null : field.label)
6290
+ }}</span>
6233
6291
  </label>
6234
6292
  }
6235
6293
  @case ('date') {
@@ -6577,7 +6635,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
6577
6635
  @for (field of extraFields(); track field.key) {
6578
6636
  <div [class]="field.containerClass ?? ''">
6579
6637
  <label [for]="field.key" class="block font-medium mb-2">
6580
- {{ field.labelKey | translate : null : field.label
6638
+ {{ field.labelKey | translate: null : field.label
6581
6639
  }}{{ field.required ? ' *' : '' }}
6582
6640
  </label>
6583
6641
  @if (field.component) {
@@ -6601,7 +6659,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
6601
6659
  pInputText
6602
6660
  [id]="field.key"
6603
6661
  [placeholder]="
6604
- field.placeholderKey | translate : null : (field.placeholder ?? '')
6662
+ field.placeholderKey
6663
+ | translate: null : field.placeholder ?? ''
6605
6664
  "
6606
6665
  [value]="
6607
6666
  extraFieldsModel()[field.key] ??
@@ -6623,7 +6682,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
6623
6682
  type="number"
6624
6683
  [id]="field.key"
6625
6684
  [placeholder]="
6626
- field.placeholderKey | translate : null : (field.placeholder ?? '')
6685
+ field.placeholderKey
6686
+ | translate: null : field.placeholder ?? ''
6627
6687
  "
6628
6688
  [value]="
6629
6689
  extraFieldsModel()[field.key] ??
@@ -6644,7 +6704,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
6644
6704
  pInputTextarea
6645
6705
  [id]="field.key"
6646
6706
  [placeholder]="
6647
- field.placeholderKey | translate : null : (field.placeholder ?? '')
6707
+ field.placeholderKey
6708
+ | translate: null : field.placeholder ?? ''
6648
6709
  "
6649
6710
  [value]="
6650
6711
  extraFieldsModel()[field.key] ??
@@ -6678,11 +6739,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
6678
6739
  "
6679
6740
  >
6680
6741
  <option value="">
6681
- {{ field.placeholderKey | translate : null : (field.placeholder ?? ('shared.select' | translate)) }}
6742
+ {{
6743
+ field.placeholderKey
6744
+ | translate
6745
+ : null
6746
+ : field.placeholder ??
6747
+ ('shared.select' | translate)
6748
+ }}
6682
6749
  </option>
6683
6750
  @for (opt of field.options; track opt.value) {
6684
6751
  <option [value]="opt.value">
6685
- {{ opt.labelKey | translate : null : opt.label }}
6752
+ {{
6753
+ opt.labelKey | translate: null : opt.label
6754
+ }}
6686
6755
  </option>
6687
6756
  }
6688
6757
  </select>
@@ -6704,7 +6773,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
6704
6773
  )
6705
6774
  "
6706
6775
  />
6707
- <span>{{ field.placeholderKey | translate : null : (field.placeholder ?? (field.labelKey | translate : null : field.label)) }}</span>
6776
+ <span>{{
6777
+ field.placeholderKey
6778
+ | translate
6779
+ : null
6780
+ : field.placeholder ??
6781
+ (field.labelKey
6782
+ | translate: null : field.label)
6783
+ }}</span>
6708
6784
  </label>
6709
6785
  }
6710
6786
  @case ('date') {
@@ -6927,7 +7003,7 @@ class ResetPasswordPageComponent {
6927
7003
  route = inject(ActivatedRoute);
6928
7004
  messageService = inject(MessageService);
6929
7005
  authApi = inject(AuthApiService);
6930
- translateAdapter = inject(TRANSLATE_ADAPTER, {
7006
+ translateAdapter = inject(TranslateService, {
6931
7007
  optional: true,
6932
7008
  });
6933
7009
  translate(key, vars) {
@@ -7333,7 +7409,7 @@ class UserFormComponent {
7333
7409
  userService = inject(UserApiService);
7334
7410
  permissionService = inject(UserPermissionApiService);
7335
7411
  authState = inject(AuthStateService);
7336
- translateAdapter = inject(TRANSLATE_ADAPTER, {
7412
+ translateAdapter = inject(TranslateService, {
7337
7413
  optional: true,
7338
7414
  });
7339
7415
  userFormExtension = inject(AUTH_USER_FORM_EXTENSION, {
@@ -7692,7 +7768,7 @@ class UserFormComponent {
7692
7768
  @for (field of extraFields(); track field.key) {
7693
7769
  <div class="flex flex-col gap-2">
7694
7770
  <label [for]="field.key" class="font-medium text-color">
7695
- {{ field.labelKey | translate : null : field.label
7771
+ {{ field.labelKey | translate: null : field.label
7696
7772
  }}{{ field.required ? ' *' : '' }}
7697
7773
  </label>
7698
7774
  @if (field.component) {
@@ -7716,7 +7792,8 @@ class UserFormComponent {
7716
7792
  pInputText
7717
7793
  [id]="field.key"
7718
7794
  [placeholder]="
7719
- field.placeholderKey | translate : null : (field.placeholder ?? '')
7795
+ field.placeholderKey
7796
+ | translate: null : field.placeholder ?? ''
7720
7797
  "
7721
7798
  [value]="getExtraFieldValue(field.key) ?? ''"
7722
7799
  (input)="
@@ -7734,7 +7811,8 @@ class UserFormComponent {
7734
7811
  type="number"
7735
7812
  [id]="field.key"
7736
7813
  [placeholder]="
7737
- field.placeholderKey | translate : null : (field.placeholder ?? '')
7814
+ field.placeholderKey
7815
+ | translate: null : field.placeholder ?? ''
7738
7816
  "
7739
7817
  [value]="getExtraFieldValue(field.key) ?? ''"
7740
7818
  (input)="
@@ -7751,7 +7829,8 @@ class UserFormComponent {
7751
7829
  pInputTextarea
7752
7830
  [id]="field.key"
7753
7831
  [placeholder]="
7754
- field.placeholderKey | translate : null : (field.placeholder ?? '')
7832
+ field.placeholderKey
7833
+ | translate: null : field.placeholder ?? ''
7755
7834
  "
7756
7835
  [value]="getExtraFieldValue(field.key) ?? ''"
7757
7836
  (input)="
@@ -7775,11 +7854,17 @@ class UserFormComponent {
7775
7854
  "
7776
7855
  >
7777
7856
  <option value="">
7778
- {{ field.placeholderKey | translate : null : (field.placeholder ?? ('shared.select' | translate)) }}
7857
+ {{
7858
+ field.placeholderKey
7859
+ | translate
7860
+ : null
7861
+ : field.placeholder ??
7862
+ ('shared.select' | translate)
7863
+ }}
7779
7864
  </option>
7780
7865
  @for (opt of field.options; track opt.value) {
7781
7866
  <option [value]="opt.value">
7782
- {{ opt.labelKey | translate : null : opt.label }}
7867
+ {{ opt.labelKey | translate: null : opt.label }}
7783
7868
  </option>
7784
7869
  }
7785
7870
  </select>
@@ -7797,7 +7882,14 @@ class UserFormComponent {
7797
7882
  )
7798
7883
  "
7799
7884
  />
7800
- <span>{{ field.placeholderKey | translate : null : (field.placeholder ?? (field.labelKey | translate : null : field.label)) }}</span>
7885
+ <span>{{
7886
+ field.placeholderKey
7887
+ | translate
7888
+ : null
7889
+ : field.placeholder ??
7890
+ (field.labelKey
7891
+ | translate: null : field.label)
7892
+ }}</span>
7801
7893
  </label>
7802
7894
  }
7803
7895
  @case ('date') {
@@ -7975,7 +8067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7975
8067
  @for (field of extraFields(); track field.key) {
7976
8068
  <div class="flex flex-col gap-2">
7977
8069
  <label [for]="field.key" class="font-medium text-color">
7978
- {{ field.labelKey | translate : null : field.label
8070
+ {{ field.labelKey | translate: null : field.label
7979
8071
  }}{{ field.required ? ' *' : '' }}
7980
8072
  </label>
7981
8073
  @if (field.component) {
@@ -7999,7 +8091,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
7999
8091
  pInputText
8000
8092
  [id]="field.key"
8001
8093
  [placeholder]="
8002
- field.placeholderKey | translate : null : (field.placeholder ?? '')
8094
+ field.placeholderKey
8095
+ | translate: null : field.placeholder ?? ''
8003
8096
  "
8004
8097
  [value]="getExtraFieldValue(field.key) ?? ''"
8005
8098
  (input)="
@@ -8017,7 +8110,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
8017
8110
  type="number"
8018
8111
  [id]="field.key"
8019
8112
  [placeholder]="
8020
- field.placeholderKey | translate : null : (field.placeholder ?? '')
8113
+ field.placeholderKey
8114
+ | translate: null : field.placeholder ?? ''
8021
8115
  "
8022
8116
  [value]="getExtraFieldValue(field.key) ?? ''"
8023
8117
  (input)="
@@ -8034,7 +8128,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
8034
8128
  pInputTextarea
8035
8129
  [id]="field.key"
8036
8130
  [placeholder]="
8037
- field.placeholderKey | translate : null : (field.placeholder ?? '')
8131
+ field.placeholderKey
8132
+ | translate: null : field.placeholder ?? ''
8038
8133
  "
8039
8134
  [value]="getExtraFieldValue(field.key) ?? ''"
8040
8135
  (input)="
@@ -8058,11 +8153,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
8058
8153
  "
8059
8154
  >
8060
8155
  <option value="">
8061
- {{ field.placeholderKey | translate : null : (field.placeholder ?? ('shared.select' | translate)) }}
8156
+ {{
8157
+ field.placeholderKey
8158
+ | translate
8159
+ : null
8160
+ : field.placeholder ??
8161
+ ('shared.select' | translate)
8162
+ }}
8062
8163
  </option>
8063
8164
  @for (opt of field.options; track opt.value) {
8064
8165
  <option [value]="opt.value">
8065
- {{ opt.labelKey | translate : null : opt.label }}
8166
+ {{ opt.labelKey | translate: null : opt.label }}
8066
8167
  </option>
8067
8168
  }
8068
8169
  </select>
@@ -8080,7 +8181,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
8080
8181
  )
8081
8182
  "
8082
8183
  />
8083
- <span>{{ field.placeholderKey | translate : null : (field.placeholder ?? (field.labelKey | translate : null : field.label)) }}</span>
8184
+ <span>{{
8185
+ field.placeholderKey
8186
+ | translate
8187
+ : null
8188
+ : field.placeholder ??
8189
+ (field.labelKey
8190
+ | translate: null : field.label)
8191
+ }}</span>
8084
8192
  </label>
8085
8193
  }
8086
8194
  @case ('date') {
@@ -8173,7 +8281,7 @@ class UserBranchPermissionDialogComponent {
8173
8281
  branchApi = inject(BranchApiService);
8174
8282
  permissionApi = inject(UserPermissionApiService);
8175
8283
  messageService = inject(MessageService);
8176
- translateAdapter = inject(TRANSLATE_ADAPTER, {
8284
+ translateAdapter = inject(TranslateService, {
8177
8285
  optional: true,
8178
8286
  });
8179
8287
  t(key, params) {
@@ -8463,7 +8571,7 @@ class UserCompanyPermissionDialogComponent {
8463
8571
  companyApi = inject(CompanyApiService);
8464
8572
  permissionApi = inject(UserPermissionApiService);
8465
8573
  messageService = inject(MessageService);
8466
- translateAdapter = inject(TRANSLATE_ADAPTER, {
8574
+ translateAdapter = inject(TranslateService, {
8467
8575
  optional: true,
8468
8576
  });
8469
8577
  t(key, params) {
@@ -8707,7 +8815,7 @@ class UserListComponent {
8707
8815
  userDetailConfig = inject(AUTH_USER_DETAIL_CONFIG, {
8708
8816
  optional: true,
8709
8817
  });
8710
- translateAdapter = inject(TRANSLATE_ADAPTER, {
8818
+ translateAdapter = inject(TranslateService, {
8711
8819
  optional: true,
8712
8820
  });
8713
8821
  translate(key, vars) {
@@ -8821,8 +8929,7 @@ class UserListComponent {
8821
8929
  });
8822
8930
  this.userService.reload();
8823
8931
  }
8824
- catch {
8825
- }
8932
+ catch { }
8826
8933
  },
8827
8934
  });
8828
8935
  }
@@ -8870,7 +8977,7 @@ class UserListComponent {
8870
8977
  [class]="col.styleClass ?? ''"
8871
8978
  [style.width]="col.width ?? 'auto'"
8872
8979
  >
8873
- {{ col.headerKey | translate : null : col.header }}
8980
+ {{ col.headerKey | translate: null : col.header }}
8874
8981
  </th>
8875
8982
  }
8876
8983
  <th class="w-[180px]">{{ 'shared.actions' | translate }}</th>
@@ -8967,7 +9074,9 @@ class UserListComponent {
8967
9074
  [rounded]="true"
8968
9075
  [text]="true"
8969
9076
  [severity]="action.severity ?? 'secondary'"
8970
- [pTooltip]="action.labelKey | translate : null : action.label"
9077
+ [pTooltip]="
9078
+ action.labelKey | translate: null : action.label
9079
+ "
8971
9080
  [disabled]="isActionDisabled(action, user)"
8972
9081
  (onClick)="onExtraAction(action, user)"
8973
9082
  />
@@ -9071,7 +9180,9 @@ class UserListComponent {
9071
9180
  </div>
9072
9181
  @for (col of extraColumns(); track col.key) {
9073
9182
  <div class="flex flex-col gap-2">
9074
- <label class="font-medium text-muted-color">{{ col.headerKey | translate : null : col.header }}</label>
9183
+ <label class="font-medium text-muted-color">{{
9184
+ col.headerKey | translate: null : col.header
9185
+ }}</label>
9075
9186
  <span class="text-color">{{
9076
9187
  getFieldValue(user, col.field ?? col.key) ?? '-'
9077
9188
  }}</span>
@@ -9153,7 +9264,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
9153
9264
  [class]="col.styleClass ?? ''"
9154
9265
  [style.width]="col.width ?? 'auto'"
9155
9266
  >
9156
- {{ col.headerKey | translate : null : col.header }}
9267
+ {{ col.headerKey | translate: null : col.header }}
9157
9268
  </th>
9158
9269
  }
9159
9270
  <th class="w-[180px]">{{ 'shared.actions' | translate }}</th>
@@ -9250,7 +9361,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
9250
9361
  [rounded]="true"
9251
9362
  [text]="true"
9252
9363
  [severity]="action.severity ?? 'secondary'"
9253
- [pTooltip]="action.labelKey | translate : null : action.label"
9364
+ [pTooltip]="
9365
+ action.labelKey | translate: null : action.label
9366
+ "
9254
9367
  [disabled]="isActionDisabled(action, user)"
9255
9368
  (onClick)="onExtraAction(action, user)"
9256
9369
  />
@@ -9354,7 +9467,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
9354
9467
  </div>
9355
9468
  @for (col of extraColumns(); track col.key) {
9356
9469
  <div class="flex flex-col gap-2">
9357
- <label class="font-medium text-muted-color">{{ col.headerKey | translate : null : col.header }}</label>
9470
+ <label class="font-medium text-muted-color">{{
9471
+ col.headerKey | translate: null : col.header
9472
+ }}</label>
9358
9473
  <span class="text-color">{{
9359
9474
  getFieldValue(user, col.field ?? col.key) ?? '-'
9360
9475
  }}</span>
@@ -9396,7 +9511,7 @@ class VerifyEmailPageComponent {
9396
9511
  route = inject(ActivatedRoute);
9397
9512
  messageService = inject(MessageService);
9398
9513
  authApi = inject(AuthApiService);
9399
- translateAdapter = inject(TRANSLATE_ADAPTER, {
9514
+ translateAdapter = inject(TranslateService, {
9400
9515
  optional: true,
9401
9516
  });
9402
9517
  translate(key, vars) {