@cauca-911/management 22.0.3 → 22.0.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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injector, inject, Injectable, computed, ChangeDetectionStrategy, Component, ViewChild, signal, viewChild, resource, effect, untracked, model, input, HostListener, forwardRef, ViewEncapsulation, output, NgModule } from '@angular/core';
3
- import { pendingChangesGuard, DialogService, PageTitleComponent, LoadingSpinnerIndicatorComponent, LoadingErrorComponent, StrokedButtonComponent, RaisedButtonComponent, ListPaginatorComponent, IconButtonComponent, LoadingStateService, GroupContainerComponent, ConfirmationResult, SavingErrorBoxComponent, MenuItemComponent } from '@cauca-911/material';
2
+ import { InjectionToken, Injector, inject, Injectable, computed, ChangeDetectionStrategy, Component, ViewChild, signal, viewChild, resource, effect, untracked, model, input, HostListener, forwardRef, ViewEncapsulation, output } from '@angular/core';
3
+ import { pendingChangesGuard, DialogService, PageTitleComponent, LoadingSpinnerIndicatorComponent, LoadingErrorComponent, StrokedButtonComponent, RaisedButtonComponent, ListPaginatorComponent, IconButtonComponent, LoadingStateService, GroupContainerComponent, ConfirmationResult, SavingErrorBoxComponent, MenuItemComponent, ExpandablePanelComponent, FieldErrorsComponent, PasswordSelectionComponent, PhoneNumberInputComponent, ControlFieldErrorsComponent } from '@cauca-911/material';
4
4
  import * as i1 from '@angular/material/card';
5
5
  import { MatCardModule } from '@angular/material/card';
6
6
  import { TranslatePipe } from '@ngx-translate/core';
@@ -8,7 +8,7 @@ import { MatSort } from '@angular/material/sort';
8
8
  import { Router } from '@angular/router';
9
9
  import ODataFilterBuilder from 'odata-filter-builder';
10
10
  import { OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent, DataGridCommandsColumnComponent, DataGridComponent, BaseGridColumnComponent, DataGridMenuColumnComponent } from '@cauca-911/datagrid';
11
- import { HttpClient } from '@angular/common/http';
11
+ import { HttpClient, HttpParams } from '@angular/common/http';
12
12
  import { CaucaCoreService, toLowerCaseAndWithoutDiacritics } from '@cauca-911/core';
13
13
  import { firstValueFrom, startWith, debounceTime } from 'rxjs';
14
14
  import * as i1$2 from '@angular/material/form-field';
@@ -36,18 +36,13 @@ import * as i2$1 from '@angular/material/menu';
36
36
  import { MatMenuModule } from '@angular/material/menu';
37
37
  import { NgStyle } from '@angular/common';
38
38
  import { MatColumnDef, MatHeaderCell, MatHeaderCellDef, MatCell, MatCellDef, MatFooterCell, MatFooterCellDef } from '@angular/material/table';
39
- import * as i1$3 from '@cauca-911/devextreme';
40
- import { CaucaDevextremeModule } from '@cauca-911/devextreme';
41
- import * as i4$2 from 'devextreme-angular/ui/check-box';
42
- import { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';
43
- import * as i5$1 from 'devextreme-angular/ui/list';
44
- import { DxListModule } from 'devextreme-angular/ui/list';
45
- import * as i6$1 from 'devextreme-angular/ui/tag-box';
46
- import { DxTagBoxModule } from 'devextreme-angular/ui/tag-box';
47
- import { BreakpointObserver } from '@angular/cdk/layout';
48
- import { map } from 'rxjs/operators';
49
- import * as i2$2 from 'devextreme-angular/ui/nested';
50
- import * as i3$2 from 'devextreme-angular/core';
39
+ import { schema, required, maxLength, validateHttp, email, readonly, pattern, FormField } from '@angular/forms/signals';
40
+ import * as i3$2 from '@angular/material/progress-spinner';
41
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
42
+ import * as i2$2 from '@angular/material/select';
43
+ import { MatSelectModule } from '@angular/material/select';
44
+ import * as i3$3 from 'ngx-mat-select-search';
45
+ import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
51
46
 
52
47
  const MANAGEMENT_URL_PREFIX = new InjectionToken('MANAGEMENT_URL_PREFIX');
53
48
  const MANAGEMENT_ROUTE_SEGMENT = new InjectionToken('MANAGEMENT_ROUTE_SEGMENT');
@@ -105,7 +100,7 @@ class GroupManagementService {
105
100
  }]
106
101
  }], null, null); })();
107
102
 
108
- const _c0$5 = () => ["name"];
103
+ const _c0$6 = () => ["name"];
109
104
  class GroupListGridComponent {
110
105
  constructor() {
111
106
  this.columns = computed(() => this.getColumns(), /* @ts-ignore */
@@ -163,7 +158,7 @@ class GroupListGridComponent {
163
158
  i0.ɵɵlistener("deleteClick", function GroupListGridComponent_Template_cauca_data_grid_commands_column_deleteClick_6_listener($event) { return ctx.deleteGroup($event); });
164
159
  i0.ɵɵelementEnd()();
165
160
  } if (rf & 2) {
166
- i0.ɵɵproperty("showTableOptions", true)("showAddButton", true)("addButtonLabel", i0.ɵɵpipeBind1(1, 10, "groups.addButtonLabel"))("baseSort", i0.ɵɵpureFunction0(16, _c0$5))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
161
+ i0.ɵɵproperty("showTableOptions", true)("showAddButton", true)("addButtonLabel", i0.ɵɵpipeBind1(1, 10, "groups.addButtonLabel"))("baseSort", i0.ɵɵpureFunction0(16, _c0$6))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
167
162
  i0.ɵɵadvance(2);
168
163
  i0.ɵɵproperty("label", i0.ɵɵpipeBind1(3, 12, "groups.groupNameColumnLabel"));
169
164
  i0.ɵɵadvance(2);
@@ -367,8 +362,8 @@ class UserSearchService {
367
362
  }]
368
363
  }], null, null); })();
369
364
 
370
- const _c0$4 = ["resultPaginator"];
371
- const _forTrack0$4 = ($index, $item) => $item.id;
365
+ const _c0$5 = ["resultPaginator"];
366
+ const _forTrack0$5 = ($index, $item) => $item.id;
372
367
  function GroupUserSelectionDialogComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
373
368
  i0.ɵɵelementStart(0, "div", 8);
374
369
  i0.ɵɵtext(1);
@@ -420,7 +415,7 @@ function GroupUserSelectionDialogComponent_Conditional_17_Template(rf, ctx) { if
420
415
  const _r1 = i0.ɵɵgetCurrentView();
421
416
  i0.ɵɵelementStart(0, "mat-selection-list", 18);
422
417
  i0.ɵɵlistener("selectionChange", function GroupUserSelectionDialogComponent_Conditional_17_Template_mat_selection_list_selectionChange_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSelectionChange($event)); });
423
- i0.ɵɵrepeaterCreate(1, GroupUserSelectionDialogComponent_Conditional_17_For_2_Template, 4, 6, "mat-list-option", 19, _forTrack0$4);
418
+ i0.ɵɵrepeaterCreate(1, GroupUserSelectionDialogComponent_Conditional_17_For_2_Template, 4, 6, "mat-list-option", 19, _forTrack0$5);
424
419
  i0.ɵɵelementEnd();
425
420
  i0.ɵɵconditionalCreate(3, GroupUserSelectionDialogComponent_Conditional_17_Conditional_3_Template, 2, 2, "cauca-list-paginator", 20);
426
421
  } if (rf & 2) {
@@ -521,7 +516,7 @@ class GroupUserSelectionDialogComponent {
521
516
  }
522
517
  static { this.ɵfac = function GroupUserSelectionDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupUserSelectionDialogComponent)(); }; }
523
518
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupUserSelectionDialogComponent, selectors: [["cauca-group-user-selection-dialog"]], viewQuery: function GroupUserSelectionDialogComponent_Query(rf, ctx) { if (rf & 1) {
524
- i0.ɵɵviewQuerySignal(ctx.paginator, _c0$4, 5);
519
+ i0.ɵɵviewQuerySignal(ctx.paginator, _c0$5, 5);
525
520
  } if (rf & 2) {
526
521
  i0.ɵɵqueryAdvance();
527
522
  } }, features: [i0.ɵɵProvidersFeature([UserSearchService, LoadingStateService])], decls: 28, vars: 15, consts: [["resultPaginator", ""], ["mat-dialog-title", ""], [1, "h6"], ["id", "closeButton", "icon", "close", 3, "buttonClick"], [1, "dialog-content"], ["subscriptSizing", "dynamic", 1, "search-field"], ["matInput", "", "type", "text", 3, "input", "value"], ["matSuffix", ""], [1, "search-hint", "body2"], [1, "results-region"], [3, "retryRequest"], [1, "no-results", "body2"], [1, "dialog-actions"], [1, "selected-users-panel"], [1, "selected-users-label", "caption"], [1, "selected-users-names", "body2", 3, "matTooltip"], ["color", "primary", "label", "cancel", 3, "buttonClick"], ["color", "primary", "label", "ok", 3, "buttonClick", "isDisabled"], [1, "results-list", 3, "selectionChange", "compareWith"], ["color", "primary", 1, "result-item", 3, "value", "selected", "result-item--even"], [3, "itemsCount", "pageSize"], ["color", "primary", 1, "result-item", 3, "value", "selected"], ["matListItemTitle", ""], ["matListItemSubtitle", ""], [3, "pageChange", "itemsCount", "pageSize"]], template: function GroupUserSelectionDialogComponent_Template(rf, ctx) { if (rf & 1) {
@@ -610,8 +605,8 @@ class GroupUserSelectionDialogComponent {
610
605
  }], () => [], { paginator: [{ type: i0.ViewChild, args: ['resultPaginator', { isSignal: true }] }] }); })();
611
606
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupUserSelectionDialogComponent, { className: "GroupUserSelectionDialogComponent", filePath: "lib/components/group-user-selection-dialog/group-user-selection-dialog.component.ts", lineNumber: 46 }); })();
612
607
 
613
- const _c0$3 = ["paginator"];
614
- const _forTrack0$3 = ($index, $item) => $item.id;
608
+ const _c0$4 = ["paginator"];
609
+ const _forTrack0$4 = ($index, $item) => $item.id;
615
610
  function GroupUserEditionListComponent_For_10_Conditional_5_Template(rf, ctx) { if (rf & 1) {
616
611
  i0.ɵɵelementStart(0, "div", 11);
617
612
  i0.ɵɵtext(1);
@@ -746,7 +741,7 @@ class GroupUserEditionListComponent {
746
741
  }
747
742
  static { this.ɵfac = function GroupUserEditionListComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupUserEditionListComponent)(); }; }
748
743
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupUserEditionListComponent, selectors: [["cauca-group-user-edition-list"]], viewQuery: function GroupUserEditionListComponent_Query(rf, ctx) { if (rf & 1) {
749
- i0.ɵɵviewQuerySignal(ctx.paginator, _c0$3, 5);
744
+ i0.ɵɵviewQuerySignal(ctx.paginator, _c0$4, 5);
750
745
  } if (rf & 2) {
751
746
  i0.ɵɵqueryAdvance();
752
747
  } }, features: [i0.ɵɵProvidersFeature([DialogService])], decls: 14, vars: 6, consts: [["paginator", ""], [1, "user-edition-list"], ["subscriptSizing", "dynamic", 1, "filter-field"], ["matInput", "", "type", "text", 3, "input", "value"], ["matSuffix", ""], [1, "users-list"], [1, "user-item"], [3, "itemsCount", "pageSize"], ["color", "primary", "label", "groupEdition.addUsersButton", 1, "add-users-button", 3, "buttonClick"], ["matListItemIcon", ""], ["matListItemTitle", "", 1, "user-name"], ["matListItemLine", "", 1, "user-additional-information"], ["matListItemMeta", "", "icon", "delete", "color", "error", 1, "delete-button", 3, "buttonClick"], [1, "no-users", "body2"], [3, "pageChange", "itemsCount", "pageSize"]], template: function GroupUserEditionListComponent_Template(rf, ctx) { if (rf & 1) {
@@ -761,7 +756,7 @@ class GroupUserEditionListComponent {
761
756
  i0.ɵɵtext(7, "search");
762
757
  i0.ɵɵelementEnd()();
763
758
  i0.ɵɵelementStart(8, "mat-list", 5);
764
- i0.ɵɵrepeaterCreate(9, GroupUserEditionListComponent_For_10_Template, 8, 5, "mat-list-item", 6, _forTrack0$3, false, GroupUserEditionListComponent_ForEmpty_11_Template, 2, 1);
759
+ i0.ɵɵrepeaterCreate(9, GroupUserEditionListComponent_For_10_Template, 8, 5, "mat-list-item", 6, _forTrack0$4, false, GroupUserEditionListComponent_ForEmpty_11_Template, 2, 1);
765
760
  i0.ɵɵelementEnd();
766
761
  i0.ɵɵconditionalCreate(12, GroupUserEditionListComponent_Conditional_12_Template, 2, 2, "cauca-list-paginator", 7);
767
762
  i0.ɵɵelementStart(13, "cauca-raised-button", 8);
@@ -834,7 +829,7 @@ class PermissionManagementService {
834
829
  }]
835
830
  }], null, null); })();
