@memberjunction/ng-explorer-settings 6.2.0-edge.0 → 6.2.0-edge.1
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/dist/lib/account-info/account-info.component.d.ts +1 -1
- package/dist/lib/account-info/account-info.component.js +2 -2
- package/dist/lib/account-info/account-info.component.js.map +1 -1
- package/dist/lib/application-management/application-dialog/application-dialog.component.d.ts +92 -10
- package/dist/lib/application-management/application-dialog/application-dialog.component.d.ts.map +1 -1
- package/dist/lib/application-management/application-dialog/application-dialog.component.js +222 -76
- package/dist/lib/application-management/application-dialog/application-dialog.component.js.map +1 -1
- package/dist/lib/application-management/application-management.component.d.ts +92 -10
- package/dist/lib/application-management/application-management.component.d.ts.map +1 -1
- package/dist/lib/application-management/application-management.component.js +229 -65
- package/dist/lib/application-management/application-management.component.js.map +1 -1
- package/dist/lib/application-settings/application-settings.component.d.ts +4 -4
- package/dist/lib/application-settings/application-settings.component.js +10 -10
- package/dist/lib/application-settings/application-settings.component.js.map +1 -1
- package/dist/lib/entity-permissions/entity-permissions.component.d.ts +88 -10
- package/dist/lib/entity-permissions/entity-permissions.component.d.ts.map +1 -1
- package/dist/lib/entity-permissions/entity-permissions.component.js +219 -63
- package/dist/lib/entity-permissions/entity-permissions.component.js.map +1 -1
- package/dist/lib/entity-permissions/permission-dialog/permission-dialog.component.d.ts +44 -6
- package/dist/lib/entity-permissions/permission-dialog/permission-dialog.component.d.ts.map +1 -1
- package/dist/lib/entity-permissions/permission-dialog/permission-dialog.component.js +117 -43
- package/dist/lib/entity-permissions/permission-dialog/permission-dialog.component.js.map +1 -1
- package/dist/lib/notification-preferences/notification-preferences.component.d.ts +25 -3
- package/dist/lib/notification-preferences/notification-preferences.component.d.ts.map +1 -1
- package/dist/lib/notification-preferences/notification-preferences.component.js +62 -18
- package/dist/lib/notification-preferences/notification-preferences.component.js.map +1 -1
- package/dist/lib/role-management/role-dialog/role-dialog.component.d.ts +32 -4
- package/dist/lib/role-management/role-dialog/role-dialog.component.d.ts.map +1 -1
- package/dist/lib/role-management/role-dialog/role-dialog.component.js +84 -30
- package/dist/lib/role-management/role-dialog/role-dialog.component.js.map +1 -1
- package/dist/lib/role-management/role-management-agent-context.d.ts +12 -4
- package/dist/lib/role-management/role-management-agent-context.d.ts.map +1 -1
- package/dist/lib/role-management/role-management-agent-context.js +26 -10
- package/dist/lib/role-management/role-management-agent-context.js.map +1 -1
- package/dist/lib/role-management/role-management.component.d.ts +95 -11
- package/dist/lib/role-management/role-management.component.d.ts.map +1 -1
- package/dist/lib/role-management/role-management.component.js +259 -91
- package/dist/lib/role-management/role-management.component.js.map +1 -1
- package/dist/lib/settings/settings.component.d.ts +87 -11
- package/dist/lib/settings/settings.component.d.ts.map +1 -1
- package/dist/lib/settings/settings.component.js +211 -65
- package/dist/lib/settings/settings.component.js.map +1 -1
- package/dist/lib/shared/settings-card.component.d.ts +24 -4
- package/dist/lib/shared/settings-card.component.d.ts.map +1 -1
- package/dist/lib/shared/settings-card.component.js +46 -6
- package/dist/lib/shared/settings-card.component.js.map +1 -1
- package/dist/lib/sql-logging/sql-logging.component.d.ts +172 -18
- package/dist/lib/sql-logging/sql-logging.component.d.ts.map +1 -1
- package/dist/lib/sql-logging/sql-logging.component.js +320 -108
- package/dist/lib/sql-logging/sql-logging.component.js.map +1 -1
- package/dist/lib/user-app-config/user-app-config-content.component.js +3 -3
- package/dist/lib/user-app-config/user-app-config-content.component.js.map +1 -1
- package/dist/lib/user-app-config/user-app-config-reorder.d.ts +4 -0
- package/dist/lib/user-app-config/user-app-config-reorder.d.ts.map +1 -1
- package/dist/lib/user-app-config/user-app-config-reorder.js +11 -3
- package/dist/lib/user-app-config/user-app-config-reorder.js.map +1 -1
- package/dist/lib/user-management/transaction-group-refusals.d.ts +4 -2
- package/dist/lib/user-management/transaction-group-refusals.d.ts.map +1 -1
- package/dist/lib/user-management/transaction-group-refusals.js +7 -3
- package/dist/lib/user-management/transaction-group-refusals.js.map +1 -1
- package/dist/lib/user-management/user-dialog/user-dialog.component.d.ts +44 -6
- package/dist/lib/user-management/user-dialog/user-dialog.component.d.ts.map +1 -1
- package/dist/lib/user-management/user-dialog/user-dialog.component.js +121 -47
- package/dist/lib/user-management/user-dialog/user-dialog.component.js.map +1 -1
- package/dist/lib/user-management/user-management-agent-context.d.ts +10 -0
- package/dist/lib/user-management/user-management-agent-context.d.ts.map +1 -1
- package/dist/lib/user-management/user-management-agent-context.js +26 -6
- package/dist/lib/user-management/user-management-agent-context.js.map +1 -1
- package/dist/lib/user-management/user-management.component.d.ts +174 -16
- package/dist/lib/user-management/user-management.component.d.ts.map +1 -1
- package/dist/lib/user-management/user-management.component.js +480 -171
- package/dist/lib/user-management/user-management.component.js.map +1 -1
- package/dist/lib/user-profile-settings/user-profile-settings.component.d.ts +97 -15
- package/dist/lib/user-profile-settings/user-profile-settings.component.d.ts.map +1 -1
- package/dist/lib/user-profile-settings/user-profile-settings.component.js +280 -116
- package/dist/lib/user-profile-settings/user-profile-settings.component.js.map +1 -1
- package/package.json +20 -20
|
@@ -10,7 +10,7 @@ import { takeUntil, debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
|
10
10
|
import { RunView, CompositeKey } from '@memberjunction/core';
|
|
11
11
|
import { BaseDashboard } from '@memberjunction/ng-shared';
|
|
12
12
|
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
13
|
-
import {
|
|
13
|
+
import { BuildRoleManagementAgentContext, IsValidRoleTypeFilter, ResolveRoleByIDOrName, } from './role-management-agent-context';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
15
|
import * as i1 from "@memberjunction/ng-shared-generic";
|
|
16
16
|
import * as i2 from "@memberjunction/ng-ui-components";
|
|
@@ -239,33 +239,121 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
239
239
|
cdr;
|
|
240
240
|
ngZone;
|
|
241
241
|
// State management
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
Roles = [];
|
|
243
|
+
/** @deprecated Use {@link Roles}. */
|
|
244
|
+
get roles() {
|
|
245
|
+
return this.Roles;
|
|
246
|
+
}
|
|
247
|
+
/** @deprecated Use {@link Roles}. */
|
|
248
|
+
set roles(value) {
|
|
249
|
+
this.Roles = value;
|
|
250
|
+
}
|
|
251
|
+
FilteredRoles = [];
|
|
252
|
+
/** @deprecated Use {@link FilteredRoles}. */
|
|
253
|
+
get filteredRoles() {
|
|
254
|
+
return this.FilteredRoles;
|
|
255
|
+
}
|
|
256
|
+
/** @deprecated Use {@link FilteredRoles}. */
|
|
257
|
+
set filteredRoles(value) {
|
|
258
|
+
this.FilteredRoles = value;
|
|
259
|
+
}
|
|
260
|
+
SelectedRole = null;
|
|
261
|
+
/** @deprecated Use {@link SelectedRole}. */
|
|
262
|
+
get selectedRole() {
|
|
263
|
+
return this.SelectedRole;
|
|
264
|
+
}
|
|
265
|
+
/** @deprecated Use {@link SelectedRole}. */
|
|
266
|
+
set selectedRole(value) {
|
|
267
|
+
this.SelectedRole = value;
|
|
268
|
+
}
|
|
245
269
|
isLoading = false;
|
|
246
270
|
error = null;
|
|
247
271
|
// Dialog state
|
|
248
|
-
|
|
249
|
-
|
|
272
|
+
ShowRoleDialog = false;
|
|
273
|
+
/** @deprecated Use {@link ShowRoleDialog}. */
|
|
274
|
+
get showRoleDialog() {
|
|
275
|
+
return this.ShowRoleDialog;
|
|
276
|
+
}
|
|
277
|
+
/** @deprecated Use {@link ShowRoleDialog}. */
|
|
278
|
+
set showRoleDialog(value) {
|
|
279
|
+
this.ShowRoleDialog = value;
|
|
280
|
+
}
|
|
281
|
+
RoleDialogData = null;
|
|
282
|
+
/** @deprecated Use {@link RoleDialogData}. */
|
|
283
|
+
get roleDialogData() {
|
|
284
|
+
return this.RoleDialogData;
|
|
285
|
+
}
|
|
286
|
+
/** @deprecated Use {@link RoleDialogData}. */
|
|
287
|
+
set roleDialogData(value) {
|
|
288
|
+
this.RoleDialogData = value;
|
|
289
|
+
}
|
|
250
290
|
// Stats
|
|
251
|
-
|
|
291
|
+
Stats = {
|
|
252
292
|
totalRoles: 0,
|
|
253
293
|
systemRoles: 0,
|
|
254
294
|
customRoles: 0,
|
|
255
295
|
activeRoles: 0
|
|
256
296
|
};
|
|
297
|
+
/** @deprecated Use {@link Stats}. */
|
|
298
|
+
get stats() {
|
|
299
|
+
return this.Stats;
|
|
300
|
+
}
|
|
301
|
+
/** @deprecated Use {@link Stats}. */
|
|
302
|
+
set stats(value) {
|
|
303
|
+
this.Stats = value;
|
|
304
|
+
}
|
|
257
305
|
// Filters
|
|
258
|
-
|
|
306
|
+
Filters$ = new BehaviorSubject({
|
|
259
307
|
type: 'all',
|
|
260
308
|
search: ''
|
|
261
309
|
});
|
|
310
|
+
/** @deprecated Use {@link Filters$}. */
|
|
311
|
+
get filters$() {
|
|
312
|
+
return this.Filters$;
|
|
313
|
+
}
|
|
314
|
+
/** @deprecated Use {@link Filters$}. */
|
|
315
|
+
set filters$(value) {
|
|
316
|
+
this.Filters$ = value;
|
|
317
|
+
}
|
|
262
318
|
// UI State
|
|
263
319
|
showCreateDialog = false;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
320
|
+
ShowEditDialog = false;
|
|
321
|
+
/** @deprecated Use {@link ShowEditDialog}. */
|
|
322
|
+
get showEditDialog() {
|
|
323
|
+
return this.ShowEditDialog;
|
|
324
|
+
}
|
|
325
|
+
/** @deprecated Use {@link ShowEditDialog}. */
|
|
326
|
+
set showEditDialog(value) {
|
|
327
|
+
this.ShowEditDialog = value;
|
|
328
|
+
}
|
|
329
|
+
ShowDeleteConfirm = false;
|
|
330
|
+
/** @deprecated Use {@link ShowDeleteConfirm}. */
|
|
331
|
+
get showDeleteConfirm() {
|
|
332
|
+
return this.ShowDeleteConfirm;
|
|
333
|
+
}
|
|
334
|
+
/** @deprecated Use {@link ShowDeleteConfirm}. */
|
|
335
|
+
set showDeleteConfirm(value) {
|
|
336
|
+
this.ShowDeleteConfirm = value;
|
|
337
|
+
}
|
|
338
|
+
ExpandedRoleId = null;
|
|
339
|
+
/** @deprecated Use {@link ExpandedRoleId}. */
|
|
340
|
+
get expandedRoleId() {
|
|
341
|
+
return this.ExpandedRoleId;
|
|
342
|
+
}
|
|
343
|
+
/** @deprecated Use {@link ExpandedRoleId}. */
|
|
344
|
+
set expandedRoleId(value) {
|
|
345
|
+
this.ExpandedRoleId = value;
|
|
346
|
+
}
|
|
267
347
|
// Role permissions (simplified view)
|
|
268
|
-
|
|
348
|
+
RolePermissions = new Map();
|
|
349
|
+
/** @deprecated Use {@link RolePermissions}. */
|
|
350
|
+
get rolePermissions() {
|
|
351
|
+
return this.RolePermissions;
|
|
352
|
+
}
|
|
353
|
+
/** @deprecated Use {@link RolePermissions}. */
|
|
354
|
+
set rolePermissions(value) {
|
|
355
|
+
this.RolePermissions = value;
|
|
356
|
+
}
|
|
269
357
|
// Read-only entity-permission summary per role id (lazily loaded on selection),
|
|
270
358
|
// used only to surface a non-sensitive count summary to the agent context.
|
|
271
359
|
permissionSummaryCache = new Map();
|
|
@@ -285,7 +373,7 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
285
373
|
this.registerAgentClientTools();
|
|
286
374
|
}
|
|
287
375
|
loadData() {
|
|
288
|
-
this.
|
|
376
|
+
this.LoadInitialData();
|
|
289
377
|
}
|
|
290
378
|
// ================================================================
|
|
291
379
|
// AI Agent Context & Client Tools
|
|
@@ -308,22 +396,22 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
308
396
|
* pure {@link buildRoleManagementAgentContext} helper (unit-tested in isolation).
|
|
309
397
|
*/
|
|
310
398
|
publishAgentContext() {
|
|
311
|
-
const selected = this.
|
|
312
|
-
? this.
|
|
399
|
+
const selected = this.ExpandedRoleId
|
|
400
|
+
? this.Roles.find(r => UUIDsEqual(r.ID, this.ExpandedRoleId)) ?? null
|
|
313
401
|
: null;
|
|
314
402
|
const input = {
|
|
315
|
-
TotalRoleCount: this.
|
|
316
|
-
FilteredRoleCount: this.
|
|
317
|
-
SystemRoleCount: this.
|
|
318
|
-
CustomRoleCount: this.
|
|
319
|
-
TypeFilter: this.
|
|
320
|
-
SearchText: this.
|
|
403
|
+
TotalRoleCount: this.Roles.length,
|
|
404
|
+
FilteredRoleCount: this.FilteredRoles.length,
|
|
405
|
+
SystemRoleCount: this.Stats.systemRoles,
|
|
406
|
+
CustomRoleCount: this.Stats.customRoles,
|
|
407
|
+
TypeFilter: this.Filters$.value.type,
|
|
408
|
+
SearchText: this.Filters$.value.search,
|
|
321
409
|
SelectedRoleId: selected?.ID ?? null,
|
|
322
410
|
SelectedRoleName: selected?.Name ?? null,
|
|
323
|
-
VisibleRoleNames: this.
|
|
411
|
+
VisibleRoleNames: this.FilteredRoles.map(r => r.Name ?? '').filter(n => n !== ''),
|
|
324
412
|
SelectedRolePermissions: selected ? this.selectedRolePermissionSummary : null,
|
|
325
413
|
};
|
|
326
|
-
this.navigationService.SetAgentContext(this,
|
|
414
|
+
this.navigationService.SetAgentContext(this, BuildRoleManagementAgentContext(input));
|
|
327
415
|
}
|
|
328
416
|
/**
|
|
329
417
|
* Register the read-only / navigational client tools the agent may invoke.
|
|
@@ -372,10 +460,10 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
372
460
|
}
|
|
373
461
|
handleFilterByTypeTool(params) {
|
|
374
462
|
const type = params?.['type'];
|
|
375
|
-
if (!
|
|
463
|
+
if (!IsValidRoleTypeFilter(type)) {
|
|
376
464
|
return { Success: false, ErrorMessage: `Invalid type "${String(type)}". Expected one of: all, system, custom.` };
|
|
377
465
|
}
|
|
378
|
-
this.
|
|
466
|
+
this.OnTypeFilterChange(type);
|
|
379
467
|
this.publishAgentContext();
|
|
380
468
|
return { Success: true };
|
|
381
469
|
}
|
|
@@ -384,29 +472,29 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
384
472
|
if (typeof searchText !== 'string') {
|
|
385
473
|
return { Success: false, ErrorMessage: 'searchText must be a string.' };
|
|
386
474
|
}
|
|
387
|
-
this.
|
|
475
|
+
this.UpdateFilter({ search: searchText });
|
|
388
476
|
this.publishAgentContext();
|
|
389
477
|
return { Success: true };
|
|
390
478
|
}
|
|
391
479
|
async handleSelectRoleTool(params) {
|
|
392
480
|
const raw = String(params?.['role'] ?? '');
|
|
393
|
-
const resolved =
|
|
394
|
-
if (!resolved.
|
|
395
|
-
return { Success: false, ErrorMessage: resolved.
|
|
481
|
+
const resolved = ResolveRoleByIDOrName(raw, this.Roles.map(r => ({ ID: r.ID, Name: r.Name ?? '' })));
|
|
482
|
+
if (!resolved.Ok) {
|
|
483
|
+
return { Success: false, ErrorMessage: resolved.Error };
|
|
396
484
|
}
|
|
397
|
-
this.
|
|
398
|
-
this.selectedRolePermissionSummary = await this.loadPermissionSummary(resolved.
|
|
485
|
+
this.ExpandedRoleId = resolved.Match.ID;
|
|
486
|
+
this.selectedRolePermissionSummary = await this.loadPermissionSummary(resolved.Match.ID);
|
|
399
487
|
this.cdr.markForCheck();
|
|
400
488
|
this.publishAgentContext();
|
|
401
489
|
return { Success: true };
|
|
402
490
|
}
|
|
403
491
|
handleNavigateToRoleRecordTool(params) {
|
|
404
492
|
const raw = String(params?.['role'] ?? '');
|
|
405
|
-
const resolved =
|
|
406
|
-
if (!resolved.
|
|
407
|
-
return { Success: false, ErrorMessage: resolved.
|
|
493
|
+
const resolved = ResolveRoleByIDOrName(raw, this.Roles.map(r => ({ ID: r.ID, Name: r.Name ?? '' })));
|
|
494
|
+
if (!resolved.Ok) {
|
|
495
|
+
return { Success: false, ErrorMessage: resolved.Error };
|
|
408
496
|
}
|
|
409
|
-
this.navigationService.OpenEntityRecord('MJ: Roles', CompositeKey.FromID(resolved.
|
|
497
|
+
this.navigationService.OpenEntityRecord('MJ: Roles', CompositeKey.FromID(resolved.Match.ID));
|
|
410
498
|
return { Success: true };
|
|
411
499
|
}
|
|
412
500
|
/**
|
|
@@ -436,7 +524,7 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
436
524
|
return summary;
|
|
437
525
|
}
|
|
438
526
|
handleClearFiltersTool() {
|
|
439
|
-
this.
|
|
527
|
+
this.ResetAllFiltersAndSearch();
|
|
440
528
|
this.publishAgentContext();
|
|
441
529
|
return { Success: true };
|
|
442
530
|
}
|
|
@@ -444,7 +532,7 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
444
532
|
try {
|
|
445
533
|
this.permissionSummaryCache.clear();
|
|
446
534
|
this.selectedRolePermissionSummary = null;
|
|
447
|
-
await this.
|
|
535
|
+
await this.LoadInitialData();
|
|
448
536
|
this.publishAgentContext();
|
|
449
537
|
return { Success: true };
|
|
450
538
|
}
|
|
@@ -457,13 +545,13 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
457
545
|
this.destroy$.complete();
|
|
458
546
|
super.ngOnDestroy();
|
|
459
547
|
}
|
|
460
|
-
async
|
|
548
|
+
async LoadInitialData() {
|
|
461
549
|
try {
|
|
462
550
|
this.isLoading = true;
|
|
463
551
|
this.error = null;
|
|
464
552
|
// Load roles
|
|
465
553
|
const roles = await this.loadRoles();
|
|
466
|
-
this.
|
|
554
|
+
this.Roles = roles;
|
|
467
555
|
this.calculateStats();
|
|
468
556
|
this.applyFilters();
|
|
469
557
|
}
|
|
@@ -479,6 +567,10 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
479
567
|
});
|
|
480
568
|
}
|
|
481
569
|
}
|
|
570
|
+
/** @deprecated Use {@link LoadInitialData}. */
|
|
571
|
+
async loadInitialData() {
|
|
572
|
+
return this.LoadInitialData();
|
|
573
|
+
}
|
|
482
574
|
async loadRoles() {
|
|
483
575
|
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
484
576
|
const result = await rv.RunView({
|
|
@@ -489,7 +581,7 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
489
581
|
return result.Success ? result.Results : [];
|
|
490
582
|
}
|
|
491
583
|
setupFilterSubscription() {
|
|
492
|
-
this.
|
|
584
|
+
this.Filters$
|
|
493
585
|
.pipe(debounceTime(300), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)), takeUntil(this.destroy$))
|
|
494
586
|
.subscribe(() => {
|
|
495
587
|
this.applyFilters();
|
|
@@ -497,12 +589,12 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
497
589
|
});
|
|
498
590
|
}
|
|
499
591
|
applyFilters() {
|
|
500
|
-
const filters = this.
|
|
501
|
-
let filtered = [...this.
|
|
592
|
+
const filters = this.Filters$.value;
|
|
593
|
+
let filtered = [...this.Roles];
|
|
502
594
|
// Apply type filter
|
|
503
595
|
if (filters.type !== 'all') {
|
|
504
596
|
filtered = filtered.filter(role => {
|
|
505
|
-
const isSystem = this.
|
|
597
|
+
const isSystem = this.IsSystemRole(role);
|
|
506
598
|
return filters.type === 'system' ? isSystem : !isSystem;
|
|
507
599
|
});
|
|
508
600
|
}
|
|
@@ -512,29 +604,37 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
512
604
|
filtered = filtered.filter(role => role.Name?.toLowerCase().includes(searchLower) ||
|
|
513
605
|
role.Description?.toLowerCase().includes(searchLower));
|
|
514
606
|
}
|
|
515
|
-
this.
|
|
607
|
+
this.FilteredRoles = filtered;
|
|
516
608
|
}
|
|
517
609
|
calculateStats() {
|
|
518
|
-
const systemRoles = this.
|
|
519
|
-
this.
|
|
520
|
-
totalRoles: this.
|
|
610
|
+
const systemRoles = this.Roles.filter(r => this.IsSystemRole(r));
|
|
611
|
+
this.Stats = {
|
|
612
|
+
totalRoles: this.Roles.length,
|
|
521
613
|
systemRoles: systemRoles.length,
|
|
522
|
-
customRoles: this.
|
|
523
|
-
activeRoles: this.
|
|
614
|
+
customRoles: this.Roles.length - systemRoles.length,
|
|
615
|
+
activeRoles: this.Roles.length // All roles are considered active for now
|
|
524
616
|
};
|
|
525
617
|
}
|
|
526
|
-
|
|
618
|
+
IsSystemRole(role) {
|
|
527
619
|
// System roles typically have certain naming patterns or flags
|
|
528
620
|
const systemRoleNames = ['Administrator', 'User', 'Guest', 'Developer'];
|
|
529
621
|
return systemRoleNames.includes(role.Name || '');
|
|
530
622
|
}
|
|
623
|
+
/** @deprecated Use {@link IsSystemRole}. */
|
|
624
|
+
isSystemRole(role) {
|
|
625
|
+
return this.IsSystemRole(role);
|
|
626
|
+
}
|
|
531
627
|
// Public methods for template
|
|
628
|
+
OnTypeFilterChange(type) {
|
|
629
|
+
this.UpdateFilter({ type });
|
|
630
|
+
}
|
|
631
|
+
/** @deprecated Use {@link OnTypeFilterChange}. */
|
|
532
632
|
onTypeFilterChange(type) {
|
|
533
|
-
this.
|
|
633
|
+
return this.OnTypeFilterChange(type);
|
|
534
634
|
}
|
|
535
|
-
|
|
536
|
-
this.
|
|
537
|
-
...this.
|
|
635
|
+
UpdateFilter(partial) {
|
|
636
|
+
this.Filters$.next({
|
|
637
|
+
...this.Filters$.value,
|
|
538
638
|
...partial
|
|
539
639
|
});
|
|
540
640
|
// Discrete changes (chips) apply immediately. Text search still goes
|
|
@@ -544,8 +644,12 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
544
644
|
this.cdr.markForCheck();
|
|
545
645
|
}
|
|
546
646
|
}
|
|
647
|
+
/** @deprecated Use {@link UpdateFilter}. */
|
|
648
|
+
updateFilter(partial) {
|
|
649
|
+
return this.UpdateFilter(partial);
|
|
650
|
+
}
|
|
547
651
|
// -- Concise chrome: one Filter popover (Type) + applied-filter chips -------
|
|
548
|
-
get
|
|
652
|
+
get FilterFields() {
|
|
549
653
|
return [
|
|
550
654
|
{
|
|
551
655
|
key: 'type',
|
|
@@ -559,41 +663,61 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
559
663
|
},
|
|
560
664
|
];
|
|
561
665
|
}
|
|
666
|
+
/** @deprecated Use {@link FilterFields}. */
|
|
667
|
+
get filterFields() {
|
|
668
|
+
return this.FilterFields;
|
|
669
|
+
}
|
|
670
|
+
get FilterValues() {
|
|
671
|
+
return { type: this.Filters$.value.type };
|
|
672
|
+
}
|
|
673
|
+
/** @deprecated Use {@link FilterValues}. */
|
|
562
674
|
get filterValues() {
|
|
563
|
-
return
|
|
675
|
+
return this.FilterValues;
|
|
564
676
|
}
|
|
565
677
|
/** Total active filters (Type) — drives the Filter button badge. */
|
|
566
678
|
get TotalActiveFilterCount() {
|
|
567
|
-
return this.
|
|
679
|
+
return this.Filters$.value.type !== 'all' ? 1 : 0;
|
|
568
680
|
}
|
|
569
|
-
|
|
681
|
+
OnFilterPanelChange(values) {
|
|
570
682
|
if ('type' in values) {
|
|
571
|
-
this.
|
|
683
|
+
this.UpdateFilter({ type: values['type'] || 'all' });
|
|
572
684
|
}
|
|
573
685
|
}
|
|
686
|
+
/** @deprecated Use {@link OnFilterPanelChange}. */
|
|
687
|
+
onFilterPanelChange(values) {
|
|
688
|
+
return this.OnFilterPanelChange(values);
|
|
689
|
+
}
|
|
574
690
|
/** Clear all filters (Type); search persists. */
|
|
691
|
+
ClearAllAppliedFilters() {
|
|
692
|
+
this.UpdateFilter({ type: 'all' });
|
|
693
|
+
}
|
|
694
|
+
/** @deprecated Use {@link ClearAllAppliedFilters}. */
|
|
575
695
|
clearAllAppliedFilters() {
|
|
576
|
-
this.
|
|
696
|
+
return this.ClearAllAppliedFilters();
|
|
577
697
|
}
|
|
578
698
|
/** True when search and/or panel filters are narrowing the list — gates the
|
|
579
699
|
* no-results empty-state "Reset filters" CTA. */
|
|
580
700
|
get IsListNarrowed() {
|
|
581
|
-
return this.
|
|
701
|
+
return this.Filters$.value.search !== '' || this.TotalActiveFilterCount > 0;
|
|
582
702
|
}
|
|
583
703
|
/** Reset everything narrowing the list (search + Type) and refresh
|
|
584
704
|
* immediately. Wired to the no-results empty-state CTA. Unlike
|
|
585
705
|
* clearAllAppliedFilters(), this also clears the search box. */
|
|
586
|
-
|
|
587
|
-
this.
|
|
706
|
+
ResetAllFiltersAndSearch() {
|
|
707
|
+
this.Filters$.next({ type: 'all', search: '' });
|
|
588
708
|
this.applyFilters();
|
|
589
709
|
this.cdr.markForCheck();
|
|
590
710
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
711
|
+
/** @deprecated Use {@link ResetAllFiltersAndSearch}. */
|
|
712
|
+
resetAllFiltersAndSearch() {
|
|
713
|
+
return this.ResetAllFiltersAndSearch();
|
|
714
|
+
}
|
|
715
|
+
ToggleRoleExpansion(roleId) {
|
|
716
|
+
this.ExpandedRoleId = this.ExpandedRoleId === roleId ? null : roleId;
|
|
717
|
+
if (this.ExpandedRoleId) {
|
|
594
718
|
// Lazy-load the read-only permission summary so the agent context reflects
|
|
595
719
|
// the user's current selection; fire-and-forget (re-publishes on completion).
|
|
596
|
-
void this.loadPermissionSummary(this.
|
|
720
|
+
void this.loadPermissionSummary(this.ExpandedRoleId).then(summary => {
|
|
597
721
|
this.selectedRolePermissionSummary = summary;
|
|
598
722
|
this.publishAgentContext();
|
|
599
723
|
});
|
|
@@ -603,39 +727,59 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
603
727
|
}
|
|
604
728
|
this.publishAgentContext();
|
|
605
729
|
}
|
|
730
|
+
/** @deprecated Use {@link ToggleRoleExpansion}. */
|
|
731
|
+
toggleRoleExpansion(roleId) {
|
|
732
|
+
return this.ToggleRoleExpansion(roleId);
|
|
733
|
+
}
|
|
734
|
+
IsRoleExpanded(roleId) {
|
|
735
|
+
return this.ExpandedRoleId === roleId;
|
|
736
|
+
}
|
|
737
|
+
/** @deprecated Use {@link IsRoleExpanded}. */
|
|
606
738
|
isRoleExpanded(roleId) {
|
|
607
|
-
return this.
|
|
739
|
+
return this.IsRoleExpanded(roleId);
|
|
608
740
|
}
|
|
609
|
-
|
|
610
|
-
this.
|
|
741
|
+
CreateNewRole() {
|
|
742
|
+
this.RoleDialogData = {
|
|
611
743
|
mode: 'create'
|
|
612
744
|
};
|
|
613
|
-
this.
|
|
745
|
+
this.ShowRoleDialog = true;
|
|
614
746
|
}
|
|
615
|
-
|
|
616
|
-
|
|
747
|
+
/** @deprecated Use {@link CreateNewRole}. */
|
|
748
|
+
createNewRole() {
|
|
749
|
+
return this.CreateNewRole();
|
|
750
|
+
}
|
|
751
|
+
EditRole(role) {
|
|
752
|
+
this.RoleDialogData = {
|
|
617
753
|
role: role,
|
|
618
754
|
mode: 'edit'
|
|
619
755
|
};
|
|
620
|
-
this.
|
|
756
|
+
this.ShowRoleDialog = true;
|
|
757
|
+
}
|
|
758
|
+
/** @deprecated Use {@link EditRole}. */
|
|
759
|
+
editRole(role) {
|
|
760
|
+
return this.EditRole(role);
|
|
761
|
+
}
|
|
762
|
+
ConfirmDeleteRole(role) {
|
|
763
|
+
this.SelectedRole = role;
|
|
764
|
+
this.ShowDeleteConfirm = true;
|
|
621
765
|
}
|
|
766
|
+
/** @deprecated Use {@link ConfirmDeleteRole}. */
|
|
622
767
|
confirmDeleteRole(role) {
|
|
623
|
-
this.
|
|
624
|
-
this.showDeleteConfirm = true;
|
|
768
|
+
return this.ConfirmDeleteRole(role);
|
|
625
769
|
}
|
|
626
|
-
async
|
|
627
|
-
if (!this.
|
|
770
|
+
async DeleteRole() {
|
|
771
|
+
if (!this.SelectedRole)
|
|
628
772
|
return;
|
|
629
773
|
try {
|
|
630
774
|
// Load role entity to delete
|
|
631
775
|
const role = await this.metadata.GetEntityObject('MJ: Roles');
|
|
632
|
-
const loadResult = await role.Load(this.
|
|
776
|
+
const loadResult = await role.Load(this.SelectedRole.ID);
|
|
633
777
|
if (loadResult) {
|
|
634
778
|
const deleteResult = await role.Delete();
|
|
635
779
|
if (deleteResult) {
|
|
636
|
-
this.
|
|
637
|
-
this.
|
|
638
|
-
await this.
|
|
780
|
+
this.ShowDeleteConfirm = false;
|
|
781
|
+
this.SelectedRole = null;
|
|
782
|
+
await this.LoadInitialData();
|
|
639
783
|
}
|
|
640
784
|
else {
|
|
641
785
|
throw new Error(role.LatestResult?.Message || 'Failed to delete role');
|
|
@@ -653,29 +797,53 @@ let RoleManagementComponent = class RoleManagementComponent extends BaseDashboar
|
|
|
653
797
|
});
|
|
654
798
|
}
|
|
655
799
|
}
|
|
656
|
-
|
|
657
|
-
|
|
800
|
+
/** @deprecated Use {@link DeleteRole}. */
|
|
801
|
+
async deleteRole() {
|
|
802
|
+
return this.DeleteRole();
|
|
803
|
+
}
|
|
804
|
+
GetRoleIcon(role) {
|
|
805
|
+
if (this.IsSystemRole(role)) {
|
|
658
806
|
return 'fa-shield-halved';
|
|
659
807
|
}
|
|
660
808
|
return 'fa-user-tag';
|
|
661
809
|
}
|
|
810
|
+
/** @deprecated Use {@link GetRoleIcon}. */
|
|
811
|
+
getRoleIcon(role) {
|
|
812
|
+
return this.GetRoleIcon(role);
|
|
813
|
+
}
|
|
814
|
+
GetRoleTypeLabel(role) {
|
|
815
|
+
return this.IsSystemRole(role) ? 'System' : 'Custom';
|
|
816
|
+
}
|
|
817
|
+
/** @deprecated Use {@link GetRoleTypeLabel}. */
|
|
662
818
|
getRoleTypeLabel(role) {
|
|
663
|
-
return this.
|
|
819
|
+
return this.GetRoleTypeLabel(role);
|
|
820
|
+
}
|
|
821
|
+
GetRoleTypeClass(role) {
|
|
822
|
+
return this.IsSystemRole(role) ? 'badge-system' : 'badge-custom';
|
|
664
823
|
}
|
|
824
|
+
/** @deprecated Use {@link GetRoleTypeClass}. */
|
|
665
825
|
getRoleTypeClass(role) {
|
|
666
|
-
return this.
|
|
826
|
+
return this.GetRoleTypeClass(role);
|
|
667
827
|
}
|
|
828
|
+
RefreshData() {
|
|
829
|
+
this.LoadInitialData();
|
|
830
|
+
}
|
|
831
|
+
/** @deprecated Use {@link RefreshData}. */
|
|
668
832
|
refreshData() {
|
|
669
|
-
this.
|
|
833
|
+
return this.RefreshData();
|
|
670
834
|
}
|
|
671
|
-
|
|
672
|
-
this.
|
|
673
|
-
this.
|
|
835
|
+
OnRoleDialogResult(result) {
|
|
836
|
+
this.ShowRoleDialog = false;
|
|
837
|
+
this.RoleDialogData = null;
|
|
674
838
|
if (result.action === 'save') {
|
|
675
839
|
// Refresh the role list to show changes
|
|
676
|
-
this.
|
|
840
|
+
this.LoadInitialData();
|
|
677
841
|
}
|
|
678
842
|
}
|
|
843
|
+
/** @deprecated Use {@link OnRoleDialogResult}. */
|
|
844
|
+
onRoleDialogResult(result) {
|
|
845
|
+
return this.OnRoleDialogResult(result);
|
|
846
|
+
}
|
|
679
847
|
static ɵfac = function RoleManagementComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RoleManagementComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.NgZone)); };
|
|
680
848
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RoleManagementComponent, selectors: [["mj-role-management"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 14, consts: [["AriaLabel", "Filter roles", "Title", "Roles", "Subtitle", "Define system and custom roles for permissions"], ["meta", ""], ["Label", "roles", 3, "Count", "Total"], ["toolbar", ""], ["Placeholder", "Search roles by name or description...", 3, "ValueChange", "Value"], ["Label", "Filters", "Icon", "fa-solid fa-filter", 3, "ClearAllRequested", "ActiveCount", "ShowClearAll"], [3, "ValuesChange", "Reset", "Fields", "Values"], ["actions", ""], [3, "Clicked", "Loading"], ["mjButton", "", "variant", "primary", "size", "sm", "aria-label", "Add new role", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "mj-action-label"], ["role", "status", "aria-live", "polite", "aria-busy", "true", 1, "loading-container"], ["role", "alert", "aria-live", "assertive", 1, "error-container"], ["role", "list", "aria-label", "Roles list", 1, "roles-list"], [3, "result", "data", "visible"], ["role", "presentation", 1, "modal-backdrop"], ["text", "Loading roles...", "size", "medium"], [1, "error-content"], ["aria-hidden", "true", 1, "fa-solid", "fa-exclamation-triangle", "error-icon"], [1, "error-message"], ["mjButton", "", "variant", "primary", "aria-label", "Retry loading roles", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-refresh"], ["role", "listitem", 1, "role-card", 3, "expanded"], ["Icon", "fa-solid fa-user-tag", "Title", "No roles found", "Message", "Try adjusting your filters or create a new role", "ActionIcon", "fa-solid fa-rotate-left", 3, "Variant", "ActionText"], ["role", "listitem", 1, "role-card"], ["tabindex", "0", "role", "button", 1, "role-header", 3, "click", "keydown.enter", "keydown.space"], [1, "role-info"], ["aria-hidden", "true", 1, "role-icon-wrapper"], [1, "role-details"], [1, "role-name"], [1, "role-description"], [1, "role-meta"], [1, "role-type-badge"], [1, "role-actions", 3, "click"], ["mjButton", "", "variant", "flat", "size", "sm", "title", "Edit", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-edit"], ["mjButton", "", "variant", "danger", "size", "sm", "title", "Delete", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash"], ["aria-label", "Toggle details", 1, "expand-btn"], ["aria-hidden", "true", 1, "fa-solid", "fa-chevron-down"], [1, "role-content"], [1, "mobile-actions-bar", 3, "click"], [1, "mobile-action-buttons"], [1, "btn-label"], [1, "role-stats"], [1, "stat-item"], ["aria-hidden", "true", 1, "fa-solid", "fa-users"], [1, "stat-label"], [1, "stat-value"], ["aria-hidden", "true", 1, "fa-solid", "fa-calendar"], ["aria-hidden", "true", 1, "fa-solid", "fa-clock"], [1, "permissions-preview"], [1, "section-title"], ["aria-hidden", "true", 1, "fa-solid", "fa-key"], [1, "permissions-note"], ["Icon", "fa-solid fa-user-tag", "Title", "No roles found", "Message", "Try adjusting your filters or create a new role", "ActionIcon", "fa-solid fa-rotate-left", 3, "Action", "Variant", "ActionText"], ["role", "presentation", 1, "modal-backdrop", 3, "click"], ["role", "dialog", "aria-modal", "true", "aria-labelledby", "delete-dialog-title", "aria-describedby", "delete-dialog-desc", 1, "modal-dialog", 3, "click"], [1, "modal-header"], ["id", "delete-dialog-title", 1, "modal-title"], ["aria-hidden", "true", 1, "fa-solid", "fa-exclamation-triangle", "text-danger"], ["aria-label", "Close dialog", 1, "modal-close", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-times"], ["id", "delete-dialog-desc", 1, "modal-body"], ["Variant", "warning", "Message", "This will affect all users assigned to this role."], [1, "modal-footer"], ["mjButton", "", "variant", "danger", 3, "click", "disabled"], ["mjButton", "", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-spinner", "fa-spin"]], template: function RoleManagementComponent_Template(rf, ctx) { if (rf & 1) {
|
|
681
849
|
i0.ɵɵelementStart(0, "mj-page-header-interior", 0)(1, "div", 1);
|