@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/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@cauca-911/management",
3
- "version": "22.0.2",
3
+ "version": "22.0.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.1.0",
6
6
  "@angular/core": ">=22.1.0",
7
7
  "@cauca-911/core": ">=22.0.0",
8
8
  "@cauca-911/datagrid": ">=22.0.0",
9
- "@cauca-911/devextreme": ">=22.0.0",
10
9
  "@cauca-911/material": ">=22.0.0",
11
10
  "odata-filter-builder": ">=1.0.0"
12
11
  },
@@ -1,9 +1,9 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
2
  import { Type, InjectionToken, Provider, EnvironmentProviders, OnInit } from '@angular/core';
3
3
  import { Routes } from '@angular/router';
4
4
  import { OnDeactivate } from '@cauca-911/material';
5
- import { HttpClient } from '@angular/common/http';
6
- import { Observable } from 'rxjs';
5
+ import { ODataFilter } from 'odata-data-source';
6
+ import { BaseGridColumnComponent } from '@cauca-911/datagrid';
7
7
 
8
8
  declare const MANAGEMENT_URL_PREFIX: InjectionToken<string>;
9
9
  declare const MANAGEMENT_ROUTE_SEGMENT: InjectionToken<string>;
@@ -22,17 +22,17 @@ interface RefreshablePermissionState {
22
22
  }
23
23
 
24
24
  declare class GroupsPageComponent {
25
- static ɵfac: i0.ɵɵFactoryDeclaration<GroupsPageComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<GroupsPageComponent, "cauca-groups-page", never, {}, {}, never, never, true, never>;
25
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GroupsPageComponent, never>;
26
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<GroupsPageComponent, "cauca-groups-page", never, {}, {}, never, never, true, never>;
27
27
  }
28
28
 