836
831
 
837
- const _forTrack0$2 = ($index, $item) => $item.id;
832
+ const _forTrack0$3 = ($index, $item) => $item.id;
838
833
  function GroupPermissionListComponent_For_9_Template(rf, ctx) { if (rf & 1) {
839
834
  const _r1 = i0.ɵɵgetCurrentView();
840
835
  i0.ɵɵelementStart(0, "mat-list-item", 4)(1, "mat-checkbox", 6);
@@ -919,7 +914,7 @@ class GroupPermissionListComponent {
919
914
  i0.ɵɵtext(6, "search");
920
915
  i0.ɵɵelementEnd()();
921
916
  i0.ɵɵelementStart(7, "mat-selection-list", 3);
922
- i0.ɵɵrepeaterCreate(8, GroupPermissionListComponent_For_9_Template, 3, 4, "mat-list-item", 4, _forTrack0$2, false, GroupPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 5);
917
+ i0.ɵɵrepeaterCreate(8, GroupPermissionListComponent_For_9_Template, 3, 4, "mat-list-item", 4, _forTrack0$3, false, GroupPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 5);
923
918
  i0.ɵɵelementEnd();
924
919
  } if (rf & 2) {
925
920
  i0.ɵɵadvance(2);
@@ -1201,7 +1196,7 @@ var UserPermissionOriginKind;
1201
1196
  UserPermissionOriginKind[UserPermissionOriginKind["UserOverride"] = 1] = "UserOverride";
1202
1197
  })(UserPermissionOriginKind || (UserPermissionOriginKind = {}));
1203
1198
 
1204
- const _forTrack0$1 = ($index, $item) => $item.idModulePermission;
1199
+ const _forTrack0$2 = ($index, $item) => $item.idModulePermission;
1205
1200
  function UserPermissionListComponent_For_9_Conditional_2_Template(rf, ctx) { if (rf & 1) {
1206
1201
  i0.ɵɵtext(0, " check ");
1207
1202
  } }
@@ -1311,7 +1306,7 @@ class UserPermissionListComponent {
1311
1306
  i0.ɵɵtext(6, "search");
1312
1307
  i0.ɵɵelementEnd()();
1313
1308
  i0.ɵɵelementStart(7, "mat-list", 4);
1314
- i0.ɵɵrepeaterCreate(8, UserPermissionListComponent_For_9_Template, 16, 11, "mat-list-item", 5, _forTrack0$1, false, UserPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 6);
1309
+ i0.ɵɵrepeaterCreate(8, UserPermissionListComponent_For_9_Template, 16, 11, "mat-list-item", 5, _forTrack0$2, false, UserPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 6);
1315
1310
  i0.ɵɵelementEnd();
1316
1311
  } if (rf & 2) {
1317
1312
  i0.ɵɵadvance(2);
@@ -1396,14 +1391,14 @@ class UserPermissionsDialogComponent {
1396
1391
  }], null, null); })();
1397
1392
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserPermissionsDialogComponent, { className: "UserPermissionsDialogComponent", filePath: "lib/components/user-permissions-dialog/user-permissions-dialog.component.ts", lineNumber: 31 }); })();
1398
1393
 
1399
- const _c0$2 = a0 => ({ "width": a0 });
1394
+ const _c0$3 = a0 => ({ "width": a0 });
1400
1395
  function ScopeListGridColumnComponent_th_1_Template(rf, ctx) { if (rf & 1) {
1401
1396
  i0.ɵɵelementStart(0, "th", 4);
1402
1397
  i0.ɵɵtext(1);
1403
1398
  i0.ɵɵelementEnd();
1404
1399
  } if (rf & 2) {
1405
1400
  const ctx_r0 = i0.ɵɵnextContext();
1406
- i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c0$2, ctx_r0.width()));
1401
+ i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c0$3, ctx_r0.width()));
1407
1402
  i0.ɵɵadvance();
1408
1403
  i0.ɵɵtextInterpolate1(" ", ctx_r0.label() ?? ctx_r0.capitalize(ctx_r0.prop()), " ");
1409
1404
  } }
@@ -1489,31 +1484,31 @@ class ScopeListGridColumnComponent extends BaseGridColumnComponent {
1489
1484
  }], () => [], { allLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "allLabel", required: true }] }] }); })();
1490
1485
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ScopeListGridColumnComponent, { className: "ScopeListGridColumnComponent", filePath: "lib/components/scope-list-grid-column/scope-list-grid-column.component.ts", lineNumber: 28 }); })();
1491
1486
 
1492
- const _c0$1 = () => ["userName"];
1493
- const _forTrack0 = ($index, $item) => $item.prop;
1487
+ const _c0$2 = () => ["userName"];
1488
+ const _forTrack0$1 = ($index, $item) => $item.prop;
1494
1489
  function UserListGridComponent_For_9_Case_0_Template(rf, ctx) { if (rf & 1) {
1495
1490
  i0.ɵɵelement(0, "cauca-scope-list-grid-column", 6);
1496
1491
  i0.ɵɵpipe(1, "translate");
1497
1492
  } if (rf & 2) {
1498
1493
  const column_r1 = i0.ɵɵnextContext().$implicit;
1499
- i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("showToolTip", column_r1.showToolTip ?? true)("allLabel", column_r1.allLabel ?? "")("label", i0.ɵɵpipeBind1(1, 6, column_r1.label));
1494
+ i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("showToolTip", column_r1.showToolTip ?? true)("allLabel", column_r1.allLabel ?? "")("visibleByDefault", column_r1.visibleByDefault ?? true)("label", i0.ɵɵpipeBind1(1, 7, column_r1.label));
1500
1495
  } }
1501
1496
  function UserListGridComponent_For_9_Case_1_Template(rf, ctx) { if (rf & 1) {
1502
1497
  i0.ɵɵelement(0, "cauca-sortable-data-grid-check-column", 7);
1503
1498
  i0.ɵɵpipe(1, "translate");
1504
1499
  } if (rf & 2) {
1505
1500
  const column_r1 = i0.ɵɵnextContext().$implicit;
1506
- i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("label", i0.ɵɵpipeBind1(1, 4, column_r1.label));
1501
+ i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("visibleByDefault", column_r1.visibleByDefault ?? true)("label", i0.ɵɵpipeBind1(1, 5, column_r1.label));
1507
1502
  } }
1508
1503
  function UserListGridComponent_For_9_Case_2_Template(rf, ctx) { if (rf & 1) {
1509
1504
  i0.ɵɵelement(0, "cauca-sortable-data-grid-column", 8);
1510
1505
  i0.ɵɵpipe(1, "translate");
1511
1506
  } if (rf & 2) {
1512
1507
  const column_r1 = i0.ɵɵnextContext().$implicit;
1513
- i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("showToolTip", column_r1.showToolTip ?? true)("label", i0.ɵɵpipeBind1(1, 5, column_r1.label));
1508
+ i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("showToolTip", column_r1.showToolTip ?? true)("visibleByDefault", column_r1.visibleByDefault ?? true)("label", i0.ɵɵpipeBind1(1, 6, column_r1.label));
1514
1509
  } }
