@cauca-911/management 22.0.4 → 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/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@cauca-911/management",
3
- "version": "22.0.4",
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
9
  "@cauca-911/material": ">=22.0.0",
10
+ "ngx-mat-select-search": ">=9.0.0",
10
11
  "odata-filter-builder": ">=1.0.0"
11
12
  },
12
13
  "homepage": "https://cauca.ca",
@@ -4,6 +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 { Schema, FieldTree, FormValueControl, ValidationError } from '@angular/forms/signals';
8
+ import { Observable } from 'rxjs';
9
+ import { FormControl } from '@angular/forms';
7
10
 
8
11
  declare const MANAGEMENT_URL_PREFIX: InjectionToken<string>;
9
12
  declare const MANAGEMENT_ROUTE_SEGMENT: InjectionToken<string>;
@@ -111,6 +114,8 @@ interface UserGridColumn {
111
114
  showToolTip?: boolean;
112
115
  /** `scope` only: the key shown in place of the list when the row covers everything. */
113
116
  allLabel?: string;
117
+ /** Whether the column starts visible when the user has no stored configuration. Defaults to true. */
118
+ visibleByDefault?: boolean;
114
119
  }
115
120
 
116
121
  /** The shape every site's `UserList` feed shares. Site-specific columns arrive as extra properties. */
@@ -195,5 +200,118 @@ declare class ScopeListGridColumnComponent extends BaseGridColumnComponent {
195
200
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScopeListGridColumnComponent, "cauca-scope-list-grid-column", never, { "allLabel": { "alias": "allLabel"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
196
201
  }
197
202
 
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 };
203
+ interface UserLoginForEdition {
204
+ userName: string;
205
+ password: string;
206
+ twoFactorAuthenticatorEnabled: boolean;
207
+ }
208
+ interface UserPersonalInformationForEdition {
209
+ firstName: string;
210
+ lastName: string;
211
+ email: string;
212
+ phoneNumber: string;
213
+ }
214
+ interface UserForEditionBase {
215
+ id: string;
216
+ login: UserLoginForEdition;
217
+ personalInformation: UserPersonalInformationForEdition;
218
+ groupIds: string[];
219
+ }
220
+ /** What creation sends as the identifier. */
221
+ declare const EmptyUserId = "00000000-0000-0000-0000-000000000000";
222
+ declare function createEmptyUserForEdition(): UserForEditionBase;
223
+
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;
247
+ }
248
+ declare function createUserPersonalInformationSchema(options: UserPersonalInformationSchemaOptions): Schema<UserPersonalInformationForEdition>;
249
+
250
+ interface AssignableGroup {
251
+ id: string;
252
+ name: string;
253
+ }
254
+
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>>;
265
+ }
266
+
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>;
275
+ }
276
+
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>;
283
+ }
284
+
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>;
291
+ }
292
+
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>;
314
+ }
315
+
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 };