29
29
  declare class GroupEditionPageComponent implements OnInit, OnDeactivate {
30
- readonly id: i0.InputSignal<string>;
31
- readonly isLoaded: i0.WritableSignal<boolean>;
32
- readonly isSaving: i0.WritableSignal<boolean>;
33
- readonly showSavingError: i0.WritableSignal<boolean>;
34
- readonly title: i0.Signal<string>;
35
- readonly currentLocation: i0.Signal<{
30
+ readonly id: _angular_core.InputSignal<string>;
31
+ readonly isLoaded: _angular_core.WritableSignal<boolean>;
32
+ readonly isSaving: _angular_core.WritableSignal<boolean>;
33
+ readonly showSavingError: _angular_core.WritableSignal<boolean>;
34
+ readonly title: _angular_core.Signal<string>;
35
+ readonly currentLocation: _angular_core.Signal<{
36
36
  link: string;
37
37
  title: string;
38
38
  }[]>;
@@ -55,8 +55,8 @@ declare class GroupEditionPageComponent implements OnInit, OnDeactivate {
55
55
  private resetSavingState;
56
56
  private askForCancelConfirmation;
57
57
  private showValidationError;
58
- static ɵfac: i0.ɵɵFactoryDeclaration<GroupEditionPageComponent, never>;
59
- static ɵcmp: i0.ɵɵComponentDeclaration<GroupEditionPageComponent, "cauca-group-edition-page", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
58
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GroupEditionPageComponent, never>;
59
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<GroupEditionPageComponent, "cauca-group-edition-page", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
60
60
  }
61
61
 
62
62
  declare enum PermissionStatus {
@@ -88,198 +88,112 @@ interface UserPermissionsDialogData {
88
88
  }
89
89
  declare class UserPermissionsDialogComponent {
90
90
  readonly data: UserPermissionsDialogData;
91
- readonly permissionsResource: i0.ResourceRef<UserPermissionDetail[]>;
92
- readonly permissions: i0.Signal<UserPermissionDetail[]>;
91
+ readonly permissionsResource: _angular_core.ResourceRef<UserPermissionDetail[]>;
92
+ readonly permissions: _angular_core.Signal<UserPermissionDetail[]>;
93
93
  private readonly dialogRef;
94
94
  private readonly service;
95
95
  closeDialog(): void;
96
- static ɵfac: i0.ɵɵFactoryDeclaration<UserPermissionsDialogComponent, never>;
97
- static ɵcmp: i0.ɵɵComponentDeclaration<UserPermissionsDialogComponent, "cauca-user-permissions-dialog", never, {}, {}, never, never, true, never>;
98
- }
99
-
100
- declare class CaucaManagementService {
101
- static ɵfac: i0.ɵɵFactoryDeclaration<CaucaManagementService, never>;
102
- static ɵprov: i0.ɵɵInjectableDeclaration<CaucaManagementService>;
103
- }
104
-
105
- declare class CaucaManagementComponent {
106
- static ɵfac: i0.ɵɵFactoryDeclaration<CaucaManagementComponent, never>;
107
- static ɵcmp: i0.ɵɵComponentDeclaration<CaucaManagementComponent, "cauca-management", never, {}, {}, never, never, true, never>;
108
- }
109
-
110
- /**
111
- * @deprecated This model is obsolete and should not be used.
112
- */
113
- declare class UserGroupModel {
114
- idUserGroup: string;
115
- idGroup: string;
116
- idUser: string;
117
- }
118
-
119
- /**
120
- * @deprecated This model is obsolete and should not be used.
121
- */
122
- declare class UserPermissionModel {
123
- idUserPermission: string;
124
- isAllowed: boolean;
125
- idUser: string;
126
- idModulePermission: string;
127
- }
128
-
129
- /**
130
- * @deprecated This model is obsolete and should not be used.
131
- */
132
- declare class UserModel {
96
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserPermissionsDialogComponent, never>;
97
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserPermissionsDialogComponent, "cauca-user-permissions-dialog", never, {}, {}, never, never, true, never>;
98
+ }
99
+
100
+ type UserGridColumnKind = 'text' | 'check' | 'scope';
101
+ /** A column a site adds to the shared users grid, on top of the three columns every site shows. */
102
+ interface UserGridColumn {
103
+ /** The row property the column reads, and the MatTable column name. */
104
+ prop: string;
105
+ /** Translation key. The grid translates it. */
106
+ label: string;
107
+ kind: UserGridColumnKind;
108
+ /** The normalized twin the search box filters on. Omit to leave the column out of the search. */
109
+ searchableProp?: string;
110
+ width?: string;
111
+ showToolTip?: boolean;
112
+ /** `scope` only: the key shown in place of the list when the row covers everything. */
113
+ allLabel?: string;
114
+ }
115
+
116
+ /** The shape every site's `UserList` feed shares. Site-specific columns arrive as extra properties. */
117
+ interface UserListRow {
133
118
  id: string;
134
119
  userName: string;
135
120
  firstName: string;
136
121
  lastName: string;
137
- password: string;
138
- email: string;
139
- isActive: boolean;
140
- groups: UserGroupModel[];
141
- permissions: UserPermissionModel[];
142
- twoFactorAuthenticatorEnabled: boolean;
143
- }
144
-
145
- /**
146
- * @deprecated This model is obsolete and should not be used.
147
- */
148
- declare class GroupPermissionModel {
149
- idGroupPermission: string;
150
- isAllowed: boolean;
151
- idGroup: string;
152
- idModulePermission: string;
153
- }
154
-
155
- /**
156
- * @deprecated This model is obsolete and should not be used.
157
- */
158
- declare class GroupModel {
159
- id: string;
160
- name: string;
161
- users: UserGroupModel[];
162
- permissions: GroupPermissionModel[];
163
- assignableByAllUsers: boolean;
164
- }
165
-
166
- /**
167
- * @deprecated This model is obsolete and should not be used.
168
- */
169
- declare class PermissionModel {
170
- id: string;
171
- name: string;
172
- tag: string;
173
- idSystem: string;
174
- }
175
-
176
- /**
177
- * @deprecated This component is obsolete and should not be used.
178
- */
179
- declare class CaucaManagementGroupComponent implements OnInit {
180
- readonly showPrintButton: i0.InputSignal<boolean>;
181
- readonly hoverStatePermission: i0.InputSignal<boolean>;
182
- readonly showAssignableByAllUsers: i0.InputSignal<boolean>;
183
- groups: GroupModel[];
184
- users: UserModel[];
185
- permissions: PermissionModel[];
186
- userFullName: any;
187
- showColumn: boolean;
188
- showColumnXS: boolean;
189
- translations: any;
190
- private groupUsers;
191
- private readonly managementGroupService;
192
- private readonly managementUserService;
193
- private readonly managementPermissionService;
194
- constructor();
122
+ searchableUserName: string;
123
+ searchableFirstName: string;
124
+ searchableLastName: string;
125
+ [extraColumn: string]: unknown;
126
+ }
127
+
128
+ declare class UsersPageComponent {
129
+ /** Translation keys. Every site names its users page and its menu differently. */
130
+ readonly caption: _angular_core.InputSignal<string>;
131
+ readonly baseCrumb: _angular_core.InputSignal<string>;
132
+ readonly breadcrumb: _angular_core.InputSignal<string>;
133
+ readonly extraColumns: _angular_core.InputSignal<UserGridColumn[]>;
134
+ readonly showAddButton: _angular_core.InputSignal<boolean>;
135
+ readonly addButtonLabel: _angular_core.InputSignal<string>;
136
+ readonly canEdit: _angular_core.InputSignal<boolean>;
137
+ readonly canDelete: _angular_core.InputSignal<boolean>;
138
+ readonly editLinkField: _angular_core.InputSignal<string>;
139
+ readonly showPermissions: _angular_core.InputSignal<boolean>;
140
+ readonly persistState: _angular_core.InputSignal<boolean>;
141
+ readonly addClick: _angular_core.OutputEmitterRef<void>;
142
+ readonly deleteClick: _angular_core.OutputEmitterRef<UserListRow>;
143
+ private readonly grid;
144
+ refresh(): void;
145
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UsersPageComponent, never>;
146
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UsersPageComponent, "cauca-users-page", never, { "caption": { "alias": "caption"; "required": false; "isSignal": true; }; "baseCrumb": { "alias": "baseCrumb"; "required": false; "isSignal": true; }; "breadcrumb": { "alias": "breadcrumb"; "required": false; "isSignal": true; }; "extraColumns": { "alias": "extraColumns"; "required": false; "isSignal": true; }; "showAddButton": { "alias": "showAddButton"; "required": false; "isSignal": true; }; "addButtonLabel": { "alias": "addButtonLabel"; "required": false; "isSignal": true; }; "canEdit": { "alias": "canEdit"; "required": false; "isSignal": true; }; "canDelete": { "alias": "canDelete"; "required": false; "isSignal": true; }; "editLinkField": { "alias": "editLinkField"; "required": false; "isSignal": true; }; "showPermissions": { "alias": "showPermissions"; "required": false; "isSignal": true; }; "persistState": { "alias": "persistState"; "required": false; "isSignal": true; }; }, { "addClick": "addClick"; "deleteClick": "deleteClick"; }, never, never, true, never>;
147
+ }
148
+
149
+ declare class UserListGridComponent implements OnInit {
150
+ /**
151
+ * Read when the grid registers its columns, in `ngAfterContentInit`. Changing it afterwards
152
+ * recomputes `columns()` but does not re-run `applyColumns()`, so the MatTable is asked to
153
+ * render a column id it never registered and throws `Could not find column with id "X"`.
154
+ * `showPermissions`, `canEdit` and `canDelete` gate the row-action column the same way and
155
+ * carry the same constraint — and are the more likely one to hit, since a consumer binds them
156
+ * to an async permission signal more readily than it replaces the column list.
157
+ */
158
+ readonly extraColumns: _angular_core.InputSignal<UserGridColumn[]>;
159
+ readonly showAddButton: _angular_core.InputSignal<boolean>;
160
+ /** Translation key. */
161
+ readonly addButtonLabel: _angular_core.InputSignal<string>;
162
+ readonly canEdit: _angular_core.InputSignal<boolean>;
163
+ readonly canDelete: _angular_core.InputSignal<boolean>;
164
+ readonly editLinkField: _angular_core.InputSignal<string>;
165
+ readonly showPermissions: _angular_core.InputSignal<boolean>;
166
+ readonly persistState: _angular_core.InputSignal<boolean>;
167
+ readonly addClick: _angular_core.OutputEmitterRef<void>;
168
+ readonly deleteClick: _angular_core.OutputEmitterRef<UserListRow>;
169
+ protected readonly hasRowActions: _angular_core.Signal<boolean>;
170
+ protected readonly columns: _angular_core.Signal<string[]>;
171
+ private readonly grid;
172
+ private readonly sort;
173
+ private readonly dialog;
195
174
  ngOnInit(): void;
196
- fullName(data: any): string;
197
- getGroupUser(field: any, e: any): void;
198
- setGroupUser(field: any, e: any): void;
199
- setGroupPermission(field: any, e: any): void;
200
- getPermissionStatus(field: any, permission: any, e: any): void;
201
- checkBoxToggled(field: any, permission: any, e: any): void;
202
- onRowInserted(e: any): void;
203
- onRowUpdated(e: any): void;
204
- onRowRemoved(e: any): void;
205
- calculateUsersCellValue: (e: any) => string;
206
- onEditingStart(e: any): void;
207
- onInitNewRow(): void;
208
- groupNameAlreadyUsedValidation: (e: any) => Promise<boolean>;
209
- private setPermissionStatus;
210
- private saveGroup;
211
- private removePermissionUndefined;
212
- private getGroups;
213
- static ɵfac: i0.ɵɵFactoryDeclaration<CaucaManagementGroupComponent, never>;
214
- static ɵcmp: i0.ɵɵComponentDeclaration<CaucaManagementGroupComponent, "cauca-management-group", never, { "showPrintButton": { "alias": "showPrintButton"; "required": false; "isSignal": true; }; "hoverStatePermission": { "alias": "hoverStatePermission"; "required": false; "isSignal": true; }; "showAssignableByAllUsers": { "alias": "showAssignableByAllUsers"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
215
- }
216
-
217
- /**
218
- * @deprecated This component is obsolete and should not be used.
219
- */
220
- declare class CaucaManagementUserComponent implements OnInit {
221
- users: UserModel[];
222
- showColumnXS: boolean;
223
- private readonly managementUserService;
175
+ refresh(): void;
176
+ protected readonly filterPredicate: (filter: string) => ODataFilter[];
177
+ protected openPermissions(row: UserListRow): Promise<void>;
178
+ protected onDelete(row: unknown): void;
179
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserListGridComponent, never>;
180
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserListGridComponent, "cauca-user-list-grid", never, { "extraColumns": { "alias": "extraColumns"; "required": false; "isSignal": true; }; "showAddButton": { "alias": "showAddButton"; "required": false; "isSignal": true; }; "addButtonLabel": { "alias": "addButtonLabel"; "required": false; "isSignal": true; }; "canEdit": { "alias": "canEdit"; "required": false; "isSignal": true; }; "canDelete": { "alias": "canDelete"; "required": false; "isSignal": true; }; "editLinkField": { "alias": "editLinkField"; "required": false; "isSignal": true; }; "showPermissions": { "alias": "showPermissions"; "required": false; "isSignal": true; }; "persistState": { "alias": "persistState"; "required": false; "isSignal": true; }; }, { "addClick": "addClick"; "deleteClick": "deleteClick"; }, never, never, true, never>;
181
+ }
182
+
183
+ /** The value a read view emits for a scope covering everything, in place of a list of names. */
184
+ declare const AllScopeToken = "ALL";
185
+ declare class ScopeListGridColumnComponent extends BaseGridColumnComponent {
186
+ /** Translation key shown instead of the list when the row's scope covers everything. */
187
+ readonly allLabel: _angular_core.InputSignal<string>;
188
+ protected readonly allToken = "ALL";
189
+ /**
190
+ * The `providers` alias above is what makes the grid's `ContentChildren(BaseGridColumnComponent)`
191
+ * match this subclass; without it the column registers nowhere and renders as an empty slot.
192
+ */
224
193
  constructor();
225
- ngOnInit(): void;
226
- onRowInserted(e: any): void;
227
- onRowUpdated(e: any): void;
228
- onRowRemoved(e: any): void;
229
- userNameAlreadyUsedValidation: (e: any) => Promise<boolean>;
230
- private saveGroup;
231
- private getUsers;
232
- static ɵfac: i0.ɵɵFactoryDeclaration<CaucaManagementUserComponent, never>;
233
- static ɵcmp: i0.ɵɵComponentDeclaration<CaucaManagementUserComponent, "cauca-management-user", never, {}, {}, never, never, true, never>;
234
- }
235
-
236
- /**
237
- * @deprecated Import CaucaManagementComponent, CaucaManagementUserComponent and
238
- * CaucaManagementGroupComponent directly in your standalone components. Kept as a re-export
239
- * so existing consumers keep compiling.
240
- */
241
- declare class CaucaManagementModule {
242
- static ɵfac: i0.ɵɵFactoryDeclaration<CaucaManagementModule, never>;
243
- static ɵmod: i0.ɵɵNgModuleDeclaration<CaucaManagementModule, never, [typeof CaucaManagementComponent, typeof CaucaManagementGroupComponent, typeof CaucaManagementUserComponent], [typeof CaucaManagementComponent, typeof CaucaManagementUserComponent, typeof CaucaManagementGroupComponent]>;
244
- static ɵinj: i0.ɵɵInjectorDeclaration<CaucaManagementModule>;
245
- }
246
-
247
- /**
248
- * @deprecated This service is obsolete and should not be used.
249
- */
250
- declare class ManagementUserService {
251
- protected readonly http: HttpClient;
252
- private readonly baseUrl;
253
- private readonly baseUrlToUse;
254
- getAll<TUser>(): Observable<TUser[]>;
255
- get<TUser>(idUser: string): Observable<TUser>;
256
- getGroup(idUser: string): Observable<any>;
257
- addGroup(userGroup: UserGroupModel): Observable<any>;
258
- deleteGroup(idUserGroup: string): Observable<any>;
259
- addPermission(userPermission: UserPermissionModel): Observable<any>;
260
- deletePermission(idUserPermission: string): Observable<any>;
261
- save<TUser>(user: TUser): Observable<any>;
262
- delete(idUser: string): Observable<any>;
263
- hasExistingUserName<TUser>(user: TUser): Observable<boolean>;
264
- static ɵfac: i0.ɵɵFactoryDeclaration<ManagementUserService, never>;
265
- static ɵprov: i0.ɵɵInjectableDeclaration<ManagementUserService>;
266
- }
267
-
268
- /**
269
- * @deprecated This service is obsolete and should not be used.
270
- */
271
- declare class ManagementGroupService {
272
- private readonly http;
273
- private readonly baseUrl;
274
- private readonly baseUrlToUse;
275
- getAll(): Observable<GroupModel[]>;
276
- get(idGroup: string): Observable<GroupModel>;
277
- save(group: GroupModel): Observable<any>;
278
- delete(idGroup: string): Observable<any>;
279
- hasExistingGroupName(group: GroupModel): Observable<boolean>;
280
- static ɵfac: i0.ɵɵFactoryDeclaration<ManagementGroupService, never>;
281
- static ɵprov: i0.ɵɵInjectableDeclaration<ManagementGroupService>;
194
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScopeListGridColumnComponent, never>;
195
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScopeListGridColumnComponent, "cauca-scope-list-grid-column", never, { "allLabel": { "alias": "allLabel"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
282
196
  }
283
197
 
284
- export { CaucaManagementComponent, CaucaManagementGroupComponent, CaucaManagementModule, CaucaManagementService, CaucaManagementUserComponent, GroupEditionPageComponent, GroupModel, GroupPermissionModel, GroupsPageComponent, MANAGEMENT_ROUTE_SEGMENT, MANAGEMENT_URL_PREFIX, ManagementGroupService, ManagementUserService, REFRESHABLE_PERMISSION_STATE_TOKEN, UserGroupModel, UserModel, UserPermissionModel, UserPermissionsDialogComponent, managementGroupRoutes, provideCaucaManagement };
285
- export type { CaucaManagementConfig, RefreshablePermissionState, UserPermissionsDialogData };
198
+ export { AllScopeToken, GroupEditionPageComponent, GroupsPageComponent, MANAGEMENT_ROUTE_SEGMENT, MANAGEMENT_URL_PREFIX, REFRESHABLE_PERMISSION_STATE_TOKEN, ScopeListGridColumnComponent, UserListGridComponent, UserPermissionsDialogComponent, UsersPageComponent, managementGroupRoutes, provideCaucaManagement };
199
+ export type { CaucaManagementConfig, RefreshablePermissionState, UserGridColumn, UserGridColumnKind, UserListRow, UserPermissionsDialogData };