1515
1510
  function UserListGridComponent_For_9_Template(rf, ctx) { if (rf & 1) {
1516
- i0.ɵɵconditionalCreate(0, UserListGridComponent_For_9_Case_0_Template, 2, 8, "cauca-scope-list-grid-column", 6)(1, UserListGridComponent_For_9_Case_1_Template, 2, 6, "cauca-sortable-data-grid-check-column", 7)(2, UserListGridComponent_For_9_Case_2_Template, 2, 7, "cauca-sortable-data-grid-column", 8);
1511
+ i0.ɵɵconditionalCreate(0, UserListGridComponent_For_9_Case_0_Template, 2, 9, "cauca-scope-list-grid-column", 6)(1, UserListGridComponent_For_9_Case_1_Template, 2, 7, "cauca-sortable-data-grid-check-column", 7)(2, UserListGridComponent_For_9_Case_2_Template, 2, 8, "cauca-sortable-data-grid-column", 8);
1517
1512
  } if (rf & 2) {
1518
1513
  let tmp_10_0;
1519
1514
  const column_r1 = ctx.$implicit;
@@ -1549,8 +1544,12 @@ const SharedSearchedColumns = ['searchableUserName', 'searchableFirstName', 'sea
1549
1544
  class UserListGridComponent {
1550
1545
  constructor() {
1551
1546
  /**
1552
- * Read when the grid registers its columns, in `ngAfterContentInit`. Replacing the list
1553
- * afterwards renders nothing: the new columns are never registered with the MatTable.
1547
+ * Read when the grid registers its columns, in `ngAfterContentInit`. Changing it afterwards
1548
+ * recomputes `columns()` but does not re-run `applyColumns()`, so the MatTable is asked to
1549
+ * render a column id it never registered and throws `Could not find column with id "X"`.
1550
+ * `showPermissions`, `canEdit` and `canDelete` gate the row-action column the same way and
1551
+ * carry the same constraint — and are the more likely one to hit, since a consumer binds them
1552
+ * to an async permission signal more readily than it replaces the column list.
1554
1553
  */
1555
1554
  this.extraColumns = input([], /* @ts-ignore */
1556
1555
  ...(ngDevMode ? [{ debugName: "extraColumns" }] : /* istanbul ignore next */ []));
@@ -1614,7 +1613,7 @@ class UserListGridComponent {
1614
1613
  i0.ɵɵviewQuerySignal(ctx.grid, OdataGridComponent, 5)(ctx.sort, MatSort, 5);
1615
1614
  } if (rf & 2) {
1616
1615
  i0.ɵɵqueryAdvance(2);
1617
- } }, inputs: { extraColumns: [1, "extraColumns"], showAddButton: [1, "showAddButton"], addButtonLabel: [1, "addButtonLabel"], canEdit: [1, "canEdit"], canDelete: [1, "canDelete"], editLinkField: [1, "editLinkField"], showPermissions: [1, "showPermissions"], persistState: [1, "persistState"] }, outputs: { addClick: "addClick", deleteClick: "deleteClick" }, decls: 11, vars: 24, consts: [["menuTemplate", ""], ["matSort", "", "matSortActive", "userName", "matSortDirection", "asc", "aria-describedby", "Users table", "resourceName", "UserList", 1, "users-datagrid", 3, "addButtonClick", "persistState", "showTableOptions", "showRefreshButton", "showAddButton", "addButtonLabel", "baseSort", "filterPredicate", "displayedColumns"], ["id", "userName", "prop", "userName", 3, "showToolTip", "label"], ["id", "firstName", "prop", "firstName", 3, "showToolTip", "label"], ["id", "lastName", "prop", "lastName", 3, "showToolTip", "label"], ["id", "buttons", "prop", "menu", 3, "canEdit", "canDelete", "editLinkField"], [3, "id", "prop", "width", "showToolTip", "allLabel", "label"], [3, "id", "prop", "width", "label"], [3, "id", "prop", "width", "showToolTip", "label"], ["id", "buttons", "prop", "menu", 3, "deleteClick", "canEdit", "canDelete", "editLinkField"], ["icon", "list", "label", "userList.viewPermissions", 3, "translateLabel"], ["icon", "list", "label", "userList.viewPermissions", 3, "buttonClick", "translateLabel"]], template: function UserListGridComponent_Template(rf, ctx) { if (rf & 1) {
1616
+ } }, inputs: { extraColumns: [1, "extraColumns"], showAddButton: [1, "showAddButton"], addButtonLabel: [1, "addButtonLabel"], canEdit: [1, "canEdit"], canDelete: [1, "canDelete"], editLinkField: [1, "editLinkField"], showPermissions: [1, "showPermissions"], persistState: [1, "persistState"] }, outputs: { addClick: "addClick", deleteClick: "deleteClick" }, decls: 11, vars: 24, consts: [["menuTemplate", ""], ["matSort", "", "matSortActive", "userName", "matSortDirection", "asc", "aria-label", "Users table", "resourceName", "UserList", 3, "addButtonClick", "persistState", "showTableOptions", "showRefreshButton", "showAddButton", "addButtonLabel", "baseSort", "filterPredicate", "displayedColumns"], ["id", "userName", "prop", "userName", 3, "showToolTip", "label"], ["id", "firstName", "prop", "firstName", 3, "showToolTip", "label"], ["id", "lastName", "prop", "lastName", 3, "showToolTip", "label"], ["id", "buttons", "prop", "menu", 3, "canEdit", "canDelete", "editLinkField"], [3, "id", "prop", "width", "showToolTip", "allLabel", "visibleByDefault", "label"], [3, "id", "prop", "width", "visibleByDefault", "label"], [3, "id", "prop", "width", "showToolTip", "visibleByDefault", "label"], ["id", "buttons", "prop", "menu", 3, "deleteClick", "canEdit", "canDelete", "editLinkField"], ["icon", "list", "label", "userList.viewPermissions", 3, "translateLabel"], ["icon", "list", "label", "userList.viewPermissions", 3, "buttonClick", "translateLabel"]], template: function UserListGridComponent_Template(rf, ctx) { if (rf & 1) {
1618
1617
  i0.ɵɵelementStart(0, "cauca-odata-grid", 1);
1619
1618
  i0.ɵɵpipe(1, "translate");
1620
1619
  i0.ɵɵlistener("addButtonClick", function UserListGridComponent_Template_cauca_odata_grid_addButtonClick_0_listener() { return ctx.addClick.emit(); });
@@ -1624,11 +1623,11 @@ class UserListGridComponent {
1624
1623
  i0.ɵɵpipe(5, "translate");
1625
1624
  i0.ɵɵelement(6, "cauca-sortable-data-grid-column", 4);
1626
1625
  i0.ɵɵpipe(7, "translate");
1627
- i0.ɵɵrepeaterCreate(8, UserListGridComponent_For_9_Template, 3, 1, null, null, _forTrack0);
1626
+ i0.ɵɵrepeaterCreate(8, UserListGridComponent_For_9_Template, 3, 1, null, null, _forTrack0$1);
1628
1627
  i0.ɵɵconditionalCreate(10, UserListGridComponent_Conditional_10_Template, 3, 3, "cauca-data-grid-menu-column", 5);
1629
1628
  i0.ɵɵelementEnd();
1630
1629
  } if (rf & 2) {
1631
- i0.ɵɵproperty("persistState", ctx.persistState())("showTableOptions", true)("showRefreshButton", true)("showAddButton", ctx.showAddButton())("addButtonLabel", i0.ɵɵpipeBind1(1, 15, ctx.addButtonLabel()))("baseSort", i0.ɵɵpureFunction0(23, _c0$1))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
1630
+ i0.ɵɵproperty("persistState", ctx.persistState())("showTableOptions", true)("showRefreshButton", true)("showAddButton", ctx.showAddButton())("addButtonLabel", i0.ɵɵpipeBind1(1, 15, ctx.addButtonLabel()))("baseSort", i0.ɵɵpureFunction0(23, _c0$2))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
1632
1631
  i0.ɵɵadvance(2);
1633
1632
  i0.ɵɵproperty("showToolTip", true)("label", i0.ɵɵpipeBind1(3, 17, "userList.column.userName"));
1634
1633
  i0.ɵɵadvance(2);
@@ -1647,7 +1646,7 @@ class UserListGridComponent {
1647
1646
  args: [{ selector: 'cauca-user-list-grid', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1648
1647
  MatSort, OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent,
1649
1648
  ScopeListGridColumnComponent, DataGridMenuColumnComponent, MenuItemComponent, TranslatePipe,
1650
- ], template: "<cauca-odata-grid\n matSort\n matSortActive=\"userName\"\n matSortDirection=\"asc\"\n class=\"users-datagrid\"\n aria-describedby=\"Users table\"\n resourceName=\"UserList\"\n [persistState]=\"persistState()\"\n [showTableOptions]=\"true\"\n [showRefreshButton]=\"true\"\n [showAddButton]=\"showAddButton()\"\n [addButtonLabel]=\"addButtonLabel() | translate\"\n (addButtonClick)=\"addClick.emit()\"\n [baseSort]=\"['userName']\"\n [filterPredicate]=\"filterPredicate\"\n [displayedColumns]=\"columns()\">\n\n <cauca-sortable-data-grid-column id=\"userName\" prop=\"userName\" [showToolTip]=\"true\"\n [label]=\"'userList.column.userName' | translate\"/>\n <cauca-sortable-data-grid-column id=\"firstName\" prop=\"firstName\" [showToolTip]=\"true\"\n [label]=\"'userList.column.firstName' | translate\"/>\n <cauca-sortable-data-grid-column id=\"lastName\" prop=\"lastName\" [showToolTip]=\"true\"\n [label]=\"'userList.column.lastName' | translate\"/>\n\n @for (column of extraColumns(); track column.prop) {\n @switch (column.kind) {\n @case ('scope') {\n <cauca-scope-list-grid-column [id]=\"column.prop\" [prop]=\"column.prop\"\n [width]=\"column.width ?? ''\"\n [showToolTip]=\"column.showToolTip ?? true\"\n [allLabel]=\"column.allLabel ?? ''\"\n [label]=\"column.label | translate\"/>\n }\n @case ('check') {\n <cauca-sortable-data-grid-check-column [id]=\"column.prop\" [prop]=\"column.prop\"\n [width]=\"column.width ?? ''\"\n [label]=\"column.label | translate\"/>\n }\n @default {\n <cauca-sortable-data-grid-column [id]=\"column.prop\" [prop]=\"column.prop\"\n [width]=\"column.width ?? ''\"\n [showToolTip]=\"column.showToolTip ?? true\"\n [label]=\"column.label | translate\"/>\n }\n }\n }\n\n @if (hasRowActions()) {\n <cauca-data-grid-menu-column id=\"buttons\" prop=\"menu\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n [editLinkField]=\"editLinkField()\"\n (deleteClick)=\"onDelete($event)\">\n <ng-template #menuTemplate let-row=\"row\">\n @if (showPermissions()) {\n <cauca-menu-item icon=\"list\" label=\"userList.viewPermissions\" [translateLabel]=\"true\"\n (buttonClick)=\"openPermissions(row)\"/>\n }\n </ng-template>\n </cauca-data-grid-menu-column>\n }\n\n</cauca-odata-grid>\n" }]
1649
+ ], template: "<cauca-odata-grid\n matSort\n matSortActive=\"userName\"\n matSortDirection=\"asc\"\n aria-label=\"Users table\"\n resourceName=\"UserList\"\n [persistState]=\"persistState()\"\n [showTableOptions]=\"true\"\n [showRefreshButton]=\"true\"\n [showAddButton]=\"showAddButton()\"\n [addButtonLabel]=\"addButtonLabel() | translate\"\n (addButtonClick)=\"addClick.emit()\"\n [baseSort]=\"['userName']\"\n [filterPredicate]=\"filterPredicate\"\n [displayedColumns]=\"columns()\">\n\n <cauca-sortable-data-grid-column id=\"userName\" prop=\"userName\" [showToolTip]=\"true\"\n [label]=\"'userList.column.userName' | translate\"/>\n <cauca-sortable-data-grid-column id=\"firstName\" prop=\"firstName\" [showToolTip]=\"true\"\n [label]=\"'userList.column.firstName' | translate\"/>\n <cauca-sortable-data-grid-column id=\"lastName\" prop=\"lastName\" [showToolTip]=\"true\"\n [label]=\"'userList.column.lastName' | translate\"/>\n\n @for (column of extraColumns(); track column.prop) {\n @switch (column.kind) {\n @case ('scope') {\n <cauca-scope-list-grid-column [id]=\"column.prop\" [prop]=\"column.prop\"\n [width]=\"column.width ?? ''\"\n [showToolTip]=\"column.showToolTip ?? true\"\n [allLabel]=\"column.allLabel ?? ''\"\n [visibleByDefault]=\"column.visibleByDefault ?? true\"\n [label]=\"column.label | translate\"/>\n }\n @case ('check') {\n <cauca-sortable-data-grid-check-column [id]=\"column.prop\" [prop]=\"column.prop\"\n [width]=\"column.width ?? ''\"\n [visibleByDefault]=\"column.visibleByDefault ?? true\"\n [label]=\"column.label | translate\"/>\n }\n @default {\n <cauca-sortable-data-grid-column [id]=\"column.prop\" [prop]=\"column.prop\"\n [width]=\"column.width ?? ''\"\n [showToolTip]=\"column.showToolTip ?? true\"\n [visibleByDefault]=\"column.visibleByDefault ?? true\"\n [label]=\"column.label | translate\"/>\n }\n }\n }\n\n @if (hasRowActions()) {\n <cauca-data-grid-menu-column id=\"buttons\" prop=\"menu\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n [editLinkField]=\"editLinkField()\"\n (deleteClick)=\"onDelete($event)\">\n <ng-template #menuTemplate let-row=\"row\">\n @if (showPermissions()) {\n <cauca-menu-item icon=\"list\" label=\"userList.viewPermissions\" [translateLabel]=\"true\"\n (buttonClick)=\"openPermissions(row)\"/>\n }\n </ng-template>\n </cauca-data-grid-menu-column>\n }\n\n</cauca-odata-grid>\n" }]
1651
1650
  }], null, { extraColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraColumns", required: false }] }], showAddButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAddButton", required: false }] }], addButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "addButtonLabel", required: false }] }], canEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEdit", required: false }] }], canDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDelete", required: false }] }], editLinkField: [{ type: i0.Input, args: [{ isSignal: true, alias: "editLinkField", required: false }] }], showPermissions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPermissions", required: false }] }], persistState: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistState", required: false }] }], addClick: [{ type: i0.Output, args: ["addClick"] }], deleteClick: [{ type: i0.Output, args: ["deleteClick"] }], grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => OdataGridComponent), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }] }); })();
1652
1651
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserListGridComponent, { className: "UserListGridComponent", filePath: "lib/components/user-list-grid/user-list-grid.component.ts", lineNumber: 27 }); })();
1653
1652
 
@@ -1706,614 +1705,403 @@ class UsersPageComponent {
1706
1705
  }], null, { caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], baseCrumb: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseCrumb", required: false }] }], breadcrumb: [{ type: i0.Input, args: [{ isSignal: true, alias: "breadcrumb", required: false }] }], extraColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraColumns", required: false }] }], showAddButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAddButton", required: false }] }], addButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "addButtonLabel", required: false }] }], canEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEdit", required: false }] }], canDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDelete", required: false }] }], editLinkField: [{ type: i0.Input, args: [{ isSignal: true, alias: "editLinkField", required: false }] }], showPermissions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPermissions", required: false }] }], persistState: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistState", required: false }] }], addClick: [{ type: i0.Output, args: ["addClick"] }], deleteClick: [{ type: i0.Output, args: ["deleteClick"] }], grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => UserListGridComponent), { isSignal: true }] }] }); })();
1707
1706
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UsersPageComponent, { className: "UsersPageComponent", filePath: "lib/pages/users-page/users-page.component.ts", lineNumber: 14 }); })();
1708
1707
 
1709
- class CaucaManagementService {
1710
- static { this.ɵfac = function CaucaManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementService)(); }; }
1711
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaucaManagementService, factory: CaucaManagementService.ɵfac, providedIn: 'root' }); }
1708
+ /** What creation sends as the identifier. */
1709
+ const EmptyUserId = '00000000-0000-0000-0000-000000000000';
1710
+ function createEmptyUserForEdition() {
1711
+ return {
1712
+ id: EmptyUserId,
1713
+ login: { userName: '', password: '', twoFactorAuthenticatorEnabled: true },
1714
+ personalInformation: { firstName: '', lastName: '', email: '', phoneNumber: '' },
1715
+ groupIds: [],
1716
+ };
1712
1717
  }
1713
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementService, [{
1714
- type: Injectable,
1715
- args: [{
1716
- providedIn: 'root'
1717
- }]
1718
- }], null, null); })();
1719
1718
 
1720
- class CaucaManagementComponent {
1721
- static { this.ɵfac = function CaucaManagementComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementComponent)(); }; }
1722
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaucaManagementComponent, selectors: [["cauca-management"]], decls: 3, vars: 3, template: function CaucaManagementComponent_Template(rf, ctx) { if (rf & 1) {
1723
- i0.ɵɵdomElementStart(0, "div");
1724
- i0.ɵɵtext(1);
1725
- i0.ɵɵpipe(2, "translate");
1726
- i0.ɵɵdomElementEnd();
1727
- } if (rf & 2) {
1728
- i0.ɵɵadvance();
1729
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "core.noGenericComponentOnThisLibrary"));
1730
- } }, dependencies: [TranslatePipe], encapsulation: 2 }); }
1719
+ const RequiredMessage = 'error.requiredField';
1720
+ const MaxLengthMessage = 'error.maxLength';
1721
+ function createUserLoginSchema(options) {
1722
+ return schema((login) => {
1723
+ required(login.userName, { message: RequiredMessage });
1724
+ maxLength(login.userName, 100, { message: MaxLengthMessage });
1725
+ validateHttp(login.userName, {
1726
+ request: (context) => {
1727
+ const userName = context.value();
1728
+ return userName ? options.userNameAvailabilityUrl(userName) : undefined;
1729
+ },
1730
+ onSuccess: (isAvailable) => (isAvailable
1731
+ ? undefined
1732
+ : { kind: 'userNameTaken', message: 'management.userNameAlreadyUsed' }),
1733
+ onError: () => undefined,
1734
+ debounce: 400,
1735
+ });
1736
+ required(login.password, {
1737
+ when: () => options.isNew(),
1738
+ message: RequiredMessage,
1739
+ });
1740
+ });
1731
1741
  }
