@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.
- package/assets/i18n/cauca/en-management.json +7 -0
- package/assets/i18n/cauca/es-management.json +7 -0
- package/assets/i18n/cauca/fr-management.json +7 -0
- package/fesm2022/cauca-911-management.mjs +374 -586
- package/fesm2022/cauca-911-management.mjs.map +1 -1
- package/package.json +2 -2
- package/types/cauca-911-management.d.ts +102 -166
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cauca-911/management",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.5",
|
|
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",
|
|
10
|
+
"ngx-mat-select-search": ">=9.0.0",
|
|
11
11
|
"odata-filter-builder": ">=1.0.0"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://cauca.ca",
|
|
@@ -4,8 +4,9 @@ import { Routes } from '@angular/router';
|
|
|
4
4
|
import { OnDeactivate } from '@cauca-911/material';
|
|
5
5
|
import { ODataFilter } from 'odata-data-source';
|
|
6
6
|
import { BaseGridColumnComponent } from '@cauca-911/datagrid';
|
|
7
|
-
import {
|
|
7
|
+
import { Schema, FieldTree, FormValueControl, ValidationError } from '@angular/forms/signals';
|
|
8
8
|
import { Observable } from 'rxjs';
|
|
9
|
+
import { FormControl } from '@angular/forms';
|
|
9
10
|
|
|
10
11
|
declare const MANAGEMENT_URL_PREFIX: InjectionToken<string>;
|
|
11
12
|
declare const MANAGEMENT_ROUTE_SEGMENT: InjectionToken<string>;
|
|
@@ -113,6 +114,8 @@ interface UserGridColumn {
|
|
|
113
114
|
showToolTip?: boolean;
|
|
114
115
|
/** `scope` only: the key shown in place of the list when the row covers everything. */
|
|
115
116
|
allLabel?: string;
|
|
117
|
+
/** Whether the column starts visible when the user has no stored configuration. Defaults to true. */
|
|
118
|
+
visibleByDefault?: boolean;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/** The shape every site's `UserList` feed shares. Site-specific columns arrive as extra properties. */
|
|
@@ -150,8 +153,12 @@ declare class UsersPageComponent {
|
|
|
150
153
|
|
|
151
154
|
declare class UserListGridComponent implements OnInit {
|
|
152
155
|
/**
|
|
153
|
-
* Read when the grid registers its columns, in `ngAfterContentInit`.
|
|
154
|
-
*
|
|
156
|
+
* Read when the grid registers its columns, in `ngAfterContentInit`. Changing it afterwards
|
|
157
|
+
* recomputes `columns()` but does not re-run `applyColumns()`, so the MatTable is asked to
|
|
158
|
+
* render a column id it never registered and throws `Could not find column with id "X"`.
|
|
159
|
+
* `showPermissions`, `canEdit` and `canDelete` gate the row-action column the same way and
|
|
160
|
+
* carry the same constraint — and are the more likely one to hit, since a consumer binds them
|
|
161
|
+
* to an async permission signal more readily than it replaces the column list.
|
|
155
162
|
*/
|
|
156
163
|
readonly extraColumns: _angular_core.InputSignal<UserGridColumn[]>;
|
|
157
164
|
readonly showAddButton: _angular_core.InputSignal<boolean>;
|
|
@@ -193,189 +200,118 @@ declare class ScopeListGridColumnComponent extends BaseGridColumnComponent {
|
|
|
193
200
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScopeListGridColumnComponent, "cauca-scope-list-grid-column", never, { "allLabel": { "alias": "allLabel"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
194
201
|
}
|
|
195
202
|
|
|
196
|
-
|
|
197
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CaucaManagementService, never>;
|
|
198
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CaucaManagementService>;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
declare class CaucaManagementComponent {
|
|
202
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CaucaManagementComponent, never>;
|
|
203
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CaucaManagementComponent, "cauca-management", never, {}, {}, never, never, true, never>;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* @deprecated This model is obsolete and should not be used.
|
|
208
|
-
*/
|
|
209
|
-
declare class UserGroupModel {
|
|
210
|
-
idUserGroup: string;
|
|
211
|
-
idGroup: string;
|
|
212
|
-
idUser: string;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* @deprecated This model is obsolete and should not be used.
|
|
217
|
-
*/
|
|
218
|
-
declare class UserPermissionModel {
|
|
219
|
-
idUserPermission: string;
|
|
220
|
-
isAllowed: boolean;
|
|
221
|
-
idUser: string;
|
|
222
|
-
idModulePermission: string;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @deprecated This model is obsolete and should not be used.
|
|
227
|
-
*/
|
|
228
|
-
declare class UserModel {
|
|
229
|
-
id: string;
|
|
203
|
+
interface UserLoginForEdition {
|
|
230
204
|
userName: string;
|
|
205
|
+
password: string;
|
|
206
|
+
twoFactorAuthenticatorEnabled: boolean;
|
|
207
|
+
}
|
|
208
|
+
interface UserPersonalInformationForEdition {
|
|
231
209
|
firstName: string;
|
|
232
210
|
lastName: string;
|
|
233
|
-
password: string;
|
|
234
211
|
email: string;
|
|
235
|
-
|
|
236
|
-
groups: UserGroupModel[];
|
|
237
|
-
permissions: UserPermissionModel[];
|
|
238
|
-
twoFactorAuthenticatorEnabled: boolean;
|
|
212
|
+
phoneNumber: string;
|
|
239
213
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
idGroupPermission: string;
|
|
246
|
-
isAllowed: boolean;
|
|
247
|
-
idGroup: string;
|
|
248
|
-
idModulePermission: string;
|
|
214
|
+
interface UserForEditionBase {
|
|
215
|
+
id: string;
|
|
216
|
+
login: UserLoginForEdition;
|
|
217
|
+
personalInformation: UserPersonalInformationForEdition;
|
|
218
|
+
groupIds: string[];
|
|
249
219
|
}
|
|
220
|
+
/** What creation sends as the identifier. */
|
|
221
|
+
declare const EmptyUserId = "00000000-0000-0000-0000-000000000000";
|
|
222
|
+
declare function createEmptyUserForEdition(): UserForEditionBase;
|
|
250
223
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
224
|
+
interface UserLoginSchemaOptions {
|
|
225
|
+
/**
|
|
226
|
+
* Whether this is a creation — the password rule is required only then.
|
|
227
|
+
*
|
|
228
|
+
* A consumer binding `cauca-user-login-fields` must pass this same value to that component's
|
|
229
|
+
* own `isNew` input; nothing here checks the two agree, and a mismatch shows the password as
|
|
230
|
+
* optional (or required) without matching what actually gets validated.
|
|
231
|
+
*
|
|
232
|
+
* Never add a `disabled()` rule to the password field based on this or any other condition:
|
|
233
|
+
* `cauca-password-selection`'s `setDisabledState(true)` disables its inner form group, which
|
|
234
|
+
* makes the group invalid and fires `onChange('')`, silently wiping the stored password.
|
|
235
|
+
*/
|
|
236
|
+
readonly isNew: () => boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Builds the availability URL for one candidate name. The caller closes over the id of the
|
|
239
|
+
* user being edited, so this takes only the name.
|
|
240
|
+
*/
|
|
241
|
+
readonly userNameAvailabilityUrl: (userName: string) => string;
|
|
242
|
+
}
|
|
243
|
+
declare function createUserLoginSchema(options: UserLoginSchemaOptions): Schema<UserLoginForEdition>;
|
|
244
|
+
interface UserPersonalInformationSchemaOptions {
|
|
245
|
+
/** Whether the email field is read-only, e.g. because it is managed by an external identity provider. */
|
|
246
|
+
readonly isEmailReadOnly: () => boolean;
|
|
260
247
|
}
|
|
248
|
+
declare function createUserPersonalInformationSchema(options: UserPersonalInformationSchemaOptions): Schema<UserPersonalInformationForEdition>;
|
|
261
249
|
|
|
262
|
-
|
|
263
|
-
* @deprecated This model is obsolete and should not be used.
|
|
264
|
-
*/
|
|
265
|
-
declare class PermissionModel {
|
|
250
|
+
interface AssignableGroup {
|
|
266
251
|
id: string;
|
|
267
252
|
name: string;
|
|
268
|
-
tag: string;
|
|
269
|
-
idSystem: string;
|
|
270
253
|
}
|
|
271
254
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
userFullName: any;
|
|
283
|
-
showColumn: boolean;
|
|
284
|
-
showColumnXS: boolean;
|
|
285
|
-
translations: any;
|
|
286
|
-
private groupUsers;
|
|
287
|
-
private readonly managementGroupService;
|
|
288
|
-
private readonly managementUserService;
|
|
289
|
-
private readonly managementPermissionService;
|
|
290
|
-
constructor();
|
|
291
|
-
ngOnInit(): void;
|
|
292
|
-
fullName(data: any): string;
|
|
293
|
-
getGroupUser(field: any, e: any): void;
|
|
294
|
-
setGroupUser(field: any, e: any): void;
|
|
295
|
-
setGroupPermission(field: any, e: any): void;
|
|
296
|
-
getPermissionStatus(field: any, permission: any, e: any): void;
|
|
297
|
-
checkBoxToggled(field: any, permission: any, e: any): void;
|
|
298
|
-
onRowInserted(e: any): void;
|
|
299
|
-
onRowUpdated(e: any): void;
|
|
300
|
-
onRowRemoved(e: any): void;
|
|
301
|
-
calculateUsersCellValue: (e: any) => string;
|
|
302
|
-
onEditingStart(e: any): void;
|
|
303
|
-
onInitNewRow(): void;
|
|
304
|
-
groupNameAlreadyUsedValidation: (e: any) => Promise<boolean>;
|
|
305
|
-
private setPermissionStatus;
|
|
306
|
-
private saveGroup;
|
|
307
|
-
private removePermissionUndefined;
|
|
308
|
-
private getGroups;
|
|
309
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CaucaManagementGroupComponent, never>;
|
|
310
|
-
static ɵcmp: _angular_core.ɵɵ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>;
|
|
255
|
+
declare class UserEditionService<TUserForEdition extends UserForEditionBase> {
|
|
256
|
+
private readonly client;
|
|
257
|
+
private readonly baseUrl;
|
|
258
|
+
private readonly urlPrefix;
|
|
259
|
+
getForEdition(userId: string): Observable<TUserForEdition>;
|
|
260
|
+
saveForEdition(user: TUserForEdition): Observable<void>;
|
|
261
|
+
userNameAvailabilityUrl(userName: string, userId: string): string;
|
|
262
|
+
private buildApiUrl;
|
|
263
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserEditionService<any>, never>;
|
|
264
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<UserEditionService<any>>;
|
|
311
265
|
}
|
|
312
266
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
ngOnInit(): void;
|
|
322
|
-
onRowInserted(e: any): void;
|
|
323
|
-
onRowUpdated(e: any): void;
|
|
324
|
-
onRowRemoved(e: any): void;
|
|
325
|
-
userNameAlreadyUsedValidation: (e: any) => Promise<boolean>;
|
|
326
|
-
private saveGroup;
|
|
327
|
-
private getUsers;
|
|
328
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CaucaManagementUserComponent, never>;
|
|
329
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CaucaManagementUserComponent, "cauca-management-user", never, {}, {}, never, never, true, never>;
|
|
267
|
+
declare class AssignableGroupsService {
|
|
268
|
+
private readonly client;
|
|
269
|
+
private readonly baseUrl;
|
|
270
|
+
private readonly urlPrefix;
|
|
271
|
+
getAssignableGroups(): Observable<AssignableGroup[]>;
|
|
272
|
+
private buildApiUrl;
|
|
273
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AssignableGroupsService, never>;
|
|
274
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AssignableGroupsService>;
|
|
330
275
|
}
|
|
331
276
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CaucaManagementModule, never>;
|
|
339
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<CaucaManagementModule, never, [typeof CaucaManagementComponent, typeof CaucaManagementGroupComponent, typeof CaucaManagementUserComponent], [typeof CaucaManagementComponent, typeof CaucaManagementUserComponent, typeof CaucaManagementGroupComponent]>;
|
|
340
|
-
static ɵinj: _angular_core.ɵɵInjectorDeclaration<CaucaManagementModule>;
|
|
277
|
+
declare class UserLoginFieldsComponent {
|
|
278
|
+
readonly field: _angular_core.InputSignal<FieldTree<UserLoginForEdition>>;
|
|
279
|
+
readonly isNew: _angular_core.InputSignal<boolean>;
|
|
280
|
+
readonly isValidatingUserName: _angular_core.InputSignal<boolean>;
|
|
281
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserLoginFieldsComponent, never>;
|
|
282
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserLoginFieldsComponent, "cauca-user-login-fields", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "isNew": { "alias": "isNew"; "required": false; "isSignal": true; }; "isValidatingUserName": { "alias": "isValidatingUserName"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
341
283
|
}
|
|
342
284
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
private readonly baseUrlToUse;
|
|
350
|
-
getAll<TUser>(): Observable<TUser[]>;
|
|
351
|
-
get<TUser>(idUser: string): Observable<TUser>;
|
|
352
|
-
getGroup(idUser: string): Observable<any>;
|
|
353
|
-
addGroup(userGroup: UserGroupModel): Observable<any>;
|
|
354
|
-
deleteGroup(idUserGroup: string): Observable<any>;
|
|
355
|
-
addPermission(userPermission: UserPermissionModel): Observable<any>;
|
|
356
|
-
deletePermission(idUserPermission: string): Observable<any>;
|
|
357
|
-
save<TUser>(user: TUser): Observable<any>;
|
|
358
|
-
delete(idUser: string): Observable<any>;
|
|
359
|
-
hasExistingUserName<TUser>(user: TUser): Observable<boolean>;
|
|
360
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManagementUserService, never>;
|
|
361
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ManagementUserService>;
|
|
285
|
+
declare class UserPersonalInformationFieldsComponent {
|
|
286
|
+
readonly field: _angular_core.InputSignal<FieldTree<UserPersonalInformationForEdition>>;
|
|
287
|
+
readonly isEmailReadOnly: _angular_core.InputSignal<boolean>;
|
|
288
|
+
readonly emailHint: _angular_core.InputSignal<string>;
|
|
289
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserPersonalInformationFieldsComponent, never>;
|
|
290
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserPersonalInformationFieldsComponent, "cauca-user-personal-information-fields", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "isEmailReadOnly": { "alias": "isEmailReadOnly"; "required": false; "isSignal": true; }; "emailHint": { "alias": "emailHint"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
362
291
|
}
|
|
363
292
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
293
|
+
declare class UserGroupsSelectorComponent implements FormValueControl<string[]> {
|
|
294
|
+
readonly value: _angular_core.ModelSignal<string[]>;
|
|
295
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
296
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
297
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
298
|
+
readonly required: _angular_core.InputSignal<boolean>;
|
|
299
|
+
readonly invalid: _angular_core.InputSignal<boolean>;
|
|
300
|
+
readonly touched: _angular_core.InputSignal<boolean>;
|
|
301
|
+
readonly name: _angular_core.InputSignal<string>;
|
|
302
|
+
readonly errors: _angular_core.InputSignal<readonly ValidationError.WithOptionalFieldTree[]>;
|
|
303
|
+
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
304
|
+
protected readonly filterControl: FormControl<string>;
|
|
305
|
+
protected readonly options: _angular_core.Signal<AssignableGroup[]>;
|
|
306
|
+
protected readonly filteredOptions: _angular_core.Signal<AssignableGroup[]>;
|
|
307
|
+
protected readonly isSelectDisabled: _angular_core.Signal<boolean>;
|
|
308
|
+
private readonly assignableGroupsService;
|
|
309
|
+
private readonly filterText;
|
|
310
|
+
private readonly groups;
|
|
311
|
+
protected onSelectionChange(groupIds: string[]): void;
|
|
312
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserGroupsSelectorComponent, never>;
|
|
313
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserGroupsSelectorComponent, "cauca-user-groups-selector", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
|
|
378
314
|
}
|
|
379
315
|
|
|
380
|
-
export { AllScopeToken,
|
|
381
|
-
export type { CaucaManagementConfig, RefreshablePermissionState, UserGridColumn, UserGridColumnKind, UserListRow, UserPermissionsDialogData };
|
|
316
|
+
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 };
|
|
317
|
+
export type { AssignableGroup, CaucaManagementConfig, RefreshablePermissionState, UserForEditionBase, UserGridColumn, UserGridColumnKind, UserListRow, UserLoginForEdition, UserLoginSchemaOptions, UserPermissionsDialogData, UserPersonalInformationForEdition, UserPersonalInformationSchemaOptions };
|