@cauca-911/management 22.0.2 → 22.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/cauca/en-management.json +8 -0
- package/assets/i18n/cauca/es-management.json +8 -0
- package/assets/i18n/cauca/fr-management.json +8 -0
- package/fesm2022/cauca-911-management.mjs +298 -603
- package/fesm2022/cauca-911-management.mjs.map +1 -1
- package/package.json +1 -2
- package/types/cauca-911-management.d.ts +111 -197
|
@@ -1,13 +1,13 @@
|
|
|
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,
|
|
3
|
-
import { pendingChangesGuard, DialogService, PageTitleComponent, LoadingSpinnerIndicatorComponent, LoadingErrorComponent, StrokedButtonComponent, RaisedButtonComponent, ListPaginatorComponent, IconButtonComponent, LoadingStateService, GroupContainerComponent, ConfirmationResult, SavingErrorBoxComponent } 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 } 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';
|
|
7
7
|
import { MatSort } from '@angular/material/sort';
|
|
8
8
|
import { Router } from '@angular/router';
|
|
9
9
|
import ODataFilterBuilder from 'odata-filter-builder';
|
|
10
|
-
import { OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent, DataGridCommandsColumnComponent } from '@cauca-911/datagrid';
|
|
10
|
+
import { OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent, DataGridCommandsColumnComponent, DataGridComponent, BaseGridColumnComponent, DataGridMenuColumnComponent } from '@cauca-911/datagrid';
|
|
11
11
|
import { HttpClient } from '@angular/common/http';
|
|
12
12
|
import { CaucaCoreService, toLowerCaseAndWithoutDiacritics } from '@cauca-911/core';
|
|
13
13
|
import { firstValueFrom, startWith, debounceTime } from 'rxjs';
|
|
@@ -29,23 +29,13 @@ import { v4 } from 'uuid';
|
|
|
29
29
|
import * as i4$1 from '@angular/material/list';
|
|
30
30
|
import { MatListModule } from '@angular/material/list';
|
|
31
31
|
import * as i6 from '@angular/material/tooltip';
|
|
32
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
32
|
+
import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
|
|
33
33
|
import * as i3 from '@angular/material/checkbox';
|
|
34
34
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
35
35
|
import * as i2$1 from '@angular/material/menu';
|
|
36
36
|
import { MatMenuModule } from '@angular/material/menu';
|
|
37
|
-
import
|
|
38
|
-
import {
|
|
39
|
-
import * as i4$2 from 'devextreme-angular/ui/check-box';
|
|
40
|
-
import { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';
|
|
41
|
-
import * as i5$1 from 'devextreme-angular/ui/list';
|
|
42
|
-
import { DxListModule } from 'devextreme-angular/ui/list';
|
|
43
|
-
import * as i6$1 from 'devextreme-angular/ui/tag-box';
|
|
44
|
-
import { DxTagBoxModule } from 'devextreme-angular/ui/tag-box';
|
|
45
|
-
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
46
|
-
import { map } from 'rxjs/operators';
|
|
47
|
-
import * as i2$2 from 'devextreme-angular/ui/nested';
|
|
48
|
-
import * as i3$2 from 'devextreme-angular/core';
|
|
37
|
+
import { NgStyle } from '@angular/common';
|
|
38
|
+
import { MatColumnDef, MatHeaderCell, MatHeaderCellDef, MatCell, MatCellDef, MatFooterCell, MatFooterCellDef } from '@angular/material/table';
|
|
49
39
|
|
|
50
40
|
const MANAGEMENT_URL_PREFIX = new InjectionToken('MANAGEMENT_URL_PREFIX');
|
|
51
41
|
const MANAGEMENT_ROUTE_SEGMENT = new InjectionToken('MANAGEMENT_ROUTE_SEGMENT');
|
|
@@ -103,7 +93,7 @@ class GroupManagementService {
|
|
|
103
93
|
}]
|
|
104
94
|
}], null, null); })();
|
|
105
95
|
|
|
106
|
-
const _c0$
|
|
96
|
+
const _c0$4 = () => ["name"];
|
|
107
97
|
class GroupListGridComponent {
|
|
108
98
|
constructor() {
|
|
109
99
|
this.columns = computed(() => this.getColumns(), /* @ts-ignore */
|
|
@@ -161,7 +151,7 @@ class GroupListGridComponent {
|
|
|
161
151
|
i0.ɵɵlistener("deleteClick", function GroupListGridComponent_Template_cauca_data_grid_commands_column_deleteClick_6_listener($event) { return ctx.deleteGroup($event); });
|
|
162
152
|
i0.ɵɵelementEnd()();
|
|
163
153
|
} if (rf & 2) {
|
|
164
|
-
i0.ɵɵproperty("showTableOptions", true)("showAddButton", true)("addButtonLabel", i0.ɵɵpipeBind1(1, 10, "groups.addButtonLabel"))("baseSort", i0.ɵɵpureFunction0(16, _c0$
|
|
154
|
+
i0.ɵɵproperty("showTableOptions", true)("showAddButton", true)("addButtonLabel", i0.ɵɵpipeBind1(1, 10, "groups.addButtonLabel"))("baseSort", i0.ɵɵpureFunction0(16, _c0$4))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
|
|
165
155
|
i0.ɵɵadvance(2);
|
|
166
156
|
i0.ɵɵproperty("label", i0.ɵɵpipeBind1(3, 12, "groups.groupNameColumnLabel"));
|
|
167
157
|
i0.ɵɵadvance(2);
|
|
@@ -365,8 +355,8 @@ class UserSearchService {
|
|
|
365
355
|
}]
|
|
366
356
|
}], null, null); })();
|
|
367
357
|
|
|
368
|
-
const _c0$
|
|
369
|
-
const _forTrack0$
|
|
358
|
+
const _c0$3 = ["resultPaginator"];
|
|
359
|
+
const _forTrack0$4 = ($index, $item) => $item.id;
|
|
370
360
|
function GroupUserSelectionDialogComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
371
361
|
i0.ɵɵelementStart(0, "div", 8);
|
|
372
362
|
i0.ɵɵtext(1);
|
|
@@ -418,7 +408,7 @@ function GroupUserSelectionDialogComponent_Conditional_17_Template(rf, ctx) { if
|
|
|
418
408
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
419
409
|
i0.ɵɵelementStart(0, "mat-selection-list", 18);
|
|
420
410
|
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)); });
|
|
421
|
-
i0.ɵɵrepeaterCreate(1, GroupUserSelectionDialogComponent_Conditional_17_For_2_Template, 4, 6, "mat-list-option", 19, _forTrack0$
|
|
411
|
+
i0.ɵɵrepeaterCreate(1, GroupUserSelectionDialogComponent_Conditional_17_For_2_Template, 4, 6, "mat-list-option", 19, _forTrack0$4);
|
|
422
412
|
i0.ɵɵelementEnd();
|
|
423
413
|
i0.ɵɵconditionalCreate(3, GroupUserSelectionDialogComponent_Conditional_17_Conditional_3_Template, 2, 2, "cauca-list-paginator", 20);
|
|
424
414
|
} if (rf & 2) {
|
|
@@ -519,7 +509,7 @@ class GroupUserSelectionDialogComponent {
|
|
|
519
509
|
}
|
|
520
510
|
static { this.ɵfac = function GroupUserSelectionDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupUserSelectionDialogComponent)(); }; }
|
|
521
511
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupUserSelectionDialogComponent, selectors: [["cauca-group-user-selection-dialog"]], viewQuery: function GroupUserSelectionDialogComponent_Query(rf, ctx) { if (rf & 1) {
|
|
522
|
-
i0.ɵɵviewQuerySignal(ctx.paginator, _c0$
|
|
512
|
+
i0.ɵɵviewQuerySignal(ctx.paginator, _c0$3, 5);
|
|
523
513
|
} if (rf & 2) {
|
|
524
514
|
i0.ɵɵqueryAdvance();
|
|
525
515
|
} }, 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) {
|
|
@@ -608,8 +598,8 @@ class GroupUserSelectionDialogComponent {
|
|
|
608
598
|
}], () => [], { paginator: [{ type: i0.ViewChild, args: ['resultPaginator', { isSignal: true }] }] }); })();
|
|
609
599
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupUserSelectionDialogComponent, { className: "GroupUserSelectionDialogComponent", filePath: "lib/components/group-user-selection-dialog/group-user-selection-dialog.component.ts", lineNumber: 46 }); })();
|
|
610
600
|
|
|
611
|
-
const _c0$
|
|
612
|
-
const _forTrack0$
|
|
601
|
+
const _c0$2 = ["paginator"];
|
|
602
|
+
const _forTrack0$3 = ($index, $item) => $item.id;
|
|
613
603
|
function GroupUserEditionListComponent_For_10_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
614
604
|
i0.ɵɵelementStart(0, "div", 11);
|
|
615
605
|
i0.ɵɵtext(1);
|
|
@@ -744,7 +734,7 @@ class GroupUserEditionListComponent {
|
|
|
744
734
|
}
|
|
745
735
|
static { this.ɵfac = function GroupUserEditionListComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupUserEditionListComponent)(); }; }
|
|
746
736
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupUserEditionListComponent, selectors: [["cauca-group-user-edition-list"]], viewQuery: function GroupUserEditionListComponent_Query(rf, ctx) { if (rf & 1) {
|
|
747
|
-
i0.ɵɵviewQuerySignal(ctx.paginator, _c0$
|
|
737
|
+
i0.ɵɵviewQuerySignal(ctx.paginator, _c0$2, 5);
|
|
748
738
|
} if (rf & 2) {
|
|
749
739
|
i0.ɵɵqueryAdvance();
|
|
750
740
|
} }, 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) {
|
|
@@ -759,7 +749,7 @@ class GroupUserEditionListComponent {
|
|
|
759
749
|
i0.ɵɵtext(7, "search");
|
|
760
750
|
i0.ɵɵelementEnd()();
|
|
761
751
|
i0.ɵɵelementStart(8, "mat-list", 5);
|
|
762
|
-
i0.ɵɵrepeaterCreate(9, GroupUserEditionListComponent_For_10_Template, 8, 5, "mat-list-item", 6, _forTrack0$
|
|
752
|
+
i0.ɵɵrepeaterCreate(9, GroupUserEditionListComponent_For_10_Template, 8, 5, "mat-list-item", 6, _forTrack0$3, false, GroupUserEditionListComponent_ForEmpty_11_Template, 2, 1);
|
|
763
753
|
i0.ɵɵelementEnd();
|
|
764
754
|
i0.ɵɵconditionalCreate(12, GroupUserEditionListComponent_Conditional_12_Template, 2, 2, "cauca-list-paginator", 7);
|
|
765
755
|
i0.ɵɵelementStart(13, "cauca-raised-button", 8);
|
|
@@ -832,7 +822,7 @@ class PermissionManagementService {
|
|
|
832
822
|
}]
|
|
833
823
|
}], null, null); })();
|
|
834
824
|
|
|
835
|
-
const _forTrack0$
|
|
825
|
+
const _forTrack0$2 = ($index, $item) => $item.id;
|
|
836
826
|
function GroupPermissionListComponent_For_9_Template(rf, ctx) { if (rf & 1) {
|
|
837
827
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
838
828
|
i0.ɵɵelementStart(0, "mat-list-item", 4)(1, "mat-checkbox", 6);
|
|
@@ -917,7 +907,7 @@ class GroupPermissionListComponent {
|
|
|
917
907
|
i0.ɵɵtext(6, "search");
|
|
918
908
|
i0.ɵɵelementEnd()();
|
|
919
909
|
i0.ɵɵelementStart(7, "mat-selection-list", 3);
|
|
920
|
-
i0.ɵɵrepeaterCreate(8, GroupPermissionListComponent_For_9_Template, 3, 4, "mat-list-item", 4, _forTrack0$
|
|
910
|
+
i0.ɵɵrepeaterCreate(8, GroupPermissionListComponent_For_9_Template, 3, 4, "mat-list-item", 4, _forTrack0$2, false, GroupPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 5);
|
|
921
911
|
i0.ɵɵelementEnd();
|
|
922
912
|
} if (rf & 2) {
|
|
923
913
|
i0.ɵɵadvance(2);
|
|
@@ -1199,7 +1189,7 @@ var UserPermissionOriginKind;
|
|
|
1199
1189
|
UserPermissionOriginKind[UserPermissionOriginKind["UserOverride"] = 1] = "UserOverride";
|
|
1200
1190
|
})(UserPermissionOriginKind || (UserPermissionOriginKind = {}));
|
|
1201
1191
|
|
|
1202
|
-
const _forTrack0 = ($index, $item) => $item.idModulePermission;
|
|
1192
|
+
const _forTrack0$1 = ($index, $item) => $item.idModulePermission;
|
|
1203
1193
|
function UserPermissionListComponent_For_9_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1204
1194
|
i0.ɵɵtext(0, " check ");
|
|
1205
1195
|
} }
|
|
@@ -1309,7 +1299,7 @@ class UserPermissionListComponent {
|
|
|
1309
1299
|
i0.ɵɵtext(6, "search");
|
|
1310
1300
|
i0.ɵɵelementEnd()();
|
|
1311
1301
|
i0.ɵɵelementStart(7, "mat-list", 4);
|
|
1312
|
-
i0.ɵɵrepeaterCreate(8, UserPermissionListComponent_For_9_Template, 16, 11, "mat-list-item", 5, _forTrack0, false, UserPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 6);
|
|
1302
|
+
i0.ɵɵrepeaterCreate(8, UserPermissionListComponent_For_9_Template, 16, 11, "mat-list-item", 5, _forTrack0$1, false, UserPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 6);
|
|
1313
1303
|
i0.ɵɵelementEnd();
|
|
1314
1304
|
} if (rf & 2) {
|
|
1315
1305
|
i0.ɵɵadvance(2);
|
|
@@ -1394,614 +1384,319 @@ class UserPermissionsDialogComponent {
|
|
|
1394
1384
|
}], null, null); })();
|
|
1395
1385
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserPermissionsDialogComponent, { className: "UserPermissionsDialogComponent", filePath: "lib/components/user-permissions-dialog/user-permissions-dialog.component.ts", lineNumber: 31 }); })();
|
|
1396
1386
|
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1387
|
+
const _c0$1 = a0 => ({ "width": a0 });
|
|
1388
|
+
function ScopeListGridColumnComponent_th_1_Template(rf, ctx) { if (rf & 1) {
|
|
1389
|
+
i0.ɵɵelementStart(0, "th", 4);
|
|
1390
|
+
i0.ɵɵtext(1);
|
|
1391
|
+
i0.ɵɵelementEnd();
|
|
1392
|
+
} if (rf & 2) {
|
|
1393
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
1394
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c0$1, ctx_r0.width()));
|
|
1395
|
+
i0.ɵɵadvance();
|
|
1396
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.label() ?? ctx_r0.capitalize(ctx_r0.prop()), " ");
|
|
1397
|
+
} }
|
|
1398
|
+
function ScopeListGridColumnComponent_td_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
1399
|
+
i0.ɵɵelementStart(0, "span");
|
|
1400
|
+
i0.ɵɵtext(1);
|
|
1401
|
+
i0.ɵɵpipe(2, "translate");
|
|
1402
|
+
i0.ɵɵelementEnd();
|
|
1403
|
+
} if (rf & 2) {
|
|
1404
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
1405
|
+
i0.ɵɵadvance();
|
|
1406
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.allLabel()));
|
|
1407
|
+
} }
|
|
1408
|
+
function ScopeListGridColumnComponent_td_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1409
|
+
i0.ɵɵelementStart(0, "span", 6);
|
|
1410
|
+
i0.ɵɵtext(1);
|
|
1411
|
+
i0.ɵɵelementEnd();
|
|
1412
|
+
} if (rf & 2) {
|
|
1413
|
+
const row_r2 = i0.ɵɵnextContext().$implicit;
|
|
1414
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
1415
|
+
i0.ɵɵproperty("matTooltip", row_r2[ctx_r0.prop()]);
|
|
1416
|
+
i0.ɵɵadvance();
|
|
1417
|
+
i0.ɵɵtextInterpolate(row_r2[ctx_r0.prop()]);
|
|
1418
|
+
} }
|
|
1419
|
+
function ScopeListGridColumnComponent_td_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
1420
|
+
i0.ɵɵelementStart(0, "span");
|
|
1421
|
+
i0.ɵɵtext(1);
|
|
1422
|
+
i0.ɵɵelementEnd();
|
|
1423
|
+
} if (rf & 2) {
|
|
1424
|
+
const row_r2 = i0.ɵɵnextContext().$implicit;
|
|
1425
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
1426
|
+
i0.ɵɵadvance();
|
|
1427
|
+
i0.ɵɵtextInterpolate(row_r2[ctx_r0.prop()]);
|
|
1428
|
+
} }
|
|
1429
|
+
function ScopeListGridColumnComponent_td_2_Template(rf, ctx) { if (rf & 1) {
|
|
1430
|
+
i0.ɵɵelementStart(0, "td", 5);
|
|
1431
|
+
i0.ɵɵconditionalCreate(1, ScopeListGridColumnComponent_td_2_Conditional_1_Template, 3, 3, "span")(2, ScopeListGridColumnComponent_td_2_Conditional_2_Template, 2, 2, "span", 6)(3, ScopeListGridColumnComponent_td_2_Conditional_3_Template, 2, 1, "span");
|
|
1432
|
+
i0.ɵɵelementEnd();
|
|
1433
|
+
} if (rf & 2) {
|
|
1434
|
+
const row_r2 = ctx.$implicit;
|
|
1435
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
1436
|
+
i0.ɵɵadvance();
|
|
1437
|
+
i0.ɵɵconditional(row_r2[ctx_r0.prop()] === ctx_r0.allToken ? 1 : ctx_r0.showToolTip() ? 2 : 3);
|
|
1438
|
+
} }
|
|
1439
|
+
function ScopeListGridColumnComponent_td_3_Template(rf, ctx) { if (rf & 1) {
|
|
1440
|
+
i0.ɵɵelement(0, "td", 7);
|
|
1441
|
+
} }
|
|
1442
|
+
/** The value a read view emits for a scope covering everything, in place of a list of names. */
|
|
1443
|
+
const AllScopeToken = 'ALL';
|
|
1444
|
+
function resolveTable() {
|
|
1445
|
+
const odata = inject(OdataGridComponent, { optional: true });
|
|
1446
|
+
const grid = inject(DataGridComponent, { optional: true });
|
|
1447
|
+
return (grid ?? odata)?.table;
|
|
1400
1448
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1449
|
+
class ScopeListGridColumnComponent extends BaseGridColumnComponent {
|
|
1450
|
+
/**
|
|
1451
|
+
* The `providers` alias above is what makes the grid's `ContentChildren(BaseGridColumnComponent)`
|
|
1452
|
+
* match this subclass; without it the column registers nowhere and renders as an empty slot.
|
|
1453
|
+
*/
|
|
1454
|
+
constructor() {
|
|
1455
|
+
super(resolveTable());
|
|
1456
|
+
/** Translation key shown instead of the list when the row's scope covers everything. */
|
|
1457
|
+
this.allLabel = input.required(/* @ts-ignore */
|
|
1458
|
+
...(ngDevMode ? [{ debugName: "allLabel" }] : /* istanbul ignore next */ []));
|
|
1459
|
+
this.allToken = AllScopeToken;
|
|
1460
|
+
}
|
|
1461
|
+
static { this.ɵfac = function ScopeListGridColumnComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ScopeListGridColumnComponent)(); }; }
|
|
1462
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ScopeListGridColumnComponent, selectors: [["cauca-scope-list-grid-column"]], inputs: { allLabel: [1, "allLabel"] }, features: [i0.ɵɵProvidersFeature([{ provide: BaseGridColumnComponent, useExisting: forwardRef(() => ScopeListGridColumnComponent) }]), i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 2, consts: [[3, "matColumnDef"], ["mat-header-cell", "", 3, "ngStyle", 4, "matHeaderCellDef"], ["mat-cell", "", 4, "matCellDef"], ["mat-footer-cell", "", 4, "matFooterCellDef"], ["mat-header-cell", "", 3, "ngStyle"], ["mat-cell", ""], [3, "matTooltip"], ["mat-footer-cell", ""]], template: function ScopeListGridColumnComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1463
|
+
i0.ɵɵelementContainerStart(0, 0);
|
|
1464
|
+
i0.ɵɵtemplate(1, ScopeListGridColumnComponent_th_1_Template, 2, 4, "th", 1)(2, ScopeListGridColumnComponent_td_2_Template, 4, 1, "td", 2)(3, ScopeListGridColumnComponent_td_3_Template, 1, 0, "td", 3);
|
|
1465
|
+
i0.ɵɵelementContainerEnd();
|
|
1415
1466
|
} if (rf & 2) {
|
|
1416
|
-
i0.ɵɵ
|
|
1417
|
-
|
|
1418
|
-
|
|
1467
|
+
i0.ɵɵproperty("matColumnDef", i0.ɵɵinterpolate(ctx.prop()));
|
|
1468
|
+
} }, dependencies: [MatColumnDef, MatHeaderCell, MatHeaderCellDef, MatCell, MatCellDef, MatFooterCell, MatFooterCellDef,
|
|
1469
|
+
NgStyle, MatTooltip, TranslatePipe], encapsulation: 2 }); }
|
|
1419
1470
|
}
|
|
1420
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(
|
|
1471
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ScopeListGridColumnComponent, [{
|
|
1421
1472
|
type: Component,
|
|
1422
|
-
args: [{ selector: 'cauca-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
*/
|
|
1429
|
-
class ManagementGroupService {
|
|
1430
|
-
constructor() {
|
|
1431
|
-
this.http = inject(HttpClient);
|
|
1432
|
-
this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
|
|
1433
|
-
this.baseUrlToUse = this.baseUrl.endsWith('api/') ? this.baseUrl : this.baseUrl + 'api/';
|
|
1434
|
-
}
|
|
1435
|
-
getAll() {
|
|
1436
|
-
return this.http.get(`${this.baseUrlToUse}GroupManagement`);
|
|
1437
|
-
}
|
|
1438
|
-
get(idGroup) {
|
|
1439
|
-
return this.http.get(`${this.baseUrlToUse}GroupManagement/${idGroup}`);
|
|
1440
|
-
}
|
|
1441
|
-
save(group) {
|
|
1442
|
-
return this.http.post(`${this.baseUrlToUse}GroupManagement`, group);
|
|
1443
|
-
}
|
|
1444
|
-
delete(idGroup) {
|
|
1445
|
-
return this.http.delete(`${this.baseUrlToUse}GroupManagement/${idGroup}`);
|
|
1446
|
-
}
|
|
1447
|
-
hasExistingGroupName(group) {
|
|
1448
|
-
return this.http.post(`${this.baseUrlToUse}GroupManagement/GroupNameAlreadyExist`, group);
|
|
1449
|
-
}
|
|
1450
|
-
static { this.ɵfac = function ManagementGroupService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManagementGroupService)(); }; }
|
|
1451
|
-
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementGroupService, factory: ManagementGroupService.ɵfac, providedIn: 'root' }); }
|
|
1452
|
-
}
|
|
1453
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementGroupService, [{
|
|
1454
|
-
type: Injectable,
|
|
1455
|
-
args: [{
|
|
1456
|
-
providedIn: 'root'
|
|
1457
|
-
}]
|
|
1458
|
-
}], null, null); })();
|
|
1459
|
-
|
|
1460
|
-
/**
|
|
1461
|
-
* @deprecated This service is obsolete and should not be used.
|
|
1462
|
-
*/
|
|
1463
|
-
class ManagementUserService {
|
|
1464
|
-
constructor() {
|
|
1465
|
-
this.http = inject(HttpClient);
|
|
1466
|
-
this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
|
|
1467
|
-
this.baseUrlToUse = this.baseUrl.endsWith('api/') ? this.baseUrl : this.baseUrl + 'api/';
|
|
1468
|
-
}
|
|
1469
|
-
getAll() {
|
|
1470
|
-
return this.http.get(`${this.baseUrlToUse}UserManagement`);
|
|
1471
|
-
}
|
|
1472
|
-
get(idUser) {
|
|
1473
|
-
return this.http.get(`${this.baseUrlToUse}UserManagement/${idUser}`);
|
|
1474
|
-
}
|
|
1475
|
-
getGroup(idUser) {
|
|
1476
|
-
return this.http.get(`${this.baseUrlToUse}UserManagement/${idUser}/groups`);
|
|
1477
|
-
}
|
|
1478
|
-
addGroup(userGroup) {
|
|
1479
|
-
return this.http.post(`${this.baseUrlToUse}UserManagement/group`, userGroup);
|
|
1480
|
-
}
|
|
1481
|
-
deleteGroup(idUserGroup) {
|
|
1482
|
-
return this.http.delete(`${this.baseUrlToUse}UserManagement/groups/${idUserGroup}`);
|
|
1483
|
-
}
|
|
1484
|
-
addPermission(userPermission) {
|
|
1485
|
-
return this.http.post(`${this.baseUrlToUse}UserManagement/permission`, userPermission);
|
|
1486
|
-
}
|
|
1487
|
-
deletePermission(idUserPermission) {
|
|
1488
|
-
return this.http.delete(`${this.baseUrlToUse}UserManagement/groups/${idUserPermission}`);
|
|
1489
|
-
}
|
|
1490
|
-
save(user) {
|
|
1491
|
-
return this.http.post(`${this.baseUrlToUse}UserManagement`, user);
|
|
1492
|
-
}
|
|
1493
|
-
delete(idUser) {
|
|
1494
|
-
return this.http.delete(`${this.baseUrlToUse}UserManagement/${idUser}`);
|
|
1495
|
-
}
|
|
1496
|
-
hasExistingUserName(user) {
|
|
1497
|
-
return this.http.post(`${this.baseUrlToUse}UserManagement/UserNameAlreadyExist`, user);
|
|
1498
|
-
}
|
|
1499
|
-
static { this.ɵfac = function ManagementUserService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManagementUserService)(); }; }
|
|
1500
|
-
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementUserService, factory: ManagementUserService.ɵfac, providedIn: 'root' }); }
|
|
1501
|
-
}
|
|
1502
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementUserService, [{
|
|
1503
|
-
type: Injectable,
|
|
1504
|
-
args: [{
|
|
1505
|
-
providedIn: 'root'
|
|
1506
|
-
}]
|
|
1507
|
-
}], null, null); })();
|
|
1508
|
-
|
|
1509
|
-
/**
|
|
1510
|
-
* @deprecated This service is obsolete and should not be used.
|
|
1511
|
-
*/
|
|
1512
|
-
class ManagementPermissionService {
|
|
1513
|
-
constructor() {
|
|
1514
|
-
this.http = inject(HttpClient);
|
|
1515
|
-
this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
|
|
1516
|
-
this.baseUrlToUse = this.baseUrl.endsWith('api/') ? this.baseUrl : this.baseUrl + 'api/';
|
|
1517
|
-
}
|
|
1518
|
-
getAll() {
|
|
1519
|
-
return this.http.get(`${this.baseUrlToUse}PermissionManagement`);
|
|
1520
|
-
}
|
|
1521
|
-
get(idPermission) {
|
|
1522
|
-
return this.http.get(`${this.baseUrlToUse}PermissionManagement/${idPermission}`);
|
|
1523
|
-
}
|
|
1524
|
-
save(permission) {
|
|
1525
|
-
return this.http.post(`${this.baseUrlToUse}PermissionManagement`, permission);
|
|
1526
|
-
}
|
|
1527
|
-
delete(idPermission) {
|
|
1528
|
-
return this.http.delete(`${this.baseUrlToUse}PermissionManagement/${idPermission}`);
|
|
1529
|
-
}
|
|
1530
|
-
static { this.ɵfac = function ManagementPermissionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManagementPermissionService)(); }; }
|
|
1531
|
-
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ManagementPermissionService, factory: ManagementPermissionService.ɵfac, providedIn: 'root' }); }
|
|
1532
|
-
}
|
|
1533
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManagementPermissionService, [{
|
|
1534
|
-
type: Injectable,
|
|
1535
|
-
args: [{
|
|
1536
|
-
providedIn: 'root'
|
|
1537
|
-
}]
|
|
1538
|
-
}], null, null); })();
|
|
1473
|
+
args: [{ selector: 'cauca-scope-list-grid-column', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: BaseGridColumnComponent, useExisting: forwardRef(() => ScopeListGridColumnComponent) }], imports: [
|
|
1474
|
+
MatColumnDef, MatHeaderCell, MatHeaderCellDef, MatCell, MatCellDef, MatFooterCell, MatFooterCellDef,
|
|
1475
|
+
NgStyle, MatTooltip, TranslatePipe,
|
|
1476
|
+
], template: "<ng-container matColumnDef=\"{{ prop() }}\">\n\n <th mat-header-cell *matHeaderCellDef [ngStyle]=\"{'width': width()}\">\n {{ label() ?? capitalize(prop()) }}\n </th>\n\n <td mat-cell *matCellDef=\"let row\">\n @if (row[prop()] === allToken) {\n <span>{{ allLabel() | translate }}</span>\n } @else if (showToolTip()) {\n <span [matTooltip]=\"row[prop()]\">{{ row[prop()] }}</span>\n } @else {\n <span>{{ row[prop()] }}</span>\n }\n </td>\n\n <td mat-footer-cell *matFooterCellDef></td>\n\n</ng-container>\n" }]
|
|
1477
|
+
}], () => [], { allLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "allLabel", required: true }] }] }); })();
|
|
1478
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ScopeListGridColumnComponent, { className: "ScopeListGridColumnComponent", filePath: "lib/components/scope-list-grid-column/scope-list-grid-column.component.ts", lineNumber: 28 }); })();
|
|
1539
1479
|
|
|
1540
|
-
const _c0 = () => ["
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
i0.ɵɵ
|
|
1544
|
-
i0.ɵɵ
|
|
1545
|
-
i0.ɵɵelementEnd()();
|
|
1480
|
+
const _c0 = () => ["userName"];
|
|
1481
|
+
const _forTrack0 = ($index, $item) => $item.prop;
|
|
1482
|
+
function UserListGridComponent_For_9_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
1483
|
+
i0.ɵɵelement(0, "cauca-scope-list-grid-column", 6);
|
|
1484
|
+
i0.ɵɵpipe(1, "translate");
|
|
1546
1485
|
} if (rf & 2) {
|
|
1547
|
-
const
|
|
1548
|
-
i0.ɵɵ
|
|
1549
|
-
i0.ɵɵproperty("displayExpr", ctx_r2.fullName)("dataSource", ctx_r2.users)("searchEnabled", true)("searchExpr", ctx_r2.fullName);
|
|
1486
|
+
const column_r1 = i0.ɵɵnextContext().$implicit;
|
|
1487
|
+
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));
|
|
1550
1488
|
} }
|
|
1551
|
-
function
|
|
1489
|
+
function UserListGridComponent_For_9_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
1490
|
+
i0.ɵɵelement(0, "cauca-sortable-data-grid-check-column", 7);
|
|
1491
|
+
i0.ɵɵpipe(1, "translate");
|
|
1492
|
+
} if (rf & 2) {
|
|
1493
|
+
const column_r1 = i0.ɵɵnextContext().$implicit;
|
|
1494
|
+
i0.ɵɵproperty("id", column_r1.prop)("prop", column_r1.prop)("width", column_r1.width ?? "")("label", i0.ɵɵpipeBind1(1, 4, column_r1.label));
|
|
1495
|
+
} }
|
|
1496
|
+
function UserListGridComponent_For_9_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
1497
|
+
i0.ɵɵelement(0, "cauca-sortable-data-grid-column", 8);
|
|
1498
|
+
i0.ɵɵpipe(1, "translate");
|
|
1499
|
+
} if (rf & 2) {
|
|
1500
|
+
const column_r1 = i0.ɵɵnextContext().$implicit;
|
|
1501
|
+
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));
|
|
1502
|
+
} }
|
|
1503
|
+
function UserListGridComponent_For_9_Template(rf, ctx) { if (rf & 1) {
|
|
1504
|
+
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);
|
|
1505
|
+
} if (rf & 2) {
|
|
1506
|
+
let tmp_10_0;
|
|
1507
|
+
const column_r1 = ctx.$implicit;
|
|
1508
|
+
i0.ɵɵconditional((tmp_10_0 = column_r1.kind) === "scope" ? 0 : tmp_10_0 === "check" ? 1 : 2);
|
|
1509
|
+
} }
|
|
1510
|
+
function UserListGridComponent_Conditional_10_ng_template_1_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
1552
1511
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
1553
|
-
i0.ɵɵelementStart(0, "
|
|
1554
|
-
i0.ɵɵlistener("
|
|
1555
|
-
i0.ɵɵelementEnd()
|
|
1512
|
+
i0.ɵɵelementStart(0, "cauca-menu-item", 11);
|
|
1513
|
+
i0.ɵɵlistener("buttonClick", function UserListGridComponent_Conditional_10_ng_template_1_Conditional_0_Template_cauca_menu_item_buttonClick_0_listener() { i0.ɵɵrestoreView(_r4); const row_r5 = i0.ɵɵnextContext().row; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.openPermissions(row_r5)); });
|
|
1514
|
+
i0.ɵɵelementEnd();
|
|
1556
1515
|
} if (rf & 2) {
|
|
1557
|
-
|
|
1558
|
-
i0.ɵɵadvance();
|
|
1559
|
-
i0.ɵɵproperty("text", permission_r5.name);
|
|
1516
|
+
i0.ɵɵproperty("translateLabel", true);
|
|
1560
1517
|
} }
|
|
1561
|
-
function
|
|
1562
|
-
i0.ɵɵ
|
|
1563
|
-
|
|
1564
|
-
i0.ɵɵ
|
|
1518
|
+
function UserListGridComponent_Conditional_10_ng_template_1_Template(rf, ctx) { if (rf & 1) {
|
|
1519
|
+
i0.ɵɵconditionalCreate(0, UserListGridComponent_Conditional_10_ng_template_1_Conditional_0_Template, 1, 1, "cauca-menu-item", 10);
|
|
1520
|
+
} if (rf & 2) {
|
|
1521
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
1522
|
+
i0.ɵɵconditional(ctx_r2.showPermissions() ? 0 : -1);
|
|
1523
|
+
} }
|
|
1524
|
+
function UserListGridComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
1525
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
1526
|
+
i0.ɵɵelementStart(0, "cauca-data-grid-menu-column", 9);
|
|
1527
|
+
i0.ɵɵlistener("deleteClick", function UserListGridComponent_Conditional_10_Template_cauca_data_grid_menu_column_deleteClick_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onDelete($event)); });
|
|
1528
|
+
i0.ɵɵtemplate(1, UserListGridComponent_Conditional_10_ng_template_1_Template, 1, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
1529
|
+
i0.ɵɵelementEnd();
|
|
1565
1530
|
} if (rf & 2) {
|
|
1566
1531
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1567
|
-
i0.ɵɵ
|
|
1568
|
-
i0.ɵɵproperty("dataSource", ctx_r2.permissions)("searchEnabled", true)("searchExpr", i0.ɵɵpureFunction0(5, _c0))("hoverStateEnabled", ctx_r2.hoverStatePermission());
|
|
1569
|
-
i0.ɵɵadvance();
|
|
1570
|
-
i0.ɵɵproperty("dxTemplateOf", "rowTemplate");
|
|
1532
|
+
i0.ɵɵproperty("canEdit", ctx_r2.canEdit())("canDelete", ctx_r2.canDelete())("editLinkField", ctx_r2.editLinkField());
|
|
1571
1533
|
} }
|
|
1572
|
-
/**
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
class
|
|
1534
|
+
/** The intersection of every site's feed, from `UserListItem` in `Cause.SecurityManagement`. */
|
|
1535
|
+
const SharedColumns = ['userName', 'firstName', 'lastName'];
|
|
1536
|
+
const SharedSearchedColumns = ['searchableUserName', 'searchableFirstName', 'searchableLastName'];
|
|
1537
|
+
class UserListGridComponent {
|
|
1576
1538
|
constructor() {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
this.
|
|
1586
|
-
|
|
1587
|
-
this.
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
this.
|
|
1591
|
-
|
|
1592
|
-
this.
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1539
|
+
/**
|
|
1540
|
+
* Read when the grid registers its columns, in `ngAfterContentInit`. Changing it afterwards
|
|
1541
|
+
* recomputes `columns()` but does not re-run `applyColumns()`, so the MatTable is asked to
|
|
1542
|
+
* render a column id it never registered and throws `Could not find column with id "X"`.
|
|
1543
|
+
* `showPermissions`, `canEdit` and `canDelete` gate the row-action column the same way and
|
|
1544
|
+
* carry the same constraint — and are the more likely one to hit, since a consumer binds them
|
|
1545
|
+
* to an async permission signal more readily than it replaces the column list.
|
|
1546
|
+
*/
|
|
1547
|
+
this.extraColumns = input([], /* @ts-ignore */
|
|
1548
|
+
...(ngDevMode ? [{ debugName: "extraColumns" }] : /* istanbul ignore next */ []));
|
|
1549
|
+
this.showAddButton = input(false, /* @ts-ignore */
|
|
1550
|
+
...(ngDevMode ? [{ debugName: "showAddButton" }] : /* istanbul ignore next */ []));
|
|
1551
|
+
/** Translation key. */
|
|
1552
|
+
this.addButtonLabel = input('', /* @ts-ignore */
|
|
1553
|
+
...(ngDevMode ? [{ debugName: "addButtonLabel" }] : /* istanbul ignore next */ []));
|
|
1554
|
+
this.canEdit = input(false, /* @ts-ignore */
|
|
1555
|
+
...(ngDevMode ? [{ debugName: "canEdit" }] : /* istanbul ignore next */ []));
|
|
1556
|
+
this.canDelete = input(false, /* @ts-ignore */
|
|
1557
|
+
...(ngDevMode ? [{ debugName: "canDelete" }] : /* istanbul ignore next */ []));
|
|
1558
|
+
this.editLinkField = input('id', /* @ts-ignore */
|
|
1559
|
+
...(ngDevMode ? [{ debugName: "editLinkField" }] : /* istanbul ignore next */ []));
|
|
1560
|
+
this.showPermissions = input(false, /* @ts-ignore */
|
|
1561
|
+
...(ngDevMode ? [{ debugName: "showPermissions" }] : /* istanbul ignore next */ []));
|
|
1562
|
+
this.persistState = input(true, /* @ts-ignore */
|
|
1563
|
+
...(ngDevMode ? [{ debugName: "persistState" }] : /* istanbul ignore next */ []));
|
|
1564
|
+
this.addClick = output();
|
|
1565
|
+
this.deleteClick = output();
|
|
1566
|
+
this.hasRowActions = computed(() => this.showPermissions() || this.canEdit() || this.canDelete(), /* @ts-ignore */
|
|
1567
|
+
...(ngDevMode ? [{ debugName: "hasRowActions" }] : /* istanbul ignore next */ []));
|
|
1568
|
+
this.columns = computed(() => [
|
|
1569
|
+
...SharedColumns,
|
|
1570
|
+
...this.extraColumns().map(column => column.prop),
|
|
1571
|
+
...(this.hasRowActions() ? ['menu'] : []),
|
|
1572
|
+
], /* @ts-ignore */
|
|
1573
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1574
|
+
this.grid = viewChild.required(OdataGridComponent, /* @ts-ignore */
|
|
1575
|
+
...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
1576
|
+
this.sort = viewChild.required(MatSort, /* @ts-ignore */
|
|
1577
|
+
...(ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []));
|
|
1578
|
+
this.dialog = inject(DialogService);
|
|
1579
|
+
this.filterPredicate = (filter) => {
|
|
1580
|
+
const searched = [
|
|
1581
|
+
...SharedSearchedColumns,
|
|
1582
|
+
...this.extraColumns()
|
|
1583
|
+
.map(column => column.searchableProp)
|
|
1584
|
+
.filter((prop) => !!prop),
|
|
1585
|
+
];
|
|
1586
|
+
const computedFilter = filter
|
|
1587
|
+
? searched.reduce((builder, column) => builder.contains(column, filter), ODataFilterBuilder('or'))
|
|
1588
|
+
: ODataFilterBuilder();
|
|
1589
|
+
return [{ getFilter: () => [computedFilter.toString()] }];
|
|
1604
1590
|
};
|
|
1605
|
-
this.groupNameAlreadyUsedValidation = (e) => this.managementGroupService.hasExistingGroupName(e.data).pipe(map((exist) => !exist)).toPromise();
|
|
1606
|
-
const breakpointObserver = inject(BreakpointObserver);
|
|
1607
|
-
breakpointObserver.observe(['(max-width: 1000px)']).subscribe((result) => {
|
|
1608
|
-
this.showColumn = !result.matches;
|
|
1609
|
-
});
|
|
1610
|
-
breakpointObserver.observe(['(max-width: 600px)']).subscribe((result) => {
|
|
1611
|
-
this.showColumnXS = !result.matches;
|
|
1612
|
-
});
|
|
1613
1591
|
}
|
|
1614
1592
|
ngOnInit() {
|
|
1615
|
-
this.
|
|
1616
|
-
this.users = data;
|
|
1617
|
-
this.users.forEach((user) => {
|
|
1618
|
-
if (user.isActive) {
|
|
1619
|
-
if (user.firstName !== '' && user.lastName !== '') {
|
|
1620
|
-
this.userFullName[user.id] = `${user.firstName} ${user.lastName}`;
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
});
|
|
1624
|
-
});
|
|
1625
|
-
this.managementPermissionService.getAll().subscribe((permissions) => {
|
|
1626
|
-
const permissionIndex = permissions.findIndex((c) => c.tag === 'CanAccessPermissions');
|
|
1627
|
-
if (permissionIndex !== -1) {
|
|
1628
|
-
permissions.splice(permissionIndex, 1);
|
|
1629
|
-
}
|
|
1630
|
-
permissions.sort((a, b) => {
|
|
1631
|
-
if (a.name < b.name) {
|
|
1632
|
-
return -1;
|
|
1633
|
-
}
|
|
1634
|
-
if (a.name > b.name) {
|
|
1635
|
-
return 1;
|
|
1636
|
-
}
|
|
1637
|
-
return 0;
|
|
1638
|
-
});
|
|
1639
|
-
this.permissions = permissions;
|
|
1640
|
-
});
|
|
1641
|
-
this.getGroups();
|
|
1642
|
-
}
|
|
1643
|
-
fullName(data) {
|
|
1644
|
-
if (!data) {
|
|
1645
|
-
return '';
|
|
1646
|
-
}
|
|
1647
|
-
return `${data.firstName} ${data.lastName}`;
|
|
1648
|
-
}
|
|
1649
|
-
getGroupUser(field, e) {
|
|
1650
|
-
const users = [];
|
|
1651
|
-
if (this.groupUsers) {
|
|
1652
|
-
this.groupUsers.forEach((user) => {
|
|
1653
|
-
users.push(user.idUser);
|
|
1654
|
-
});
|
|
1655
|
-
}
|
|
1656
|
-
e.component.option('value', users);
|
|
1657
|
-
}
|
|
1658
|
-
setGroupUser(field, e) {
|
|
1659
|
-
const groupUser = [];
|
|
1660
|
-
e.value.forEach((idUser) => {
|
|
1661
|
-
const groupIndex = (field.data.users || []).findIndex((g) => g.idUser === idUser);
|
|
1662
|
-
if (groupIndex === -1) {
|
|
1663
|
-
groupUser.push({ idUser, });
|
|
1664
|
-
}
|
|
1665
|
-
else {
|
|
1666
|
-
groupUser.push(field.data.users[groupIndex]);
|
|
1667
|
-
}
|
|
1668
|
-
});
|
|
1669
|
-
field.setValue(JSON.parse(JSON.stringify(groupUser)));
|
|
1670
|
-
}
|
|
1671
|
-
setGroupPermission(field, e) {
|
|
1672
|
-
const groupUser = [];
|
|
1673
|
-
e.value.forEach((idUser) => {
|
|
1674
|
-
groupUser.push({
|
|
1675
|
-
idUser,
|
|
1676
|
-
});
|
|
1677
|
-
});
|
|
1678
|
-
field.setValue(JSON.parse(JSON.stringify(groupUser)));
|
|
1679
|
-
}
|
|
1680
|
-
getPermissionStatus(field, permission, e) {
|
|
1681
|
-
const groupPermission = (field.value || []).find((p) => p.idModulePermission === permission.id);
|
|
1682
|
-
if (groupPermission) {
|
|
1683
|
-
e.component.option('value', groupPermission.isAllowed);
|
|
1684
|
-
}
|
|
1685
|
-
else {
|
|
1686
|
-
e.component.option('value', undefined);
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
checkBoxToggled(field, permission, e) {
|
|
1690
|
-
if (e.component.skipOnValueChanged) {
|
|
1691
|
-
e.component.skipOnValueChanged = false;
|
|
1692
|
-
return;
|
|
1693
|
-
}
|
|
1694
|
-
if (e.component.setUndefinedNextTime) {
|
|
1695
|
-
e.component.setUndefinedNextTime = false;
|
|
1696
|
-
e.component.skipOnValueChanged = true;
|
|
1697
|
-
e.component.option('value', undefined);
|
|
1698
|
-
this.setPermissionStatus(field, permission, undefined);
|
|
1699
|
-
return;
|
|
1700
|
-
}
|
|
1701
|
-
if (e.value === false) {
|
|
1702
|
-
e.component.setUndefinedNextTime = true;
|
|
1703
|
-
}
|
|
1704
|
-
this.setPermissionStatus(field, permission, e.value);
|
|
1705
|
-
}
|
|
1706
|
-
onRowInserted(e) {
|
|
1707
|
-
this.saveGroup(e.data);
|
|
1708
|
-
}
|
|
1709
|
-
onRowUpdated(e) {
|
|
1710
|
-
this.saveGroup(e.data);
|
|
1711
|
-
}
|
|
1712
|
-
onRowRemoved(e) {
|
|
1713
|
-
const group = e.data;
|
|
1714
|
-
this.managementGroupService.delete(group.id).subscribe(() => {
|
|
1715
|
-
this.getGroups();
|
|
1716
|
-
});
|
|
1593
|
+
this.grid().setUpSort(this.sort());
|
|
1717
1594
|
}
|
|
1718
|
-
|
|
1719
|
-
this.
|
|
1595
|
+
refresh() {
|
|
1596
|
+
this.grid().refreshData();
|
|
1720
1597
|
}
|
|
1721
|
-
|
|
1722
|
-
this.
|
|
1598
|
+
async openPermissions(row) {
|
|
1599
|
+
await this.dialog.showCustomDialog(UserPermissionsDialogComponent, { userId: row.id, userDisplayName: `${row.firstName} ${row.lastName}` }, { width: '600px' });
|
|
1723
1600
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
const groupIndex = groupPermissions.findIndex((p) => p.idModulePermission === permission.id);
|
|
1727
|
-
if (groupIndex > -1) {
|
|
1728
|
-
groupPermissions[groupIndex].isAllowed = value;
|
|
1729
|
-
}
|
|
1730
|
-
else {
|
|
1731
|
-
groupPermissions.push({
|
|
1732
|
-
idModulePermission: permission.id,
|
|
1733
|
-
isAllowed: value,
|
|
1734
|
-
});
|
|
1735
|
-
}
|
|
1736
|
-
field.setValue(JSON.parse(JSON.stringify(groupPermissions)));
|
|
1737
|
-
}
|
|
1738
|
-
saveGroup(group) {
|
|
1739
|
-
this.removePermissionUndefined(group);
|
|
1740
|
-
if (group.users) {
|
|
1741
|
-
group.users.forEach((userGroup) => {
|
|
1742
|
-
userGroup.idGroup = group.id;
|
|
1743
|
-
});
|
|
1744
|
-
}
|
|
1745
|
-
if (group.permissions) {
|
|
1746
|
-
group.permissions.forEach((groupPermission) => {
|
|
1747
|
-
groupPermission.idGroup = group.id;
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
this.managementGroupService.save(group).subscribe(() => {
|
|
1751
|
-
this.getGroups();
|
|
1752
|
-
});
|
|
1753
|
-
this.groupUsers = [];
|
|
1754
|
-
}
|
|
1755
|
-
removePermissionUndefined(group) {
|
|
1756
|
-
group.permissions = group.permissions.filter((permission) => permission.isAllowed !== undefined);
|
|
1757
|
-
}
|
|
1758
|
-
getGroups() {
|
|
1759
|
-
this.managementGroupService.getAll().subscribe((data) => this.groups = data);
|
|
1601
|
+
onDelete(row) {
|
|
1602
|
+
this.deleteClick.emit(row);
|
|
1760
1603
|
}
|
|
1761
|
-
static { this.ɵfac = function
|
|
1762
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
1763
|
-
i0.ɵɵ
|
|
1764
|
-
|
|
1765
|
-
i0.ɵɵ
|
|
1766
|
-
|
|
1767
|
-
i0.ɵɵ
|
|
1768
|
-
i0.ɵɵpipe(
|
|
1769
|
-
i0.ɵɵ
|
|
1770
|
-
i0.ɵɵelement(
|
|
1771
|
-
i0.ɵɵpipe(
|
|
1772
|
-
i0.ɵɵelement(
|
|
1773
|
-
i0.ɵɵpipe(
|
|
1774
|
-
i0.ɵɵelement(
|
|
1775
|
-
i0.ɵɵpipe(
|
|
1776
|
-
i0.ɵɵ
|
|
1777
|
-
i0.ɵɵ
|
|
1778
|
-
i0.ɵɵelement(13, "dxo-popup", 8);
|
|
1779
|
-
i0.ɵɵpipe(14, "translate");
|
|
1780
|
-
i0.ɵɵelementStart(15, "dxo-form", 9);
|
|
1781
|
-
i0.ɵɵelement(16, "dxi-item", 10)(17, "dxi-item", 11)(18, "dxi-item", 12)(19, "dxi-item", 13);
|
|
1782
|
-
i0.ɵɵelementEnd()();
|
|
1783
|
-
i0.ɵɵtemplate(20, CaucaManagementGroupComponent_div_20_Template, 2, 4, "div", 14)(21, CaucaManagementGroupComponent_div_21_Template, 3, 6, "div", 14);
|
|
1604
|
+
static { this.ɵfac = function UserListGridComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserListGridComponent)(); }; }
|
|
1605
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserListGridComponent, selectors: [["cauca-user-list-grid"]], viewQuery: function UserListGridComponent_Query(rf, ctx) { if (rf & 1) {
|
|
1606
|
+
i0.ɵɵviewQuerySignal(ctx.grid, OdataGridComponent, 5)(ctx.sort, MatSort, 5);
|
|
1607
|
+
} if (rf & 2) {
|
|
1608
|
+
i0.ɵɵqueryAdvance(2);
|
|
1609
|
+
} }, 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", "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) {
|
|
1610
|
+
i0.ɵɵelementStart(0, "cauca-odata-grid", 1);
|
|
1611
|
+
i0.ɵɵpipe(1, "translate");
|
|
1612
|
+
i0.ɵɵlistener("addButtonClick", function UserListGridComponent_Template_cauca_odata_grid_addButtonClick_0_listener() { return ctx.addClick.emit(); });
|
|
1613
|
+
i0.ɵɵelement(2, "cauca-sortable-data-grid-column", 2);
|
|
1614
|
+
i0.ɵɵpipe(3, "translate");
|
|
1615
|
+
i0.ɵɵelement(4, "cauca-sortable-data-grid-column", 3);
|
|
1616
|
+
i0.ɵɵpipe(5, "translate");
|
|
1617
|
+
i0.ɵɵelement(6, "cauca-sortable-data-grid-column", 4);
|
|
1618
|
+
i0.ɵɵpipe(7, "translate");
|
|
1619
|
+
i0.ɵɵrepeaterCreate(8, UserListGridComponent_For_9_Template, 3, 1, null, null, _forTrack0);
|
|
1620
|
+
i0.ɵɵconditionalCreate(10, UserListGridComponent_Conditional_10_Template, 3, 3, "cauca-data-grid-menu-column", 5);
|
|
1784
1621
|
i0.ɵɵelementEnd();
|
|
1785
1622
|
} if (rf & 2) {
|
|
1786
|
-
i0.ɵɵproperty("
|
|
1787
|
-
i0.ɵɵadvance();
|
|
1788
|
-
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(2, 24, "management.name"));
|
|
1789
|
-
i0.ɵɵadvance(2);
|
|
1790
|
-
i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 26, "management.groupNameAlreadyUsed"))("validationCallback", ctx.groupNameAlreadyUsedValidation);
|
|
1623
|
+
i0.ɵɵproperty("persistState", ctx.persistState())("showTableOptions", true)("showRefreshButton", true)("showAddButton", ctx.showAddButton())("addButtonLabel", i0.ɵɵpipeBind1(1, 15, ctx.addButtonLabel()))("baseSort", i0.ɵɵpureFunction0(23, _c0))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
|
|
1791
1624
|
i0.ɵɵadvance(2);
|
|
1792
|
-
i0.ɵɵproperty("
|
|
1625
|
+
i0.ɵɵproperty("showToolTip", true)("label", i0.ɵɵpipeBind1(3, 17, "userList.column.userName"));
|
|
1793
1626
|
i0.ɵɵadvance(2);
|
|
1794
|
-
i0.ɵɵproperty("
|
|
1627
|
+
i0.ɵɵproperty("showToolTip", true)("label", i0.ɵɵpipeBind1(5, 19, "userList.column.firstName"));
|
|
1795
1628
|
i0.ɵɵadvance(2);
|
|
1796
|
-
i0.ɵɵproperty("
|
|
1629
|
+
i0.ɵɵproperty("showToolTip", true)("label", i0.ɵɵpipeBind1(7, 21, "userList.column.lastName"));
|
|
1797
1630
|
i0.ɵɵadvance(2);
|
|
1798
|
-
i0.ɵɵ
|
|
1799
|
-
i0.ɵɵadvance();
|
|
1800
|
-
i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
|
|
1801
|
-
i0.ɵɵadvance();
|
|
1802
|
-
i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(14, 34, "management.group"))("fullScreen", !ctx.showColumn);
|
|
1631
|
+
i0.ɵɵrepeater(ctx.extraColumns());
|
|
1803
1632
|
i0.ɵɵadvance(2);
|
|
1804
|
-
i0.ɵɵ
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
i0.ɵɵadvance(3);
|
|
1808
|
-
i0.ɵɵproperty("visible", ctx.showAssignableByAllUsers());
|
|
1809
|
-
i0.ɵɵadvance();
|
|
1810
|
-
i0.ɵɵproperty("dxTemplateOf", "usersEditTemplate");
|
|
1811
|
-
i0.ɵɵadvance();
|
|
1812
|
-
i0.ɵɵproperty("dxTemplateOf", "permissionsEditTemplate");
|
|
1813
|
-
} }, 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 }); }
|
|
1633
|
+
i0.ɵɵconditional(ctx.hasRowActions() ? 10 : -1);
|
|
1634
|
+
} }, dependencies: [MatSort, OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent,
|
|
1635
|
+
ScopeListGridColumnComponent, DataGridMenuColumnComponent, MenuItemComponent, TranslatePipe], encapsulation: 2 }); }
|
|
1814
1636
|
}
|
|
1815
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(
|
|
1637
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserListGridComponent, [{
|
|
1816
1638
|
type: Component,
|
|
1817
|
-
args: [{ selector: 'cauca-
|
|
1818
|
-
|
|
1819
|
-
|
|
1639
|
+
args: [{ selector: 'cauca-user-list-grid', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1640
|
+
MatSort, OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent,
|
|
1641
|
+
ScopeListGridColumnComponent, DataGridMenuColumnComponent, MenuItemComponent, TranslatePipe,
|
|
1642
|
+
], 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 [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" }]
|
|
1643
|
+
}], 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 }] }] }); })();
|
|
1644
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserListGridComponent, { className: "UserListGridComponent", filePath: "lib/components/user-list-grid/user-list-grid.component.ts", lineNumber: 27 }); })();
|
|
1820
1645
|
|
|
1821
|
-
|
|
1822
|
-
* @deprecated This model is obsolete and should not be used.
|
|
1823
|
-
*/
|
|
1824
|
-
class UserModel {
|
|
1646
|
+
class UsersPageComponent {
|
|
1825
1647
|
constructor() {
|
|
1826
|
-
|
|
1827
|
-
this.
|
|
1828
|
-
|
|
1829
|
-
this.
|
|
1830
|
-
|
|
1831
|
-
this.
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
*/
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
this.
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
this.
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
}
|
|
1867
|
-
saveGroup(user) {
|
|
1868
|
-
this.managementUserService.save(user).subscribe(() => {
|
|
1869
|
-
this.getUsers();
|
|
1870
|
-
});
|
|
1871
|
-
}
|
|
1872
|
-
getUsers() {
|
|
1873
|
-
this.managementUserService.getAll().subscribe((data) => this.users = data);
|
|
1874
|
-
}
|
|
1875
|
-
static { this.ɵfac = function CaucaManagementUserComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementUserComponent)(); }; }
|
|
1876
|
-
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) {
|
|
1877
|
-
i0.ɵɵelementStart(0, "cauca-dx-data-grid", 0);
|
|
1878
|
-
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); });
|
|
1879
|
-
i0.ɵɵelementStart(1, "dxi-column", 1);
|
|
1880
|
-
i0.ɵɵpipe(2, "translate");
|
|
1881
|
-
i0.ɵɵelement(3, "dxi-validation-rule", 2);
|
|
1882
|
-
i0.ɵɵpipe(4, "translate");
|
|
1883
|
-
i0.ɵɵelementEnd();
|
|
1884
|
-
i0.ɵɵelement(5, "dxi-column", 3);
|
|
1885
|
-
i0.ɵɵpipe(6, "translate");
|
|
1886
|
-
i0.ɵɵelement(7, "dxi-column", 4);
|
|
1887
|
-
i0.ɵɵpipe(8, "translate");
|
|
1888
|
-
i0.ɵɵelement(9, "dxi-column", 5);
|
|
1889
|
-
i0.ɵɵpipe(10, "translate");
|
|
1890
|
-
i0.ɵɵelement(11, "dxi-column", 6);
|
|
1891
|
-
i0.ɵɵpipe(12, "translate");
|
|
1892
|
-
i0.ɵɵelementStart(13, "dxo-editing", 7);
|
|
1893
|
-
i0.ɵɵelement(14, "dxo-popup", 8);
|
|
1894
|
-
i0.ɵɵpipe(15, "translate");
|
|
1895
|
-
i0.ɵɵelementStart(16, "dxo-form", 9);
|
|
1896
|
-
i0.ɵɵelement(17, "dxi-item", 10)(18, "dxi-item", 11)(19, "dxi-item", 12)(20, "dxi-item", 13)(21, "dxi-item", 14);
|
|
1648
|
+
/** Translation keys. Every site names its users page and its menu differently. */
|
|
1649
|
+
this.caption = input('management.users', /* @ts-ignore */
|
|
1650
|
+
...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
1651
|
+
this.baseCrumb = input('menu.management', /* @ts-ignore */
|
|
1652
|
+
...(ngDevMode ? [{ debugName: "baseCrumb" }] : /* istanbul ignore next */ []));
|
|
1653
|
+
this.breadcrumb = input('management.users', /* @ts-ignore */
|
|
1654
|
+
...(ngDevMode ? [{ debugName: "breadcrumb" }] : /* istanbul ignore next */ []));
|
|
1655
|
+
this.extraColumns = input([], /* @ts-ignore */
|
|
1656
|
+
...(ngDevMode ? [{ debugName: "extraColumns" }] : /* istanbul ignore next */ []));
|
|
1657
|
+
this.showAddButton = input(false, /* @ts-ignore */
|
|
1658
|
+
...(ngDevMode ? [{ debugName: "showAddButton" }] : /* istanbul ignore next */ []));
|
|
1659
|
+
this.addButtonLabel = input('', /* @ts-ignore */
|
|
1660
|
+
...(ngDevMode ? [{ debugName: "addButtonLabel" }] : /* istanbul ignore next */ []));
|
|
1661
|
+
this.canEdit = input(false, /* @ts-ignore */
|
|
1662
|
+
...(ngDevMode ? [{ debugName: "canEdit" }] : /* istanbul ignore next */ []));
|
|
1663
|
+
this.canDelete = input(false, /* @ts-ignore */
|
|
1664
|
+
...(ngDevMode ? [{ debugName: "canDelete" }] : /* istanbul ignore next */ []));
|
|
1665
|
+
this.editLinkField = input('id', /* @ts-ignore */
|
|
1666
|
+
...(ngDevMode ? [{ debugName: "editLinkField" }] : /* istanbul ignore next */ []));
|
|
1667
|
+
this.showPermissions = input(false, /* @ts-ignore */
|
|
1668
|
+
...(ngDevMode ? [{ debugName: "showPermissions" }] : /* istanbul ignore next */ []));
|
|
1669
|
+
this.persistState = input(true, /* @ts-ignore */
|
|
1670
|
+
...(ngDevMode ? [{ debugName: "persistState" }] : /* istanbul ignore next */ []));
|
|
1671
|
+
this.addClick = output();
|
|
1672
|
+
this.deleteClick = output();
|
|
1673
|
+
this.grid = viewChild.required(UserListGridComponent, /* @ts-ignore */
|
|
1674
|
+
...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
1675
|
+
}
|
|
1676
|
+
refresh() {
|
|
1677
|
+
this.grid().refresh();
|
|
1678
|
+
}
|
|
1679
|
+
static { this.ɵfac = function UsersPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UsersPageComponent)(); }; }
|
|
1680
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UsersPageComponent, selectors: [["cauca-users-page"]], viewQuery: function UsersPageComponent_Query(rf, ctx) { if (rf & 1) {
|
|
1681
|
+
i0.ɵɵviewQuerySignal(ctx.grid, UserListGridComponent, 5);
|
|
1682
|
+
} if (rf & 2) {
|
|
1683
|
+
i0.ɵɵqueryAdvance();
|
|
1684
|
+
} }, inputs: { caption: [1, "caption"], baseCrumb: [1, "baseCrumb"], breadcrumb: [1, "breadcrumb"], 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: 4, vars: 12, consts: [[3, "showBreadcrumb", "caption", "baseCrumb", "breadcrumb"], [1, "page-content"], [1, "page-content-grid"], [3, "addClick", "deleteClick", "extraColumns", "showAddButton", "addButtonLabel", "canEdit", "canDelete", "editLinkField", "showPermissions", "persistState"]], template: function UsersPageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1685
|
+
i0.ɵɵelement(0, "cauca-page-title", 0);
|
|
1686
|
+
i0.ɵɵelementStart(1, "mat-card", 1)(2, "mat-card-content", 2)(3, "cauca-user-list-grid", 3);
|
|
1687
|
+
i0.ɵɵlistener("addClick", function UsersPageComponent_Template_cauca_user_list_grid_addClick_3_listener() { return ctx.addClick.emit(); })("deleteClick", function UsersPageComponent_Template_cauca_user_list_grid_deleteClick_3_listener($event) { return ctx.deleteClick.emit($event); });
|
|
1897
1688
|
i0.ɵɵelementEnd()()();
|
|
1898
1689
|
} if (rf & 2) {
|
|
1899
|
-
i0.ɵɵproperty("
|
|
1900
|
-
i0.ɵɵadvance();
|
|
1901
|
-
i0.ɵɵproperty("
|
|
1902
|
-
|
|
1903
|
-
i0.ɵɵproperty("message", i0.ɵɵpipeBind1(4, 19, "management.userNameAlreadyUsed"))("validationCallback", ctx.userNameAlreadyUsedValidation);
|
|
1904
|
-
i0.ɵɵadvance(2);
|
|
1905
|
-
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(6, 21, "management.isActive"))("visible", false);
|
|
1906
|
-
i0.ɵɵadvance(2);
|
|
1907
|
-
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(8, 23, "management.firstName"));
|
|
1908
|
-
i0.ɵɵadvance(2);
|
|
1909
|
-
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(10, 25, "management.lastName"));
|
|
1910
|
-
i0.ɵɵadvance(2);
|
|
1911
|
-
i0.ɵɵproperty("caption", i0.ɵɵpipeBind1(12, 27, "management.group"));
|
|
1912
|
-
i0.ɵɵadvance(2);
|
|
1913
|
-
i0.ɵɵproperty("allowAdding", true)("allowUpdating", true)("allowDeleting", true)("useIcons", true);
|
|
1914
|
-
i0.ɵɵadvance();
|
|
1915
|
-
i0.ɵɵproperty("showTitle", true)("title", i0.ɵɵpipeBind1(15, 29, "management.group"));
|
|
1916
|
-
i0.ɵɵadvance(2);
|
|
1917
|
-
i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
|
|
1918
|
-
i0.ɵɵadvance();
|
|
1919
|
-
i0.ɵɵproperty("isRequired", true);
|
|
1920
|
-
} }, 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 }); }
|
|
1690
|
+
i0.ɵɵproperty("showBreadcrumb", true)("caption", ctx.caption())("baseCrumb", ctx.baseCrumb())("breadcrumb", ctx.breadcrumb());
|
|
1691
|
+
i0.ɵɵadvance(3);
|
|
1692
|
+
i0.ɵɵproperty("extraColumns", ctx.extraColumns())("showAddButton", ctx.showAddButton())("addButtonLabel", ctx.addButtonLabel())("canEdit", ctx.canEdit())("canDelete", ctx.canDelete())("editLinkField", ctx.editLinkField())("showPermissions", ctx.showPermissions())("persistState", ctx.persistState());
|
|
1693
|
+
} }, dependencies: [MatCardModule, i1.MatCard, i1.MatCardContent, PageTitleComponent, UserListGridComponent], encapsulation: 2 }); }
|
|
1921
1694
|
}
|
|
1922
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(
|
|
1695
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UsersPageComponent, [{
|
|
1923
1696
|
type: Component,
|
|
1924
|
-
args: [{ selector: 'cauca-
|
|
1925
|
-
}], () =>
|
|
1926
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(
|
|
1927
|
-
|
|
1928
|
-
/**
|
|
1929
|
-
* @deprecated Import CaucaManagementComponent, CaucaManagementUserComponent and
|
|
1930
|
-
* CaucaManagementGroupComponent directly in your standalone components. Kept as a re-export
|
|
1931
|
-
* so existing consumers keep compiling.
|
|
1932
|
-
*/
|
|
1933
|
-
class CaucaManagementModule {
|
|
1934
|
-
static { this.ɵfac = function CaucaManagementModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementModule)(); }; }
|
|
1935
|
-
static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CaucaManagementModule }); }
|
|
1936
|
-
static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CaucaManagementGroupComponent,
|
|
1937
|
-
CaucaManagementUserComponent] }); }
|
|
1938
|
-
}
|
|
1939
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementModule, [{
|
|
1940
|
-
type: NgModule,
|
|
1941
|
-
args: [{
|
|
1942
|
-
imports: [
|
|
1943
|
-
CaucaManagementComponent,
|
|
1944
|
-
CaucaManagementGroupComponent,
|
|
1945
|
-
CaucaManagementUserComponent,
|
|
1946
|
-
],
|
|
1947
|
-
exports: [
|
|
1948
|
-
CaucaManagementComponent,
|
|
1949
|
-
CaucaManagementUserComponent,
|
|
1950
|
-
CaucaManagementGroupComponent,
|
|
1951
|
-
]
|
|
1952
|
-
}]
|
|
1953
|
-
}], null, null); })();
|
|
1954
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CaucaManagementModule, { imports: [CaucaManagementComponent,
|
|
1955
|
-
CaucaManagementGroupComponent,
|
|
1956
|
-
CaucaManagementUserComponent], exports: [CaucaManagementComponent,
|
|
1957
|
-
CaucaManagementUserComponent,
|
|
1958
|
-
CaucaManagementGroupComponent] }); })();
|
|
1959
|
-
|
|
1960
|
-
/**
|
|
1961
|
-
* @deprecated This model is obsolete and should not be used.
|
|
1962
|
-
*/
|
|
1963
|
-
class UserGroupModel {
|
|
1964
|
-
constructor() {
|
|
1965
|
-
this.idUserGroup = '';
|
|
1966
|
-
this.idGroup = '';
|
|
1967
|
-
this.idUser = '';
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
/**
|
|
1972
|
-
* @deprecated This model is obsolete and should not be used.
|
|
1973
|
-
*/
|
|
1974
|
-
class UserPermissionModel {
|
|
1975
|
-
constructor() {
|
|
1976
|
-
this.idUserPermission = '';
|
|
1977
|
-
this.isAllowed = false;
|
|
1978
|
-
this.idUser = '';
|
|
1979
|
-
this.idModulePermission = '';
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
/**
|
|
1984
|
-
* @deprecated This model is obsolete and should not be used.
|
|
1985
|
-
*/
|
|
1986
|
-
class GroupModel {
|
|
1987
|
-
constructor() {
|
|
1988
|
-
this.name = '';
|
|
1989
|
-
this.users = [];
|
|
1990
|
-
this.permissions = [];
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
/**
|
|
1995
|
-
* @deprecated This model is obsolete and should not be used.
|
|
1996
|
-
*/
|
|
1997
|
-
class GroupPermissionModel {
|
|
1998
|
-
constructor() {
|
|
1999
|
-
this.idGroupPermission = '';
|
|
2000
|
-
this.isAllowed = false;
|
|
2001
|
-
this.idGroup = '';
|
|
2002
|
-
this.idModulePermission = '';
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
1697
|
+
args: [{ selector: 'cauca-users-page', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCardModule, PageTitleComponent, UserListGridComponent], template: "<cauca-page-title\n [showBreadcrumb]=\"true\"\n [caption]=\"caption()\"\n [baseCrumb]=\"baseCrumb()\"\n [breadcrumb]=\"breadcrumb()\"/>\n\n<mat-card class=\"page-content\">\n\n <mat-card-content class=\"page-content-grid\">\n <cauca-user-list-grid\n [extraColumns]=\"extraColumns()\"\n [showAddButton]=\"showAddButton()\"\n [addButtonLabel]=\"addButtonLabel()\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n [editLinkField]=\"editLinkField()\"\n [showPermissions]=\"showPermissions()\"\n [persistState]=\"persistState()\"\n (addClick)=\"addClick.emit()\"\n (deleteClick)=\"deleteClick.emit($event)\"/>\n </mat-card-content>\n\n</mat-card>\n" }]
|
|
1698
|
+
}], 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 }] }] }); })();
|
|
1699
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UsersPageComponent, { className: "UsersPageComponent", filePath: "lib/pages/users-page/users-page.component.ts", lineNumber: 14 }); })();
|
|
2005
1700
|
|
|
2006
1701
|
/*
|
|
2007
1702
|
* Public API Surface of cauca-management
|
|
@@ -2011,5 +1706,5 @@ class GroupPermissionModel {
|
|
|
2011
1706
|
* Generated bundle index. Do not edit.
|
|
2012
1707
|
*/
|
|
2013
1708
|
|
|
2014
|
-
export {
|
|
1709
|
+
export { AllScopeToken, GroupEditionPageComponent, GroupsPageComponent, MANAGEMENT_ROUTE_SEGMENT, MANAGEMENT_URL_PREFIX, REFRESHABLE_PERMISSION_STATE_TOKEN, ScopeListGridColumnComponent, UserListGridComponent, UserPermissionsDialogComponent, UsersPageComponent, managementGroupRoutes, provideCaucaManagement };
|
|
2015
1710
|
//# sourceMappingURL=cauca-911-management.mjs.map
|