1732
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementComponent, [{
1733
- type: Component,
1734
- args: [{ selector: 'cauca-management', imports: [TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>{{'core.noGenericComponentOnThisLibrary' | translate}}</div>" }]
1735
- }], null, null); })();
1736
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementComponent, { className: "CaucaManagementComponent", filePath: "lib/cauca-management.component.ts", lineNumber: 11 }); })();
1737
-
1738
- /**
1739
- * @deprecated This service is obsolete and should not be used.
1740
- */
1741
- class ManagementGroupService {
1742
- constructor() {
1743
- this.http = inject(HttpClient);
1744
- this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
1745
- this.baseUrlToUse = this.baseUrl.endsWith('api/') ? this.baseUrl : this.baseUrl + 'api/';
1746
- }
1747
- getAll() {
1748
- return this.http.get(`${this.baseUrlToUse}GroupManagement`);
1749
- }
1750
- get(idGroup) {
1751
- return this.http.get(`${this.baseUrlToUse}GroupManagement/${idGroup}`);
1752
- }
1753
- save(group) {
1754
- return this.http.post(`${this.baseUrlToUse}GroupManagement`, group);
1755
- }
1756
- delete(idGroup) {
1757
- return this.http.delete(`${this.baseUrlToUse}GroupManagement/${idGroup}`);
1758
- }
1759
- hasExistingGroupName(group) {
1760
- return this.http.post(`${this.baseUrlToUse}GroupManagement/GroupNameAlreadyExist`, group);
1761
- }
1762
- static { this.ɵfac = function ManagementGroupService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManagementGroupService)(); }; }
1763
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementGroupService, factory: ManagementGroupService.ɵfac, providedIn: 'root' }); }
1742
+ function createUserPersonalInformationSchema(options) {
1743
+ return schema((info) => {
1744
+ required(info.firstName, { message: RequiredMessage });
1745
+ maxLength(info.firstName, 100, { message: MaxLengthMessage });
1746
+ required(info.lastName, { message: RequiredMessage });
1747
+ maxLength(info.lastName, 100, { message: MaxLengthMessage });
1748
+ required(info.email, { message: RequiredMessage });
1749
+ email(info.email, { message: 'error.invalidEmail' });
1750
+ maxLength(info.email, 100, { message: MaxLengthMessage });
1751
+ readonly(info.email, { when: () => options.isEmailReadOnly() });
1752
+ pattern(info.phoneNumber, /^(\d{10})?$/, { message: 'error.invalidPhoneNumber' });
1753
+ });
1764
1754
  }
1765
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementGroupService, [{
1766
- type: Injectable,
1767
- args: [{
1768
- providedIn: 'root'
1769
- }]
1770
- }], null, null); })();
1771
1755
 
1772
- /**
1773
- * @deprecated This service is obsolete and should not be used.
1774
- */
1775
- class ManagementUserService {
1756
+ class UserEditionService {
1776
1757
  constructor() {
1777
- this.http = inject(HttpClient);
1758
+ this.client = inject(HttpClient);
1778
1759
  this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
1779
- this.baseUrlToUse = this.baseUrl.endsWith('api/') ? this.baseUrl : this.baseUrl + 'api/';
1780
- }
1781
- getAll() {
1782
- return this.http.get(`${this.baseUrlToUse}UserManagement`);
1783
- }
1784
- get(idUser) {
1785
- return this.http.get(`${this.baseUrlToUse}UserManagement/${idUser}`);
1786
- }
1787
- getGroup(idUser) {
1788
- return this.http.get(`${this.baseUrlToUse}UserManagement/${idUser}/groups`);
1789
- }
1790
- addGroup(userGroup) {
1791
- return this.http.post(`${this.baseUrlToUse}UserManagement/group`, userGroup);
1792
- }
1793
- deleteGroup(idUserGroup) {
1794
- return this.http.delete(`${this.baseUrlToUse}UserManagement/groups/${idUserGroup}`);
1795
- }
1796
- addPermission(userPermission) {
1797
- return this.http.post(`${this.baseUrlToUse}UserManagement/permission`, userPermission);
1760
+ this.urlPrefix = inject(MANAGEMENT_URL_PREFIX, { optional: true }) ?? '';
1798
1761
  }
1799
- deletePermission(idUserPermission) {
1800
- return this.http.delete(`${this.baseUrlToUse}UserManagement/groups/${idUserPermission}`);
1762
+ getForEdition(userId) {
1763
+ return this.client.get(this.buildApiUrl(`UserEdition/${userId}`));
1801
1764
  }
1802
- save(user) {
1803
- return this.http.post(`${this.baseUrlToUse}UserManagement`, user);
1765
+ saveForEdition(user) {
1766
+ return this.client.post(this.buildApiUrl('UserEdition'), user);
1804
1767
  }
1805
- delete(idUser) {
1806
- return this.http.delete(`${this.baseUrlToUse}UserManagement/${idUser}`);
1768
+ userNameAvailabilityUrl(userName, userId) {
1769
+ const params = new HttpParams({ fromObject: { userName, userId } });
1770
+ return `${this.buildApiUrl('UserEdition/username-available')}?${params.toString()}`;
1807
1771
  }
1808
- hasExistingUserName(user) {
1809
- return this.http.post(`${this.baseUrlToUse}UserManagement/UserNameAlreadyExist`, user);
1772
+ buildApiUrl(path) {
1773
+ const normalizedApiUrl = this.baseUrl.replace(/\/+$/, '');
1774
+ const normalizedPrefix = this.urlPrefix.trim().replace(/^\/+|\/+$/g, '');
1775
+ return normalizedPrefix
1776
+ ? `${normalizedApiUrl}/${normalizedPrefix}/${path}`
1777
+ : `${normalizedApiUrl}/${path}`;
1810
1778
  }
1811
- static { this.ɵfac = function ManagementUserService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManagementUserService)(); }; }
1812
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementUserService, factory: ManagementUserService.ɵfac, providedIn: 'root' }); }
1779
+ static { this.ɵfac = function UserEditionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserEditionService)(); }; }
1780
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: UserEditionService, factory: UserEditionService.ɵfac, providedIn: 'root' }); }
1813
1781
  }
1814
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementUserService, [{
1782
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserEditionService, [{
1815
1783
  type: Injectable,
1816
1784
  args: [{
1817
1785
  providedIn: 'root'
1818
1786
  }]
1819
1787
  }], null, null); })();
1820
1788
 
1821
- /**
1822
- * @deprecated This service is obsolete and should not be used.
1823
- */
1824
- class ManagementPermissionService {
1789
+ class AssignableGroupsService {
1825
1790
  constructor() {
1826
- this.http = inject(HttpClient);
1791
+ this.client = inject(HttpClient);
1827
1792
  this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
1828
- this.baseUrlToUse = this.baseUrl.endsWith('api/') ? this.baseUrl : this.baseUrl + 'api/';
1829
- }
1830
- getAll() {
1831
- return this.http.get(`${this.baseUrlToUse}PermissionManagement`);
1832
- }
1833
- get(idPermission) {
1834
- return this.http.get(`${this.baseUrlToUse}PermissionManagement/${idPermission}`);
1793
+ this.urlPrefix = inject(MANAGEMENT_URL_PREFIX, { optional: true }) ?? '';
1835
1794
  }
1836
- save(permission) {
1837
- return this.http.post(`${this.baseUrlToUse}PermissionManagement`, permission);
1795
+ getAssignableGroups() {
1796
+ return this.client.get(this.buildApiUrl('GroupList/assignable'));
1838
1797
  }
1839
- delete(idPermission) {
1840
- return this.http.delete(`${this.baseUrlToUse}PermissionManagement/${idPermission}`);
1798
+ buildApiUrl(path) {
1799
+ const normalizedApiUrl = this.baseUrl.replace(/\/+$/, '');
1800
+ const normalizedPrefix = this.urlPrefix.trim().replace(/^\/+|\/+$/g, '');
1801
+ return normalizedPrefix
1802
+ ? `${normalizedApiUrl}/${normalizedPrefix}/${path}`
1803
+ : `${normalizedApiUrl}/${path}`;
1841
1804
  }
1842
- static { this.ɵfac = function ManagementPermissionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManagementPermissionService)(); }; }
1843
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementPermissionService, factory: ManagementPermissionService.ɵfac, providedIn: 'root' }); }
1805
+ static { this.ɵfac = function AssignableGroupsService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AssignableGroupsService)(); }; }
1806
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AssignableGroupsService, factory: AssignableGroupsService.ɵfac, providedIn: 'root' }); }
1844
1807
  }
1845
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementPermissionService, [{
1808
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AssignableGroupsService, [{
1846
1809
  type: Injectable,
1847
1810
  args: [{
1848
1811
  providedIn: 'root'
1849
1812
  }]
1850
1813
  }], null, null); })();
1851
1814
 
1852
- const _c0 = () => ["name", "tag"];
1853
- function CaucaManagementGroupComponent_div_20_Template(rf, ctx) { if (rf & 1) {
1854
- const _r1 = i0.ɵɵgetCurrentView();
1855
- i0.ɵɵelementStart(0, "div")(1, "dx-tag-box", 15);
1856
- i0.ɵɵlistener("onInitialized", function CaucaManagementGroupComponent_div_20_Template_dx_tag_box_onInitialized_1_listener($event) { const field_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.getGroupUser(field_r2, $event)); })("onValueChanged", function CaucaManagementGroupComponent_div_20_Template_dx_tag_box_onValueChanged_1_listener($event) { const field_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.setGroupUser(field_r2, $event)); });
1857
- i0.ɵɵelementEnd()();
1858
- } if (rf & 2) {
1859
- const ctx_r2 = i0.ɵɵnextContext();
1860
- i0.ɵɵadvance();
1861
- i0.ɵɵproperty("displayExpr", ctx_r2.fullName)("dataSource", ctx_r2.users)("searchEnabled", true)("searchExpr", ctx_r2.fullName);
1815
+ const _c0$1 = ["*"];
1816
+ function UserLoginFieldsComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
1817
+ i0.ɵɵelement(0, "mat-progress-spinner", 4);
1862
1818
  } }
1863
- function CaucaManagementGroupComponent_div_21_div_2_Template(rf, ctx) { if (rf & 1) {
1864
- const _r4 = i0.ɵɵgetCurrentView();
1865
- i0.ɵɵelementStart(0, "div")(1, "dx-check-box", 17);
1866
- i0.ɵɵlistener("onInitialized", function CaucaManagementGroupComponent_div_21_div_2_Template_dx_check_box_onInitialized_1_listener($event) { const permission_r5 = i0.ɵɵrestoreView(_r4).$implicit; const field_r6 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.getPermissionStatus(field_r6, permission_r5, $event)); })("onValueChanged", function CaucaManagementGroupComponent_div_21_div_2_Template_dx_check_box_onValueChanged_1_listener($event) { const permission_r5 = i0.ɵɵrestoreView(_r4).$implicit; const field_r6 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.checkBoxToggled(field_r6, permission_r5, $event)); });
1867
- i0.ɵɵelementEnd()();
1868
- } if (rf & 2) {
1869
- const permission_r5 = ctx.$implicit;
1870
- i0.ɵɵadvance();
1871
- i0.ɵɵproperty("text", permission_r5.name);
1872
- } }
1873
- function CaucaManagementGroupComponent_div_21_Template(rf, ctx) { if (rf & 1) {
1874
- i0.ɵɵelementStart(0, "div")(1, "dx-list", 16);
1875
- i0.ɵɵtemplate(2, CaucaManagementGroupComponent_div_21_div_2_Template, 2, 1, "div", 14);
1876
- i0.ɵɵelementEnd()();
1877
- } if (rf & 2) {
1878
- const ctx_r2 = i0.ɵɵnextContext();
1879
- i0.ɵɵadvance();
1880
- i0.ɵɵproperty("dataSource", ctx_r2.permissions)("searchEnabled", true)("searchExpr", i0.ɵɵpureFunction0(5, _c0))("hoverStateEnabled", ctx_r2.hoverStatePermission());
1881
- i0.ɵɵadvance();
1882
- i0.ɵɵproperty("dxTemplateOf", "rowTemplate");
1883
- } }
1884
- /**
1885
- * @deprecated This component is obsolete and should not be used.
1886
- */
1887
- class CaucaManagementGroupComponent {
1819
+ class UserLoginFieldsComponent {
1888
1820
  constructor() {
1889
- this.showPrintButton = input(true, /* @ts-ignore */
1890
- ...(ngDevMode ? [{ debugName: "showPrintButton" }] : /* istanbul ignore next */ []));
1891
- this.hoverStatePermission = input(true, /* @ts-ignore */
1892
- ...(ngDevMode ? [{ debugName: "hoverStatePermission" }] : /* istanbul ignore next */ []));
1893
- this.showAssignableByAllUsers = input(true, /* @ts-ignore */
1894
- ...(ngDevMode ? [{ debugName: "showAssignableByAllUsers" }] : /* istanbul ignore next */ []));
1895
- this.groups = [];
1896
- this.users = [];
1897
- this.permissions = [];
1898
- this.userFullName = {};
1899
- this.showColumn = true;
1900
- this.showColumnXS = true;
1901
- this.translations = [];
1902
- this.managementGroupService = inject(ManagementGroupService);
1903
- this.managementUserService = inject(ManagementUserService);
1904
- this.managementPermissionService = inject(ManagementPermissionService);
1905
- this.calculateUsersCellValue = (e) => {
1906
- const users = (e.users ? e.users : []);
1907
- let usersNames = [];
1908
- users.forEach((user) => {
1909
- const userGroup = this.users.filter((u) => u.id === user.idUser);
1910
- if (userGroup && userGroup[0]) {
1911
- usersNames.push(userGroup[0].firstName + ' ' + userGroup[0].lastName);
1912
- }
1913
- });
1914
- usersNames = usersNames.sort((one, two) => (one < two ? -1 : 1));
1915
- return usersNames.join(', ');
1916
- };
1917
- this.groupNameAlreadyUsedValidation = (e) => this.managementGroupService.hasExistingGroupName(e.data).pipe(map((exist) => !exist)).toPromise();
1918
- const breakpointObserver = inject(BreakpointObserver);
1919
- breakpointObserver.observe(['(max-width: 1000px)']).subscribe((result) => {
1920
- this.showColumn = !result.matches;
1921
- });
1922
- breakpointObserver.observe(['(max-width: 600px)']).subscribe((result) => {
1923
- this.showColumnXS = !result.matches;
1924
- });
1925
- }
1926
- ngOnInit() {
1927
- this.managementUserService.getAll().subscribe((data) => {
1928
- this.users = data;
1929
- this.users.forEach((user) => {
1930
- if (user.isActive) {
1931
- if (user.firstName !== '' && user.lastName !== '') {
1932
- this.userFullName[user.id] = `${user.firstName} ${user.lastName}`;
1933
- }
1934
- }
1935
- });
1936
- });
1937
- this.managementPermissionService.getAll().subscribe((permissions) => {
1938
- const permissionIndex = permissions.findIndex((c) => c.tag === 'CanAccessPermissions');
1939
- if (permissionIndex !== -1) {
1940
- permissions.splice(permissionIndex, 1);
1941
- }
1942
- permissions.sort((a, b) => {
1943
- if (a.name < b.name) {
1944
- return -1;
1945
- }
1946
- if (a.name > b.name) {
1947
- return 1;
1948
- }
1949
- return 0;
1950
- });
1951
- this.permissions = permissions;
1952
- });
1953
- this.getGroups();
1954
- }
1955
- fullName(data) {
1956
- if (!data) {
1957
- return '';
1958
- }
1959
- return `${data.firstName} ${data.lastName}`;
1960
- }
1961
- getGroupUser(field, e) {
1962
- const users = [];
1963
- if (this.groupUsers) {
1964
- this.groupUsers.forEach((user) => {
1965
- users.push(user.idUser);
1966
- });
1967
- }
1968
- e.component.option('value', users);
1969
- }
1970
- setGroupUser(field, e) {
1971
- const groupUser = [];
1972
- e.value.forEach((idUser) => {
1973
- const groupIndex = (field.data.users || []).findIndex((g) => g.idUser === idUser);
1974
- if (groupIndex === -1) {
1975
- groupUser.push({ idUser, });
1976
- }
1977
- else {
1978
- groupUser.push(field.data.users[groupIndex]);
1979
- }
1980
- });
1981
- field.setValue(JSON.parse(JSON.stringify(groupUser)));
1982
- }
1983
- setGroupPermission(field, e) {
1984
- const groupUser = [];
1985
- e.value.forEach((idUser) => {
1986
- groupUser.push({
1987
- idUser,
1988
- });
1989
- });
1990
- field.setValue(JSON.parse(JSON.stringify(groupUser)));
1991
- }
1992
- getPermissionStatus(field, permission, e) {
1993
- const groupPermission = (field.value || []).find((p) => p.idModulePermission === permission.id);
1994
- if (groupPermission) {
1995
- e.component.option('value', groupPermission.isAllowed);
1996
- }
1997
- else {
1998
- e.component.option('value', undefined);
1999
- }
2000
- }
2001
- checkBoxToggled(field, permission, e) {
2002
- if (e.component.skipOnValueChanged) {
2003
- e.component.skipOnValueChanged = false;
2004
- return;
2005
- }
2006
- if (e.component.setUndefinedNextTime) {
2007
- e.component.setUndefinedNextTime = false;
2008
- e.component.skipOnValueChanged = true;
2009
- e.component.option('value', undefined);
2010
- this.setPermissionStatus(field, permission, undefined);
2011
- return;
2012
- }
2013
- if (e.value === false) {
2014
- e.component.setUndefinedNextTime = true;
2015
- }
2016
- this.setPermissionStatus(field, permission, e.value);
2017
- }
2018
- onRowInserted(e) {
2019
- this.saveGroup(e.data);
2020
- }
2021
- onRowUpdated(e) {
2022
- this.saveGroup(e.data);
2023
- }
2024
- onRowRemoved(e) {
2025
- const group = e.data;
2026
- this.managementGroupService.delete(group.id).subscribe(() => {
2027
- this.getGroups();
2028
- });
2029
- }
2030
- onEditingStart(e) {
2031
- this.groupUsers = e.data.users;
2032
- }
2033
- onInitNewRow() {
2034
- this.groupUsers = [];
2035
- }
2036
- setPermissionStatus(field, permission, value) {
2037
- const groupPermissions = field.value || [];
2038
- const groupIndex = groupPermissions.findIndex((p) => p.idModulePermission === permission.id);
2039
- if (groupIndex > -1) {
2040
- groupPermissions[groupIndex].isAllowed = value;
2041
- }
2042
- else {
2043
- groupPermissions.push({
2044
- idModulePermission: permission.id,
2045
- isAllowed: value,
2046
- });
2047
- }
2048
- field.setValue(JSON.parse(JSON.stringify(groupPermissions)));
2049
- }
2050
- saveGroup(group) {
2051
- this.removePermissionUndefined(group);
2052
- if (group.users) {
2053
- group.users.forEach((userGroup) => {
2054
- userGroup.idGroup = group.id;
2055
- });
2056
- }
2057
- if (group.permissions) {
2058
- group.permissions.forEach((groupPermission) => {
2059
- groupPermission.idGroup = group.id;
2060
- });
2061
- }
2062
- this.managementGroupService.save(group).subscribe(() => {
2063
- this.getGroups();
2064
- });
2065
- this.groupUsers = [];
2066
- }
2067
- removePermissionUndefined(group) {
2068
- group.permissions = group.permissions.filter((permission) => permission.isAllowed !== undefined);
2069
- }
2070
- getGroups() {
2071
- this.managementGroupService.getAll().subscribe((data) => this.groups = data);
2072
- }
2073
- static { this.ɵfac = function CaucaManagementGroupComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementGroupComponent)(); }; }
2074
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaucaManagementGroupComponent, selectors: [["cauca-management-group"]], inputs: { showPrintButton: [1, "showPrintButton"], hoverStatePermission: [1, "hoverStatePermission"], showAssignableByAllUsers: [1, "showAssignableByAllUsers"] }, decls: 22, vars: 36, consts: [["keyExpr", "id", 3, "onRowInserted", "onInitNewRow", "onRowUpdated", "onEditingStart", "onRowRemoved", "allowPrint", "dataSource"], ["dataField", "name", 3, "caption"], ["type", "async", 3, "message", "validationCallback"], ["dataField", "assignableByAllUsers", "dataType", "boolean", 3, "caption", "visible"], ["dataField", "users", "editCellTemplate", "usersEditTemplate", 3, "caption", "calculateCellValue"], ["dataField", "permissions", "editCellTemplate", "permissionsEditTemplate", 3, "caption", "visible"], [3, "enabled"], ["mode", "popup", 3, "allowAdding", "allowUpdating", "allowDeleting", "useIcons"], [3, "showTitle", "title", "fullScreen"], ["colCount", "1", 3, "labelLocation"], ["dataField", "name", 3, "isRequired"], ["dataField", "users"], ["dataField", "permissions"], ["dataField", "assignableByAllUsers", 3, "visible"], [4, "dxTemplate", "dxTemplateOf"], ["valueExpr", "id", 3, "onInitialized", "onValueChanged", "displayExpr", "dataSource", "searchEnabled", "searchExpr"], ["itemTemplate", "rowTemplate", 3, "dataSource", "searchEnabled", "searchExpr", "hoverStateEnabled"], [3, "onInitialized", "onValueChanged", "text"]], template: function CaucaManagementGroupComponent_Template(rf, ctx) { if (rf & 1) {
2075
- i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
2076
- i0.ɵɵlistener("onRowInserted", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onRowInserted_0_listener($event) { return ctx.onRowInserted($event); })("onInitNewRow", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onInitNewRow_0_listener() { return ctx.onInitNewRow(); })("onRowUpdated", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onRowUpdated_0_listener($event) { return ctx.onRowUpdated($event); })("onEditingStart", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onEditingStart_0_listener($event) { return ctx.onEditingStart($event); })("onRowRemoved", function CaucaManagementGroupComponent_Template_cauca_dx_data_grid_onRowRemoved_0_listener($event) { return ctx.onRowRemoved($event); });
2077
- i0.ɵɵelementStart(1, "dxi-column", 1);
2078
- i0.ɵɵpipe(2, "translate");
2079
- i0.ɵɵelement(3, "dxi-validation-rule", 2);
2080
- i0.ɵɵpipe(4, "translate");
2081
- i0.ɵɵelementEnd();
2082
- i0.ɵɵelement(5, "dxi-column", 3);
1821
+ this.field = input.required(/* @ts-ignore */
1822
+ ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
1823
+ this.isNew = input(false, /* @ts-ignore */
1824
+ ...(ngDevMode ? [{ debugName: "isNew" }] : /* istanbul ignore next */ []));
1825
+ this.isValidatingUserName = input(false, /* @ts-ignore */
1826
+ ...(ngDevMode ? [{ debugName: "isValidatingUserName" }] : /* istanbul ignore next */ []));
1827
+ }
1828
+ static { this.ɵfac = function UserLoginFieldsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserLoginFieldsComponent)(); }; }
1829
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserLoginFieldsComponent, selectors: [["cauca-user-login-fields"]], inputs: { field: [1, "field"], isNew: [1, "isNew"], isValidatingUserName: [1, "isValidatingUserName"] }, ngContentSelectors: _c0$1, decls: 17, vars: 18, consts: [[3, "caption"], [1, "user-login-fields"], ["id", "user-name-field", "subscriptSizing", "dynamic"], ["matInput", "", 3, "formField"], ["matSuffix", "", "diameter", "16", "mode", "indeterminate"], [3, "field"], [1, "password-fields"], [3, "required", "formField"], ["color", "primary", 3, "formField"]], template: function UserLoginFieldsComponent_Template(rf, ctx) { if (rf & 1) {
1830
+ i0.ɵɵprojectionDef();
1831
+ i0.ɵɵelementStart(0, "cauca-expandable-panel", 0);
1832
+ i0.ɵɵpipe(1, "translate");
1833
+ i0.ɵɵelementStart(2, "div", 1)(3, "mat-form-field", 2)(4, "mat-label");
1834
+ i0.ɵɵtext(5);
2083
1835
  i0.ɵɵpipe(6, "translate");
2084
- i0.ɵɵelement(7, "dxi-column", 4);
1836
+ i0.ɵɵelementEnd();
1837
+ i0.ɵɵelement(7, "input", 3);
2085
1838
  i0.ɵɵpipe(8, "translate");
2086
- i0.ɵɵelement(9, "dxi-column", 5);
2087
- i0.ɵɵpipe(10, "translate");
2088
- i0.ɵɵelement(11, "dxo-export", 6);
2089
- i0.ɵɵelementStart(12, "dxo-editing", 7);
2090
- i0.ɵɵelement(13, "dxo-popup", 8);
2091
- i0.ɵɵpipe(14, "translate");
2092
- i0.ɵɵelementStart(15, "dxo-form", 9);
2093
- i0.ɵɵelement(16, "dxi-item", 10)(17, "dxi-item", 11)(18, "dxi-item", 12)(19, "dxi-item", 13);
2094
- i0.ɵɵelementEnd()();
2095
- i0.ɵɵtemplate(20, CaucaManagementGroupComponent_div_20_Template, 2, 4, "div", 14)(21, CaucaManagementGroupComponent_div_21_Template, 3, 6, "div", 14);
1839
+ i0.ɵɵcontrolCreate();
1840
+ i0.ɵɵconditionalCreate(9, UserLoginFieldsComponent_Conditional_9_Template, 1, 0, "mat-progress-spinner", 4);
2096
1841
  i0.ɵɵelementEnd();
1842
+ i0.ɵɵelement(10, "cauca-field-errors", 5);
1843
+ i0.ɵɵelementStart(11, "div", 6);
1844
+ i0.ɵɵelement(12, "cauca-password-selection", 7);
1845
+ i0.ɵɵcontrolCreate();
1846
+ i0.ɵɵelementEnd();
1847
+ i0.ɵɵelementStart(13, "mat-slide-toggle", 8);
1848
+ i0.ɵɵtext(14);
1849
+ i0.ɵɵpipe(15, "translate");
1850
+ i0.ɵɵelementEnd();
1851
+ i0.ɵɵcontrolCreate();
1852
+ i0.ɵɵprojection(16);
1853
+ i0.ɵɵelementEnd()();
2097
1854
  } if (rf & 2) {
2098
- i0.ɵɵproperty("allowPrint", ctx.showPrintButton())("dataSource", ctx.groups);
2099
- i0.ɵɵadvance();
2100
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 24, "management.name"));
2101
- i0.ɵɵadvance(2);
2102
- i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 26, "management.groupNameAlreadyUsed"))("validationCallback", ctx.groupNameAlreadyUsedValidation);
2103
- i0.ɵɵadvance(2);
2104
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 28, "management.assignableByAllUsers"))("visible", ctx.showAssignableByAllUsers());
2105
- i0.ɵɵadvance(2);
2106
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 30, "management.users"))("calculateCellValue", ctx.calculateUsersCellValue);
1855
+ i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(1, 10, "management.userEdition.loginSectionCaption"));
1856
+ i0.ɵɵadvance(5);
1857
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 12, "management.userName"));
2107
1858
  i0.ɵɵadvance(2);
2108
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(10, 32, "management.permissions"))("visible", false);
1859
+ i0.ɵɵproperty("formField", ctx.field().userName);
1860
+ i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(8, 14, "management.userName"));
1861
+ i0.ɵɵcontrol();
2109
1862
  i0.ɵɵadvance(2);
2110
- i0.ɵɵproperty("enabled", false);
1863
+ i0.ɵɵconditional(ctx.isValidatingUserName() ? 9 : -1);
2111
1864
  i0.ɵɵadvance();
2112
- i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
2113
- i0.ɵɵadvance();
2114
- i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(14, 34, "management.group"))("fullScreen", !ctx.showColumn);
1865
+ i0.ɵɵproperty("field", ctx.field().userName);
2115
1866
  i0.ɵɵadvance(2);
2116
- i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
2117
- i0.ɵɵadvance();
2118
- i0.ɵɵproperty("isRequired", true);
2119
- i0.ɵɵadvance(3);
2120
- i0.ɵɵproperty("visible", ctx.showAssignableByAllUsers());
1867
+ i0.ɵɵproperty("required", ctx.isNew())("formField", ctx.field().password);
1868
+ i0.ɵɵcontrol();
2121
1869
  i0.ɵɵadvance();
2122
- i0.ɵɵproperty("dxTemplateOf", "usersEditTemplate");
1870
+ i0.ɵɵproperty("formField", ctx.field().twoFactorAuthenticatorEnabled);
1871
+ i0.ɵɵcontrol();
2123
1872
  i0.ɵɵadvance();
2124
- i0.ɵɵproperty("dxTemplateOf", "permissionsEditTemplate");
2125
- } }, dependencies: [CaucaDevextremeModule, i1$3.CaucaDataGridComponent, i2$2.DxiColumnComponent, i2$2.DxiValidationRuleComponent, i2$2.DxoEditingComponent, i2$2.DxoFormComponent, i2$2.DxiItemComponent, i2$2.DxoPopupComponent, i2$2.DxoExportComponent, i3$2.DxTemplateDirective, DxCheckBoxModule, i4$2.DxCheckBoxComponent, DxListModule, i5$1.DxListComponent, DxTagBoxModule, i6$1.DxTagBoxComponent, TranslatePipe], encapsulation: 2 }); }
1873
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(15, 16, "management.userEdition.twoFactorAuthenticatorEnabled"), " ");
1874
+ } }, dependencies: [ExpandablePanelComponent,
1875
+ FieldErrorsComponent,
1876
+ FormField,
1877
+ MatFormFieldModule, i1$2.MatFormField, i1$2.MatLabel, i1$2.MatSuffix, MatInputModule, i2.MatInput, MatProgressSpinnerModule, i3$2.MatProgressSpinner, MatSlideToggleModule, i3$1.MatSlideToggle, PasswordSelectionComponent,
1878
+ TranslatePipe], styles: ["[_nghost-%COMP%]{display:block}.user-login-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column}.user-login-fields[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]:not(:first-child), .user-login-fields[_ngcontent-%COMP%] .password-fields[_ngcontent-%COMP%], .user-login-fields[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{margin-top:1.25rem}"] }); }
2126
1879
  }
2127
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementGroupComponent, [{
1880
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserLoginFieldsComponent, [{
2128
1881
  type: Component,
2129
- args: [{ selector: 'cauca-management-group', imports: [CaucaDevextremeModule, DxCheckBoxModule, DxListModule, DxTagBoxModule, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cauca-dx-data-grid [allowPrint]=\"showPrintButton()\" keyExpr=\"id\" [dataSource]=\"groups\"\n (onRowInserted)=\"onRowInserted($event)\" (onInitNewRow)=\"onInitNewRow()\" (onRowUpdated)=\"onRowUpdated($event)\"\n (onEditingStart)=\"onEditingStart($event)\" (onRowRemoved)=\"onRowRemoved($event)\">\n\n <dxi-column dataField=\"name\" [caption]=\"'management.name' | translate\">\n <dxi-validation-rule type=\"async\" [message]=\"'management.groupNameAlreadyUsed' | translate\"\n [validationCallback]=\"groupNameAlreadyUsedValidation\"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField=\"assignableByAllUsers\" [caption]=\"'management.assignableByAllUsers' | translate\"\n dataType=\"boolean\" [visible]=\"showAssignableByAllUsers()\">\n </dxi-column>\n <dxi-column dataField=\"users\" [caption]=\"'management.users' | translate\" editCellTemplate=\"usersEditTemplate\"\n [calculateCellValue]=\"calculateUsersCellValue\">\n </dxi-column>\n <dxi-column dataField=\"permissions\" [caption]=\"'management.permissions' | translate\" [visible]=\"false\"\n editCellTemplate=\"permissionsEditTemplate\">\n </dxi-column>\n <dxo-export [enabled]=\"false\"></dxo-export>\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\" [fullScreen]=\"!showColumn\"></dxo-popup>\n <dxo-form colCount=\"1\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\n <dxi-item dataField=\"name\" [isRequired]=\"true\"></dxi-item>\n <dxi-item dataField=\"users\"></dxi-item>\n <dxi-item dataField=\"permissions\"></dxi-item>\n <dxi-item dataField=\"assignableByAllUsers\" [visible]=\"showAssignableByAllUsers()\"></dxi-item>\n </dxo-form>\n </dxo-editing>\n\n <div *dxTemplate=\"let field of 'usersEditTemplate'\">\n <dx-tag-box valueExpr=\"id\" [displayExpr]=\"fullName\" [dataSource]=\"users\" [searchEnabled]=\"true\"\n [searchExpr]=\"fullName\" (onInitialized)=\"getGroupUser(field, $event)\"\n (onValueChanged)=\"setGroupUser(field, $event)\">\n </dx-tag-box>\n </div>\n <div *dxTemplate=\"let field of 'permissionsEditTemplate'\">\n <dx-list [dataSource]=\"permissions\" itemTemplate=\"rowTemplate\" [searchEnabled]=\"true\"\n [searchExpr]=\"['name', 'tag']\" [hoverStateEnabled]=\"hoverStatePermission()\">\n <div *dxTemplate=\"let permission of 'rowTemplate'\">\n <dx-check-box [text]=\"permission.name\" (onInitialized)=\"getPermissionStatus(field, permission, $event)\"\n (onValueChanged)=\"checkBoxToggled(field, permission, $event)\">\n </dx-check-box>\n </div>\n </dx-list>\n </div>\n</cauca-dx-data-grid>" }]
2130
- }], () => [], { showPrintButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPrintButton", required: false }] }], hoverStatePermission: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverStatePermission", required: false }] }], showAssignableByAllUsers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAssignableByAllUsers", required: false }] }] }); })();
2131
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementGroupComponent, { className: "CaucaManagementGroupComponent", filePath: "lib/cauca-management-group/cauca-management-group.component.ts", lineNumber: 28 }); })();
2132
-
2133
- /**
2134
- * @deprecated This model is obsolete and should not be used.
2135
- */
2136
- class UserModel {
2137
- constructor() {
2138
- this.userName = '';
2139
- this.firstName = '';
2140
- this.lastName = '';
2141
- this.password = '';
2142
- this.email = '';
2143
- this.isActive = true;
2144
- this.twoFactorAuthenticatorEnabled = false;
2145
- }
2146
- }
1882
+ args: [{ selector: 'cauca-user-login-fields', imports: [
1883
+ ExpandablePanelComponent,
1884
+ FieldErrorsComponent,
1885
+ FormField,
1886
+ MatFormFieldModule,
1887
+ MatInputModule,
1888
+ MatProgressSpinnerModule,
1889
+ MatSlideToggleModule,
1890
+ PasswordSelectionComponent,
1891
+ TranslatePipe,
1892
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cauca-expandable-panel [caption]=\"'management.userEdition.loginSectionCaption' | translate\">\n <div class=\"user-login-fields\">\n <mat-form-field id=\"user-name-field\" subscriptSizing=\"dynamic\">\n <mat-label>{{ 'management.userName' | translate }}</mat-label>\n <input matInput [attr.aria-label]=\"'management.userName' | translate\" [formField]=\"field().userName\">\n @if (isValidatingUserName()) {\n <mat-progress-spinner matSuffix diameter=\"16\" mode=\"indeterminate\"/>\n }\n </mat-form-field>\n <cauca-field-errors [field]=\"field().userName\"/>\n\n <div class=\"password-fields\">\n <cauca-password-selection [required]=\"isNew()\" [formField]=\"field().password\"/>\n </div>\n\n <mat-slide-toggle color=\"primary\" [formField]=\"field().twoFactorAuthenticatorEnabled\">\n {{ 'management.userEdition.twoFactorAuthenticatorEnabled' | translate }}\n </mat-slide-toggle>\n\n <ng-content/>\n </div>\n</cauca-expandable-panel>\n", styles: [":host{display:block}.user-login-fields{display:flex;flex-direction:column}.user-login-fields mat-form-field:not(:first-child),.user-login-fields .password-fields,.user-login-fields mat-slide-toggle{margin-top:1.25rem}\n"] }]
1893
+ }], null, { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], isNew: [{ type: i0.Input, args: [{ isSignal: true, alias: "isNew", required: false }] }], isValidatingUserName: [{ type: i0.Input, args: [{ isSignal: true, alias: "isValidatingUserName", required: false }] }] }); })();
1894
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserLoginFieldsComponent, { className: "UserLoginFieldsComponent", filePath: "lib/components/user-login-fields/user-login-fields.component.ts", lineNumber: 28 }); })();
2147
1895
 
2148
- /**
2149
- * @deprecated This component is obsolete and should not be used.
2150
- */
2151
- class CaucaManagementUserComponent {
1896
+ const _c0 = ["*"];
1897
+ function UserPersonalInformationFieldsComponent_Conditional_23_Template(rf, ctx) { if (rf & 1) {
1898
+ i0.ɵɵelementStart(0, "mat-hint");
1899
+ i0.ɵɵtext(1);
1900
+ i0.ɵɵpipe(2, "translate");
1901
+ i0.ɵɵelementEnd();
1902
+ } if (rf & 2) {
1903
+ const ctx_r0 = i0.ɵɵnextContext();
1904
+ i0.ɵɵadvance();
1905
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.emailHint()));
1906
+ } }
1907
+ class UserPersonalInformationFieldsComponent {
2152
1908
  constructor() {
2153
- this.users = [
2154
- new UserModel()
2155
- ];
2156
- this.showColumnXS = true;
2157
- this.managementUserService = inject(ManagementUserService);
2158
- this.userNameAlreadyUsedValidation = (e) => this.managementUserService.hasExistingUserName(e.data).pipe(map((exist) => !exist)).toPromise();
2159
- const breakpointObserver = inject(BreakpointObserver);
2160
- breakpointObserver.observe(['(max-width: 600px)']).subscribe((result) => {
2161
- this.showColumnXS = !result.matches;
2162
- });
2163
- }
2164
- ngOnInit() {
2165
- this.getUsers();
2166
- }
2167
- onRowInserted(e) {
2168
- this.saveGroup(e.data);
2169
- }
2170
- onRowUpdated(e) {
2171
- this.saveGroup(e.key);
2172
- }
2173
- onRowRemoved(e) {
2174
- const user = e.data;
2175
- this.managementUserService.delete(user.id).subscribe((_data) => {
2176
- this.getUsers();
2177
- });
2178
- }
2179
- saveGroup(user) {
2180
- this.managementUserService.save(user).subscribe(() => {
2181
- this.getUsers();
2182
- });
2183
- }
2184
- getUsers() {
2185
- this.managementUserService.getAll().subscribe((data) => this.users = data);
2186
- }
2187
- static { this.ɵfac = function CaucaManagementUserComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementUserComponent)(); }; }
2188
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaucaManagementUserComponent, selectors: [["cauca-management-user"]], decls: 22, vars: 31, consts: [["keyExpr", "id", 3, "onRowInserted", "onRowUpdated", "onRowRemoved", "dataSource"], ["dataField", "userName", 3, "caption"], ["type", "async", 3, "message", "validationCallback"], ["dataField", "isActive", 3, "caption", "visible"], ["dataField", "firstName", 3, "caption"], ["dataField", "lastName", 3, "caption"], ["dataField", "groups", 3, "caption"], ["mode", "popup", 3, "allowAdding", "allowUpdating", "allowDeleting", "useIcons"], [3, "showTitle", "title"], ["colCount", "2", 3, "labelLocation"], ["dataField", "userName", 3, "isRequired"], ["dataField", "isActive"], ["dataField", "firstName"], ["dataField", "lastName"], ["dataField", "group"]], template: function CaucaManagementUserComponent_Template(rf, ctx) { if (rf & 1) {
2189
- i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
2190
- i0.ɵɵlistener("onRowInserted", function CaucaManagementUserComponent_Template_cauca_dx_data_grid_onRowInserted_0_listener($event) { return ctx.onRowInserted($event); })("onRowUpdated", function CaucaManagementUserComponent_Template_cauca_dx_data_grid_onRowUpdated_0_listener($event) { return ctx.onRowUpdated($event); })("onRowRemoved", function CaucaManagementUserComponent_Template_cauca_dx_data_grid_onRowRemoved_0_listener($event) { return ctx.onRowRemoved($event); });
2191
- i0.ɵɵelementStart(1, "dxi-column", 1);
2192
- i0.ɵɵpipe(2, "translate");
2193
- i0.ɵɵelement(3, "dxi-validation-rule", 2);
2194
- i0.ɵɵpipe(4, "translate");
2195
- i0.ɵɵelementEnd();
2196
- i0.ɵɵelement(5, "dxi-column", 3);
1909
+ this.field = input.required(/* @ts-ignore */
1910
+ ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
1911
+ this.isEmailReadOnly = input(false, /* @ts-ignore */
1912
+ ...(ngDevMode ? [{ debugName: "isEmailReadOnly" }] : /* istanbul ignore next */ []));
1913
+ this.emailHint = input('', /* @ts-ignore */
1914
+ ...(ngDevMode ? [{ debugName: "emailHint" }] : /* istanbul ignore next */ []));
1915
+ }
1916
+ static { this.ɵfac = function UserPersonalInformationFieldsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserPersonalInformationFieldsComponent)(); }; }
1917
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserPersonalInformationFieldsComponent, selectors: [["cauca-user-personal-information-fields"]], inputs: { field: [1, "field"], isEmailReadOnly: [1, "isEmailReadOnly"], emailHint: [1, "emailHint"] }, ngContentSelectors: _c0, decls: 27, vars: 30, consts: [[3, "caption"], [1, "user-personal-information-fields"], ["id", "first-name-field", "subscriptSizing", "dynamic"], ["matInput", "", 3, "formField"], [3, "field"], ["id", "last-name-field", "subscriptSizing", "dynamic"], ["id", "email-field", "subscriptSizing", "dynamic"], [3, "formField", "label"]], template: function UserPersonalInformationFieldsComponent_Template(rf, ctx) { if (rf & 1) {
1918
+ i0.ɵɵprojectionDef();
1919
+ i0.ɵɵelementStart(0, "cauca-expandable-panel", 0);
1920
+ i0.ɵɵpipe(1, "translate");
1921
+ i0.ɵɵelementStart(2, "div", 1)(3, "mat-form-field", 2)(4, "mat-label");
1922
+ i0.ɵɵtext(5);
2197
1923
  i0.ɵɵpipe(6, "translate");
2198
- i0.ɵɵelement(7, "dxi-column", 4);
1924
+ i0.ɵɵelementEnd();
1925
+ i0.ɵɵelement(7, "input", 3);
2199
1926
  i0.ɵɵpipe(8, "translate");
2200
- i0.ɵɵelement(9, "dxi-column", 5);
2201
- i0.ɵɵpipe(10, "translate");
2202
- i0.ɵɵelement(11, "dxi-column", 6);
2203
- i0.ɵɵpipe(12, "translate");
2204
- i0.ɵɵelementStart(13, "dxo-editing", 7);
2205
- i0.ɵɵelement(14, "dxo-popup", 8);
1927
+ i0.ɵɵcontrolCreate();
1928
+ i0.ɵɵelementEnd();
1929
+ i0.ɵɵelement(9, "cauca-field-errors", 4);
1930
+ i0.ɵɵelementStart(10, "mat-form-field", 5)(11, "mat-label");
1931
+ i0.ɵɵtext(12);
1932
+ i0.ɵɵpipe(13, "translate");
1933
+ i0.ɵɵelementEnd();
1934
+ i0.ɵɵelement(14, "input", 3);
2206
1935
  i0.ɵɵpipe(15, "translate");
2207
- i0.ɵɵelementStart(16, "dxo-form", 9);
2208
- i0.ɵɵelement(17, "dxi-item", 10)(18, "dxi-item", 11)(19, "dxi-item", 12)(20, "dxi-item", 13)(21, "dxi-item", 14);
2209
- i0.ɵɵelementEnd()()();
1936
+ i0.ɵɵcontrolCreate();
1937
+ i0.ɵɵelementEnd();
1938
+ i0.ɵɵelement(16, "cauca-field-errors", 4);
1939
+ i0.ɵɵelementStart(17, "mat-form-field", 6)(18, "mat-label");
1940
+ i0.ɵɵtext(19);
1941
+ i0.ɵɵpipe(20, "translate");
1942
+ i0.ɵɵelementEnd();
1943
+ i0.ɵɵelement(21, "input", 3);
1944
+ i0.ɵɵpipe(22, "translate");
1945
+ i0.ɵɵcontrolCreate();
1946
+ i0.ɵɵconditionalCreate(23, UserPersonalInformationFieldsComponent_Conditional_23_Template, 3, 3, "mat-hint");
1947
+ i0.ɵɵelementEnd();
1948
+ i0.ɵɵelement(24, "cauca-field-errors", 4)(25, "cauca-phone-number-input", 7);
1949
+ i0.ɵɵcontrolCreate();
1950
+ i0.ɵɵprojection(26);
1951
+ i0.ɵɵelementEnd()();
2210
1952
  } if (rf & 2) {
2211
- i0.ɵɵproperty("dataSource", ctx.users);
2212
- i0.ɵɵadvance();
2213
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 17, "management.userName"));
1953
+ i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(1, 16, "management.userEdition.personalInformationSectionCaption"));
1954
+ i0.ɵɵadvance(5);
1955
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 18, "management.firstName"));
2214
1956
  i0.ɵɵadvance(2);
2215
- i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 19, "management.userNameAlreadyUsed"))("validationCallback", ctx.userNameAlreadyUsedValidation);
1957
+ i0.ɵɵproperty("formField", ctx.field().firstName);
1958
+ i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(8, 20, "management.firstName"));
1959
+ i0.ɵɵcontrol();
2216
1960
  i0.ɵɵadvance(2);
2217
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 21, "management.isActive"))("visible", false);
1961
+ i0.ɵɵproperty("field", ctx.field().firstName);
1962
+ i0.ɵɵadvance(3);
1963
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 22, "management.lastName"));
2218
1964
  i0.ɵɵadvance(2);
2219
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 23, "management.firstName"));
1965
+ i0.ɵɵproperty("formField", ctx.field().lastName);
1966
+ i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(15, 24, "management.lastName"));
1967
+ i0.ɵɵcontrol();
2220
1968
  i0.ɵɵadvance(2);
2221
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(10, 25, "management.lastName"));
1969
+ i0.ɵɵproperty("field", ctx.field().lastName);
1970
+ i0.ɵɵadvance(3);
1971
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(20, 26, "management.email"));
2222
1972
  i0.ɵɵadvance(2);
2223
- i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(12, 27, "management.group"));
1973
+ i0.ɵɵproperty("formField", ctx.field().email);
1974
+ i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(22, 28, "management.email"));
1975
+ i0.ɵɵcontrol();
2224
1976
  i0.ɵɵadvance(2);
2225
- i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
1977
+ i0.ɵɵconditional(ctx.isEmailReadOnly() && ctx.emailHint() ? 23 : -1);
2226
1978
  i0.ɵɵadvance();
2227
- i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(15, 29, "management.group"));
2228
- i0.ɵɵadvance(2);
2229
- i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
1979
+ i0.ɵɵproperty("field", ctx.field().email);
2230
1980
  i0.ɵɵadvance();
2231
- i0.ɵɵproperty("isRequired", true);
2232
- } }, dependencies: [CaucaDevextremeModule, i1$3.CaucaDataGridComponent, i2$2.DxiColumnComponent, i2$2.DxiValidationRuleComponent, i2$2.DxoEditingComponent, i2$2.DxoFormComponent, i2$2.DxiItemComponent, i2$2.DxoPopupComponent, TranslatePipe], encapsulation: 2 }); }
1981
+ i0.ɵɵproperty("formField", ctx.field().phoneNumber)("label", "management.phoneNumber");
1982
+ i0.ɵɵcontrol();
1983
+ } }, dependencies: [ExpandablePanelComponent,
1984
+ FieldErrorsComponent,
1985
+ FormField,
1986
+ MatFormFieldModule, i1$2.MatFormField, i1$2.MatLabel, i1$2.MatHint, MatInputModule, i2.MatInput, PhoneNumberInputComponent,
1987
+ TranslatePipe], styles: ["[_nghost-%COMP%]{display:block}.user-personal-information-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column}.user-personal-information-fields[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]:not(:first-child), .user-personal-information-fields[_ngcontent-%COMP%] cauca-phone-number-input[_ngcontent-%COMP%]{margin-top:1.25rem}"] }); }
2233
1988
  }
2234
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementUserComponent, [{
1989
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserPersonalInformationFieldsComponent, [{
2235
1990
  type: Component,
2236
- args: [{ selector: 'cauca-management-user', imports: [CaucaDevextremeModule, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cauca-dx-data-grid\n keyExpr=\"id\"\n [dataSource]=\"users\"\n (onRowInserted)=\"onRowInserted($event)\"\n (onRowUpdated)=\"onRowUpdated($event)\"\n (onRowRemoved)=\"onRowRemoved($event)\">\n\n <dxi-column dataField=\"userName\" [caption]=\"'management.userName' | translate\">\n <dxi-validation-rule type=\"async\" [message]=\"'management.userNameAlreadyUsed' | translate\" [validationCallback]=\"userNameAlreadyUsedValidation\"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField=\"isActive\" [caption]=\"'management.isActive' | translate\" [visible]=\"false\"></dxi-column>\n <dxi-column dataField=\"firstName\" [caption]=\"'management.firstName' | translate\"></dxi-column>\n <dxi-column dataField=\"lastName\" [caption]=\"'management.lastName' | translate\"></dxi-column>\n <dxi-column dataField=\"groups\" [caption]=\"'management.group' | translate\"></dxi-column>\n\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\"></dxo-popup>\n <dxo-form colCount=\"2\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\n <dxi-item dataField=\"userName\" [isRequired]=\"true\"></dxi-item>\n <dxi-item dataField=\"isActive\"></dxi-item>\n <dxi-item dataField=\"firstName\"></dxi-item>\n <dxi-item dataField=\"lastName\"></dxi-item>\n <dxi-item dataField=\"group\"></dxi-item>\n </dxo-form>\n </dxo-editing>\n</cauca-dx-data-grid>\n" }]
2237
- }], () => [], null); })();
2238
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementUserComponent, { className: "CaucaManagementUserComponent", filePath: "lib/cauca-management-user/cauca-management-user.component.ts", lineNumber: 20 }); })();
2239
-
2240
- /**
2241
- * @deprecated Import CaucaManagementComponent, CaucaManagementUserComponent and
2242
- * CaucaManagementGroupComponent directly in your standalone components. Kept as a re-export
2243
- * so existing consumers keep compiling.
2244
- */
2245
- class CaucaManagementModule {
2246
- static { this.ɵfac = function CaucaManagementModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementModule)(); }; }
2247
- static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CaucaManagementModule }); }
2248
- static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CaucaManagementGroupComponent,
2249
- CaucaManagementUserComponent] }); }
2250
- }
2251
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementModule, [{
2252
- type: NgModule,
2253
- args: [{
2254
- imports: [
2255
- CaucaManagementComponent,
2256
- CaucaManagementGroupComponent,
2257
- CaucaManagementUserComponent,
2258
- ],
2259
- exports: [
2260
- CaucaManagementComponent,
2261
- CaucaManagementUserComponent,
2262
- CaucaManagementGroupComponent,
2263
- ]
2264
- }]
2265
- }], null, null); })();
2266
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CaucaManagementModule, { imports: [CaucaManagementComponent,
2267
- CaucaManagementGroupComponent,
2268
- CaucaManagementUserComponent], exports: [CaucaManagementComponent,
2269
- CaucaManagementUserComponent,
2270
- CaucaManagementGroupComponent] }); })();
2271
-
2272
- /**
2273
- * @deprecated This model is obsolete and should not be used.
2274
- */
2275
- class UserGroupModel {
2276
- constructor() {
2277
- this.idUserGroup = '';
2278
- this.idGroup = '';
2279
- this.idUser = '';
2280
- }
2281
- }
2282
-
2283
- /**
2284
- * @deprecated This model is obsolete and should not be used.
2285
- */
2286
- class UserPermissionModel {
2287
- constructor() {
2288
- this.idUserPermission = '';
2289
- this.isAllowed = false;
2290
- this.idUser = '';
2291
- this.idModulePermission = '';
2292
- }
2293
- }
1991
+ args: [{ selector: 'cauca-user-personal-information-fields', imports: [
1992
+ ExpandablePanelComponent,
1993
+ FieldErrorsComponent,
1994
+ FormField,
1995
+ MatFormFieldModule,
1996
+ MatInputModule,
1997
+ PhoneNumberInputComponent,
1998
+ TranslatePipe,
1999
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cauca-expandable-panel [caption]=\"'management.userEdition.personalInformationSectionCaption' | translate\">\n <div class=\"user-personal-information-fields\">\n <mat-form-field id=\"first-name-field\" subscriptSizing=\"dynamic\">\n <mat-label>{{ 'management.firstName' | translate }}</mat-label>\n <input matInput [attr.aria-label]=\"'management.firstName' | translate\" [formField]=\"field().firstName\">\n </mat-form-field>\n <cauca-field-errors [field]=\"field().firstName\"/>\n\n <mat-form-field id=\"last-name-field\" subscriptSizing=\"dynamic\">\n <mat-label>{{ 'management.lastName' | translate }}</mat-label>\n <input matInput [attr.aria-label]=\"'management.lastName' | translate\" [formField]=\"field().lastName\">\n </mat-form-field>\n <cauca-field-errors [field]=\"field().lastName\"/>\n\n <mat-form-field id=\"email-field\" subscriptSizing=\"dynamic\">\n <mat-label>{{ 'management.email' | translate }}</mat-label>\n <input matInput [attr.aria-label]=\"'management.email' | translate\" [formField]=\"field().email\">\n @if (isEmailReadOnly() && emailHint()) {\n <mat-hint>{{ emailHint() | translate }}</mat-hint>\n }\n </mat-form-field>\n <cauca-field-errors [field]=\"field().email\"/>\n\n <cauca-phone-number-input [formField]=\"field().phoneNumber\" [label]=\"'management.phoneNumber'\"/>\n\n <ng-content/>\n </div>\n</cauca-expandable-panel>\n", styles: [":host{display:block}.user-personal-information-fields{display:flex;flex-direction:column}.user-personal-information-fields mat-form-field:not(:first-child),.user-personal-information-fields cauca-phone-number-input{margin-top:1.25rem}\n"] }]
2000
+ }], null, { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], isEmailReadOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isEmailReadOnly", required: false }] }], emailHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "emailHint", required: false }] }] }); })();
2001
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserPersonalInformationFieldsComponent, { className: "UserPersonalInformationFieldsComponent", filePath: "lib/components/user-personal-information-fields/user-personal-information-fields.component.ts", lineNumber: 24 }); })();
2294
2002
 
2295
- /**
2296
- * @deprecated This model is obsolete and should not be used.
2297
- */
2298
- class GroupModel {
2003
+ const _forTrack0 = ($index, $item) => $item.id;
2004
+ function UserGroupsSelectorComponent_For_10_Template(rf, ctx) { if (rf & 1) {
2005
+ i0.ɵɵelementStart(0, "mat-option", 3);
2006
+ i0.ɵɵtext(1);
2007
+ i0.ɵɵelementEnd();
2008
+ } if (rf & 2) {
2009
+ const option_r1 = ctx.$implicit;
2010
+ i0.ɵɵproperty("value", option_r1.id);
2011
+ i0.ɵɵadvance();
2012
+ i0.ɵɵtextInterpolate(option_r1.name);
2013
+ } }
2014
+ class UserGroupsSelectorComponent {
2299
2015
  constructor() {
2300
- this.name = '';
2301
- this.users = [];
2302
- this.permissions = [];
2016
+ this.value = model([], /* @ts-ignore */
2017
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
2018
+ this.label = input('management.groups', /* @ts-ignore */
2019
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
2020
+ this.disabled = input(false, /* @ts-ignore */
2021
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
2022
+ // Shadowing the `readonly` keyword as a property name is mandated by
2023
+ // `FormUiControl.readonly` — see `base-file-picker.ts`.
2024
+ this.readonly = input(false, /* @ts-ignore */
2025
+ ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
2026
+ this.required = input(false, /* @ts-ignore */
2027
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
2028
+ this.invalid = input(false, /* @ts-ignore */
2029
+ ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
2030
+ this.touched = input(false, /* @ts-ignore */
2031
+ ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
2032
+ this.name = input('', /* @ts-ignore */
2033
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
2034
+ this.errors = input([], /* @ts-ignore */
2035
+ ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
2036
+ this.touch = output();
2037
+ this.filterControl = new FormControl('');
2038
+ this.options = computed(() => this.groups.value(), /* @ts-ignore */
2039
+ ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
2040
+ this.filteredOptions = computed(() => {
2041
+ const filter = toLowerCaseAndWithoutDiacritics(this.filterText() ?? '');
2042
+ return filter
2043
+ ? this.options().filter((option) => toLowerCaseAndWithoutDiacritics(option.name).includes(filter))
2044
+ : this.options();
2045
+ }, /* @ts-ignore */
2046
+ ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
2047
+ this.isSelectDisabled = computed(() => this.disabled() || this.readonly() || this.options().length === 0, /* @ts-ignore */
2048
+ ...(ngDevMode ? [{ debugName: "isSelectDisabled" }] : /* istanbul ignore next */ []));
2049
+ this.assignableGroupsService = inject(AssignableGroupsService);
2050
+ this.filterText = toSignal(this.filterControl.valueChanges, { initialValue: '' });
2051
+ this.groups = rxResource({
2052
+ stream: () => this.assignableGroupsService.getAssignableGroups(),
2053
+ defaultValue: [],
2054
+ });
2303
2055
  }
2304
- }
2305
-
2306
- /**
2307
- * @deprecated This model is obsolete and should not be used.
2308
- */
2309
- class GroupPermissionModel {
2310
- constructor() {
2311
- this.idGroupPermission = '';
2312
- this.isAllowed = false;
2313
- this.idGroup = '';
2314
- this.idModulePermission = '';
2056
+ onSelectionChange(groupIds) {
2057
+ this.value.set(groupIds);
2058
+ this.touch.emit();
2315
2059
  }
2060
+ static { this.ɵfac = function UserGroupsSelectorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserGroupsSelectorComponent)(); }; }
2061
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserGroupsSelectorComponent, selectors: [["cauca-user-groups-selector"]], inputs: { value: [1, "value"], label: [1, "label"], disabled: [1, "disabled"], readonly: [1, "readonly"], required: [1, "required"], invalid: [1, "invalid"], touched: [1, "touched"], name: [1, "name"], errors: [1, "errors"] }, outputs: { value: "valueChange", touch: "touch" }, decls: 12, vars: 17, consts: [["subscriptSizing", "dynamic", 1, "user-groups-selector-field"], ["multiple", "", 3, "valueChange", "value", "disabled", "required"], [3, "formControl", "placeholderLabel", "noEntriesFoundLabel"], [3, "value"], [3, "touched", "errors"]], template: function UserGroupsSelectorComponent_Template(rf, ctx) { if (rf & 1) {
2062
+ i0.ɵɵelementStart(0, "mat-form-field", 0)(1, "mat-label");
2063
+ i0.ɵɵtext(2);
2064
+ i0.ɵɵpipe(3, "translate");
2065
+ i0.ɵɵelementEnd();
2066
+ i0.ɵɵelementStart(4, "mat-select", 1);
2067
+ i0.ɵɵlistener("valueChange", function UserGroupsSelectorComponent_Template_mat_select_valueChange_4_listener($event) { return ctx.onSelectionChange($event); });
2068
+ i0.ɵɵelementStart(5, "mat-option");
2069
+ i0.ɵɵelement(6, "ngx-mat-select-search", 2);
2070
+ i0.ɵɵpipe(7, "translate");
2071
+ i0.ɵɵpipe(8, "translate");
2072
+ i0.ɵɵcontrolCreate();
2073
+ i0.ɵɵelementEnd();
2074
+ i0.ɵɵrepeaterCreate(9, UserGroupsSelectorComponent_For_10_Template, 2, 2, "mat-option", 3, _forTrack0);
2075
+ i0.ɵɵelementEnd()();
2076
+ i0.ɵɵelement(11, "cauca-control-field-errors", 4);
2077
+ } if (rf & 2) {
2078
+ i0.ɵɵadvance(2);
2079
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 11, ctx.label()));
2080
+ i0.ɵɵadvance(2);
2081
+ i0.ɵɵproperty("value", ctx.value())("disabled", ctx.isSelectDisabled())("required", ctx.required());
2082
+ i0.ɵɵattribute("aria-invalid", ctx.invalid())("name", ctx.name() || null);
2083
+ i0.ɵɵadvance(2);
2084
+ i0.ɵɵproperty("formControl", ctx.filterControl)("placeholderLabel", i0.ɵɵpipeBind1(7, 13, "search"))("noEntriesFoundLabel", i0.ɵɵpipeBind1(8, 15, "noResult"));
2085
+ i0.ɵɵcontrol();
2086
+ i0.ɵɵadvance(3);
2087
+ i0.ɵɵrepeater(ctx.filteredOptions());
2088
+ i0.ɵɵadvance(2);
2089
+ i0.ɵɵproperty("touched", ctx.touched())("errors", ctx.errors());
2090
+ } }, dependencies: [ControlFieldErrorsComponent,
2091
+ MatFormFieldModule, i1$2.MatFormField, i1$2.MatLabel, MatSelectModule, i2$2.MatSelect, i2$2.MatOption, NgxMatSelectSearchModule, i3$3.MatSelectSearchComponent, ReactiveFormsModule, i5.NgControlStatus, i5.FormControlDirective, TranslatePipe], styles: ["[_nghost-%COMP%]{display:block}.user-groups-selector-field[_ngcontent-%COMP%]{width:100%}"] }); }
2316
2092
  }
2093
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserGroupsSelectorComponent, [{
2094
+ type: Component,
2095
+ args: [{ selector: 'cauca-user-groups-selector', imports: [
2096
+ ControlFieldErrorsComponent,
2097
+ MatFormFieldModule,
2098
+ MatSelectModule,
2099
+ NgxMatSelectSearchModule,
2100
+ ReactiveFormsModule,
2101
+ TranslatePipe,
2102
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field class=\"user-groups-selector-field\" subscriptSizing=\"dynamic\">\n <mat-label>{{ label() | translate }}</mat-label>\n <mat-select multiple [value]=\"value()\" [disabled]=\"isSelectDisabled()\"\n [required]=\"required()\"\n [attr.aria-invalid]=\"invalid()\"\n [attr.name]=\"name() || null\"\n (valueChange)=\"onSelectionChange($event)\">\n <mat-option>\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"'search' | translate\"\n [noEntriesFoundLabel]=\"'noResult' | translate\"/>\n </mat-option>\n\n @for (option of filteredOptions(); track option.id) {\n <mat-option [value]=\"option.id\">{{ option.name }}</mat-option>\n }\n </mat-select>\n</mat-form-field>\n\n<cauca-control-field-errors [touched]=\"touched()\" [errors]=\"errors()\"/>\n", styles: [":host{display:block}.user-groups-selector-field{width:100%}\n"] }]
2103
+ }], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] }); })();
2104
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserGroupsSelectorComponent, { className: "UserGroupsSelectorComponent", filePath: "lib/components/user-groups-selector/user-groups-selector.component.ts", lineNumber: 28 }); })();
2317
2105
 
2318
2106
  /*
2319
2107
  * Public API Surface of cauca-management
@@ -2323,5 +2111,5 @@ class GroupPermissionModel {
2323
2111
  * Generated bundle index. Do not edit.
2324
2112
  */
2325
2113
 
2326
- export { AllScopeToken, CaucaManagementComponent, CaucaManagementGroupComponent, CaucaManagementModule, CaucaManagementService, CaucaManagementUserComponent, GroupEditionPageComponent, GroupModel, GroupPermissionModel, GroupsPageComponent, MANAGEMENT_ROUTE_SEGMENT, MANAGEMENT_URL_PREFIX, ManagementGroupService, ManagementUserService, REFRESHABLE_PERMISSION_STATE_TOKEN, ScopeListGridColumnComponent, UserGroupModel, UserListGridComponent, UserModel, UserPermissionModel, UserPermissionsDialogComponent, UsersPageComponent, managementGroupRoutes, provideCaucaManagement };
2114
+ export { AllScopeToken, AssignableGroupsService, EmptyUserId, GroupEditionPageComponent, GroupsPageComponent, MANAGEMENT_ROUTE_SEGMENT, MANAGEMENT_URL_PREFIX, REFRESHABLE_PERMISSION_STATE_TOKEN, ScopeListGridColumnComponent, UserEditionService, UserGroupsSelectorComponent, UserListGridComponent, UserLoginFieldsComponent, UserPermissionsDialogComponent, UserPersonalInformationFieldsComponent, UsersPageComponent, createEmptyUserForEdition, createUserLoginSchema, createUserPersonalInformationSchema, managementGroupRoutes, provideCaucaManagement };
2327
2115
  //# sourceMappingURL=cauca-911-management.mjs.map