@flusys/ng-auth 8.0.0-beta.1 → 8.0.0
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Service, signal, computed, effect, PLATFORM_ID, InjectionToken, Component, untracked, viewChild, DestroyRef, DOCUMENT,
|
|
3
|
+
import { inject, Service, signal, computed, effect, PLATFORM_ID, InjectionToken, Component, input, output, untracked, viewChild, DestroyRef, DOCUMENT, Injector, resource, makeStateKey, TransferState } from '@angular/core';
|
|
4
4
|
import { APP_CONFIG, getServiceUrl, isCompanyFeatureEnabled, isServiceEnabled, isSignUpEnabled, getPermissionMode, getDefaultCompanySlug, getDefaultBranchSlug } from '@flusys/ng-core';
|
|
5
|
-
import { of, timeout, switchMap, map, tap, catchError, shareReplay, finalize, BehaviorSubject, throwError, filter, take, from,
|
|
5
|
+
import { of, timeout, switchMap, map, tap, catchError, shareReplay, finalize, BehaviorSubject, throwError, filter, take, from, firstValueFrom, forkJoin } from 'rxjs';
|
|
6
6
|
import { Router, RouterOutlet, ActivatedRoute, RouterLink } from '@angular/router';
|
|
7
7
|
import { PlatformService, PermissionValidatorService, ApiResourceService, CookieService, TranslateService, USER_PERMISSIONS, COMPANY_PERMISSIONS, BRANCH_PERMISSIONS, SOCIAL_AUTH_CONFIG_PERMISSIONS, resolveTranslationModule, SHARED_MESSAGES, permissionGuard, USER_PROVIDER, COMPANY_API_PROVIDER, USER_PERMISSION_PROVIDER, AUTH_STATE_PROVIDER, RouterTabsComponent, TranslatePipe, HasPermissionDirective, BaseFormComponent, BaseListComponent, BaseListTemplateDirective, FileUrlService, FILE_PROVIDER, PROFILE_PERMISSION_PROVIDER, FileUploaderComponent } from '@flusys/ng-shared';
|
|
8
8
|
import { map as map$1, catchError as catchError$1, tap as tap$1 } from 'rxjs/operators';
|
|
9
9
|
import { isPlatformBrowser, NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
|
|
10
|
-
import { MessageService, CardComponent, CheckboxComponent, FButtonDirective, InputTextDirective, SelectComponent, UiIconComponent, ConfirmationService,
|
|
10
|
+
import { MessageService, CardComponent, CheckboxComponent, FButtonDirective, InputTextDirective, SelectComponent, UiIconComponent, ConfirmationService, DialogComponent, ProgressSpinnerComponent, TooltipDirective, TableComponent, TagComponent, PasswordComponent, AvatarComponent, SkeletonComponent, TextareaDirective, ToggleSwitchComponent } from '@flusys/ng-ui';
|
|
11
11
|
import { LAYOUT_AUTH_STATE, LAYOUT_AUTH_API, AppFloatingConfigurator } from '@flusys/ng-layout';
|
|
12
12
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
13
|
import { form, required, FormField, email, minLength } from '@angular/forms/signals';
|
|
@@ -598,6 +598,17 @@ class UserPermissionApiService {
|
|
|
598
598
|
...(companyId && { companyId }),
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
|
+
// Reverse Lookups (target -> users)
|
|
602
|
+
getCompanyUsers(companyId) {
|
|
603
|
+
return this.http.post(`${this.baseUrl}/get-company-users`, {
|
|
604
|
+
companyId,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
getBranchUsers(branchId) {
|
|
608
|
+
return this.http.post(`${this.baseUrl}/get-branch-users`, {
|
|
609
|
+
branchId,
|
|
610
|
+
});
|
|
611
|
+
}
|
|
601
612
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UserPermissionApiService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
602
613
|
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: UserPermissionApiService });
|
|
603
614
|
}
|
|
@@ -1053,6 +1064,11 @@ const AUTH_MESSAGES = {
|
|
|
1053
1064
|
'administrative.company.add': 'Add Company',
|
|
1054
1065
|
'administrative.branch.view.branches': 'View Branches',
|
|
1055
1066
|
'administrative.company.delete.title': 'Delete Company',
|
|
1067
|
+
// components/company-permitted-users-dialog.component.ts, components/branch-permitted-users-dialog.component.ts
|
|
1068
|
+
'administrative.permission.view.users': 'View Users',
|
|
1069
|
+
'administrative.permission.no.users': 'No users found',
|
|
1070
|
+
'administrative.permission.remove': 'Remove Access',
|
|
1071
|
+
'administrative.permission.remove.confirm': 'Remove access for {{name}}?',
|
|
1056
1072
|
// pages/users/user-form.component.ts
|
|
1057
1073
|
'administrative.user.edit': 'Edit User',
|
|
1058
1074
|
'administrative.user.new': 'New User',
|
|
@@ -1481,6 +1497,29 @@ class AuthUserProviderAdapter {
|
|
|
1481
1497
|
meta: response.meta,
|
|
1482
1498
|
})));
|
|
1483
1499
|
}
|
|
1500
|
+
getUsersByIds(ids) {
|
|
1501
|
+
if (ids.length === 0) {
|
|
1502
|
+
const empty = {
|
|
1503
|
+
success: true,
|
|
1504
|
+
message: '',
|
|
1505
|
+
data: [],
|
|
1506
|
+
meta: { total: 0, page: 0, pageSize: 0, count: 0 },
|
|
1507
|
+
};
|
|
1508
|
+
return from(Promise.resolve(empty));
|
|
1509
|
+
}
|
|
1510
|
+
return from(this.userApi.findByIds(ids, ['id', 'name', 'email'])).pipe(map((response) => ({
|
|
1511
|
+
success: response.success,
|
|
1512
|
+
message: response.message,
|
|
1513
|
+
messageKey: response.messageKey,
|
|
1514
|
+
messageVariables: response.messageVariables,
|
|
1515
|
+
data: (response.data ?? []).map((user) => ({
|
|
1516
|
+
id: user.id,
|
|
1517
|
+
name: user.name || user.email,
|
|
1518
|
+
email: user.email,
|
|
1519
|
+
})),
|
|
1520
|
+
meta: response.meta,
|
|
1521
|
+
})));
|
|
1522
|
+
}
|
|
1484
1523
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: AuthUserProviderAdapter, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
1485
1524
|
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: AuthUserProviderAdapter, autoProvided: false });
|
|
1486
1525
|
}
|
|
@@ -2237,9 +2276,245 @@ var branchForm_component = /*#__PURE__*/Object.freeze({
|
|
|
2237
2276
|
BranchFormComponent: BranchFormComponent
|
|
2238
2277
|
});
|
|
2239
2278
|
|
|
2279
|
+
/**
|
|
2280
|
+
* Read-only viewer for users permitted against a branch, with a remove-only
|
|
2281
|
+
* action per user. Assigning new users stays on the user-centric permission
|
|
2282
|
+
* flow (`UserBranchPermissionDialogComponent`) — this dialog intentionally
|
|
2283
|
+
* has no "add" affordance.
|
|
2284
|
+
*/
|
|
2285
|
+
class BranchPermittedUsersDialogComponent {
|
|
2286
|
+
USER_PERMISSIONS = USER_PERMISSIONS;
|
|
2287
|
+
permissionApi = inject(UserPermissionApiService);
|
|
2288
|
+
confirmationService = inject(ConfirmationService);
|
|
2289
|
+
messageService = inject(MessageService);
|
|
2290
|
+
translateAdapter = inject(TranslateService, {
|
|
2291
|
+
optional: true,
|
|
2292
|
+
});
|
|
2293
|
+
t(key, params) {
|
|
2294
|
+
return this.translateAdapter?.translate(key, params) ?? key;
|
|
2295
|
+
}
|
|
2296
|
+
visible = input.required(/* @ts-ignore */
|
|
2297
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
2298
|
+
branch = input.required(/* @ts-ignore */
|
|
2299
|
+
...(ngDevMode ? [{ debugName: "branch" }] : /* istanbul ignore next */ []));
|
|
2300
|
+
closed = output();
|
|
2301
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
2302
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
2303
|
+
isRemoving = signal(false, /* @ts-ignore */
|
|
2304
|
+
...(ngDevMode ? [{ debugName: "isRemoving" }] : /* istanbul ignore next */ []));
|
|
2305
|
+
users = signal([], /* @ts-ignore */
|
|
2306
|
+
...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
|
|
2307
|
+
constructor() {
|
|
2308
|
+
effect(() => {
|
|
2309
|
+
if (this.visible() && this.branch()) {
|
|
2310
|
+
this.loadUsers();
|
|
2311
|
+
}
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
async loadUsers() {
|
|
2315
|
+
const branch = this.branch();
|
|
2316
|
+
if (!branch)
|
|
2317
|
+
return;
|
|
2318
|
+
this.isLoading.set(true);
|
|
2319
|
+
try {
|
|
2320
|
+
const response = await firstValueFrom(this.permissionApi.getBranchUsers(branch.id));
|
|
2321
|
+
this.users.set(response.data ?? []);
|
|
2322
|
+
}
|
|
2323
|
+
catch {
|
|
2324
|
+
// Error toast handled by global interceptor
|
|
2325
|
+
}
|
|
2326
|
+
finally {
|
|
2327
|
+
this.isLoading.set(false);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
onRemove(user) {
|
|
2331
|
+
const branch = this.branch();
|
|
2332
|
+
if (!branch)
|
|
2333
|
+
return;
|
|
2334
|
+
this.confirmationService.confirm({
|
|
2335
|
+
message: this.t('administrative.permission.remove.confirm', {
|
|
2336
|
+
name: user.userName,
|
|
2337
|
+
}),
|
|
2338
|
+
header: this.t('administrative.permission.remove'),
|
|
2339
|
+
icon: 'exclamation-triangle',
|
|
2340
|
+
acceptButtonStyleClass: 'p-button-danger',
|
|
2341
|
+
accept: async () => {
|
|
2342
|
+
this.isRemoving.set(true);
|
|
2343
|
+
try {
|
|
2344
|
+
const response = await firstValueFrom(this.permissionApi.revokeUserFromBranch(user.userId, branch.id));
|
|
2345
|
+
if (response.success) {
|
|
2346
|
+
this.users.update((list) => list.filter((u) => u.id !== user.id));
|
|
2347
|
+
this.messageService.add({
|
|
2348
|
+
severity: 'success',
|
|
2349
|
+
summary: this.t('shared.success'),
|
|
2350
|
+
detail: response?.messageKey
|
|
2351
|
+
? this.t(response.messageKey, response.messageVariables)
|
|
2352
|
+
: (response?.message ?? ''),
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
catch {
|
|
2357
|
+
// Error toast handled by global interceptor
|
|
2358
|
+
}
|
|
2359
|
+
finally {
|
|
2360
|
+
this.isRemoving.set(false);
|
|
2361
|
+
}
|
|
2362
|
+
},
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
onClose() {
|
|
2366
|
+
this.closed.emit();
|
|
2367
|
+
}
|
|
2368
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BranchPermittedUsersDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BranchPermittedUsersDialogComponent, isStandalone: true, selector: "lib-branch-permitted-users-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: true, transformFunction: null }, branch: { classPropertyName: "branch", publicName: "branch", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: `
|
|
2370
|
+
<f-dialog
|
|
2371
|
+
[visible]="visible()"
|
|
2372
|
+
[modal]="true"
|
|
2373
|
+
[closable]="true"
|
|
2374
|
+
[breakpoints]="{ '960px': '90vw', '640px': '95vw' }"
|
|
2375
|
+
[style]="{ width: '50vw', maxWidth: '600px' }"
|
|
2376
|
+
[header]="'administrative.permission.view.users' | translate"
|
|
2377
|
+
(onHide)="onClose()"
|
|
2378
|
+
>
|
|
2379
|
+
<div class="mb-4">
|
|
2380
|
+
<p class="text-sm text-muted-color">
|
|
2381
|
+
{{ 'administrative.branch.title' | translate }}:
|
|
2382
|
+
<strong>{{ branch()?.name }}</strong>
|
|
2383
|
+
</p>
|
|
2384
|
+
</div>
|
|
2385
|
+
|
|
2386
|
+
@if (isLoading()) {
|
|
2387
|
+
<div class="flex justify-center items-center py-8">
|
|
2388
|
+
<f-progressspinner />
|
|
2389
|
+
</div>
|
|
2390
|
+
} @else {
|
|
2391
|
+
<div class="flex flex-col gap-3">
|
|
2392
|
+
@for (user of users(); track user.id) {
|
|
2393
|
+
<div
|
|
2394
|
+
class="flex items-center justify-between p-3 border border-surface rounded"
|
|
2395
|
+
>
|
|
2396
|
+
<div>
|
|
2397
|
+
<div class="font-semibold">{{ user.userName }}</div>
|
|
2398
|
+
<div class="text-sm text-muted-color">{{ user.userEmail }}</div>
|
|
2399
|
+
</div>
|
|
2400
|
+
<button
|
|
2401
|
+
fButton
|
|
2402
|
+
*hasPermission="USER_PERMISSIONS.UPDATE"
|
|
2403
|
+
[text]="true"
|
|
2404
|
+
severity="danger"
|
|
2405
|
+
size="small"
|
|
2406
|
+
[disabled]="isRemoving()"
|
|
2407
|
+
[fTooltip]="'shared.remove' | translate"
|
|
2408
|
+
(click)="onRemove(user)"
|
|
2409
|
+
>
|
|
2410
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2411
|
+
</button>
|
|
2412
|
+
</div>
|
|
2413
|
+
} @empty {
|
|
2414
|
+
<div class="text-center py-4 text-muted-color">
|
|
2415
|
+
{{ 'administrative.permission.no.users' | translate }}
|
|
2416
|
+
</div>
|
|
2417
|
+
}
|
|
2418
|
+
</div>
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
<ng-template #footer>
|
|
2422
|
+
<button
|
|
2423
|
+
fButton
|
|
2424
|
+
severity="secondary"
|
|
2425
|
+
[outlined]="true"
|
|
2426
|
+
(click)="onClose()"
|
|
2427
|
+
>
|
|
2428
|
+
<span pButtonLabel>{{ 'shared.close' | translate }}</span>
|
|
2429
|
+
</button>
|
|
2430
|
+
</ng-template>
|
|
2431
|
+
</f-dialog>
|
|
2432
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DialogComponent, selector: "f-dialog", inputs: ["header", "visible", "modal", "closable", "closeOnEscape", "dismissableMask", "resizable", "draggable", "maximizable", "blockScroll", "returnFocusOnClose", "position", "style", "styleClass", "breakpoints"], outputs: ["visibleChange", "onShow", "onHide", "onMaximize"] }, { kind: "directive", type: FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "variant", "rounded", "raised", "fluid", "disabled", "loading", "loadingIcon", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: ProgressSpinnerComponent, selector: "f-progressspinner", inputs: ["size", "strokeWidth", "animationDuration", "styleClass", "ariaLabel"] }, { kind: "directive", type: TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "positionStyle", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay", "life", "autoHide", "positionTop", "positionLeft", "escape"] }, { kind: "component", type: UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill", "severity"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2433
|
+
}
|
|
2434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BranchPermittedUsersDialogComponent, decorators: [{
|
|
2435
|
+
type: Component,
|
|
2436
|
+
args: [{
|
|
2437
|
+
selector: 'lib-branch-permitted-users-dialog',
|
|
2438
|
+
imports: [
|
|
2439
|
+
DialogComponent,
|
|
2440
|
+
FButtonDirective,
|
|
2441
|
+
ProgressSpinnerComponent,
|
|
2442
|
+
TooltipDirective,
|
|
2443
|
+
UiIconComponent,
|
|
2444
|
+
HasPermissionDirective,
|
|
2445
|
+
TranslatePipe,
|
|
2446
|
+
],
|
|
2447
|
+
template: `
|
|
2448
|
+
<f-dialog
|
|
2449
|
+
[visible]="visible()"
|
|
2450
|
+
[modal]="true"
|
|
2451
|
+
[closable]="true"
|
|
2452
|
+
[breakpoints]="{ '960px': '90vw', '640px': '95vw' }"
|
|
2453
|
+
[style]="{ width: '50vw', maxWidth: '600px' }"
|
|
2454
|
+
[header]="'administrative.permission.view.users' | translate"
|
|
2455
|
+
(onHide)="onClose()"
|
|
2456
|
+
>
|
|
2457
|
+
<div class="mb-4">
|
|
2458
|
+
<p class="text-sm text-muted-color">
|
|
2459
|
+
{{ 'administrative.branch.title' | translate }}:
|
|
2460
|
+
<strong>{{ branch()?.name }}</strong>
|
|
2461
|
+
</p>
|
|
2462
|
+
</div>
|
|
2463
|
+
|
|
2464
|
+
@if (isLoading()) {
|
|
2465
|
+
<div class="flex justify-center items-center py-8">
|
|
2466
|
+
<f-progressspinner />
|
|
2467
|
+
</div>
|
|
2468
|
+
} @else {
|
|
2469
|
+
<div class="flex flex-col gap-3">
|
|
2470
|
+
@for (user of users(); track user.id) {
|
|
2471
|
+
<div
|
|
2472
|
+
class="flex items-center justify-between p-3 border border-surface rounded"
|
|
2473
|
+
>
|
|
2474
|
+
<div>
|
|
2475
|
+
<div class="font-semibold">{{ user.userName }}</div>
|
|
2476
|
+
<div class="text-sm text-muted-color">{{ user.userEmail }}</div>
|
|
2477
|
+
</div>
|
|
2478
|
+
<button
|
|
2479
|
+
fButton
|
|
2480
|
+
*hasPermission="USER_PERMISSIONS.UPDATE"
|
|
2481
|
+
[text]="true"
|
|
2482
|
+
severity="danger"
|
|
2483
|
+
size="small"
|
|
2484
|
+
[disabled]="isRemoving()"
|
|
2485
|
+
[fTooltip]="'shared.remove' | translate"
|
|
2486
|
+
(click)="onRemove(user)"
|
|
2487
|
+
>
|
|
2488
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
2489
|
+
</button>
|
|
2490
|
+
</div>
|
|
2491
|
+
} @empty {
|
|
2492
|
+
<div class="text-center py-4 text-muted-color">
|
|
2493
|
+
{{ 'administrative.permission.no.users' | translate }}
|
|
2494
|
+
</div>
|
|
2495
|
+
}
|
|
2496
|
+
</div>
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
<ng-template #footer>
|
|
2500
|
+
<button
|
|
2501
|
+
fButton
|
|
2502
|
+
severity="secondary"
|
|
2503
|
+
[outlined]="true"
|
|
2504
|
+
(click)="onClose()"
|
|
2505
|
+
>
|
|
2506
|
+
<span pButtonLabel>{{ 'shared.close' | translate }}</span>
|
|
2507
|
+
</button>
|
|
2508
|
+
</ng-template>
|
|
2509
|
+
</f-dialog>
|
|
2510
|
+
`,
|
|
2511
|
+
}]
|
|
2512
|
+
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: true }] }], branch: [{ type: i0.Input, args: [{ isSignal: true, alias: "branch", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
2513
|
+
|
|
2240
2514
|
class BranchListComponent {
|
|
2241
2515
|
// Permission constants for template
|
|
2242
2516
|
BRANCH_PERMISSIONS = BRANCH_PERMISSIONS;
|
|
2517
|
+
USER_PERMISSIONS = USER_PERMISSIONS;
|
|
2243
2518
|
router = inject(Router);
|
|
2244
2519
|
route = inject(ActivatedRoute);
|
|
2245
2520
|
messageService = inject(MessageService);
|
|
@@ -2266,6 +2541,10 @@ class BranchListComponent {
|
|
|
2266
2541
|
isLoading = this.branchService.isLoading;
|
|
2267
2542
|
/** Total count from service */
|
|
2268
2543
|
total = this.branchService.total;
|
|
2544
|
+
permittedUsersDialogVisible = signal(false, /* @ts-ignore */
|
|
2545
|
+
...(ngDevMode ? [{ debugName: "permittedUsersDialogVisible" }] : /* istanbul ignore next */ []));
|
|
2546
|
+
selectedBranch = signal(null, /* @ts-ignore */
|
|
2547
|
+
...(ngDevMode ? [{ debugName: "selectedBranch" }] : /* istanbul ignore next */ []));
|
|
2269
2548
|
constructor() {
|
|
2270
2549
|
effect(() => {
|
|
2271
2550
|
const params = this.queryParamMap();
|
|
@@ -2312,6 +2591,10 @@ class BranchListComponent {
|
|
|
2312
2591
|
onEdit(branch) {
|
|
2313
2592
|
this.router.navigate(['/administration/branch', branch.id]);
|
|
2314
2593
|
}
|
|
2594
|
+
onViewUsers(branch) {
|
|
2595
|
+
this.selectedBranch.set(branch);
|
|
2596
|
+
this.permittedUsersDialogVisible.set(true);
|
|
2597
|
+
}
|
|
2315
2598
|
onDelete(branch) {
|
|
2316
2599
|
this.confirmationService.confirm({
|
|
2317
2600
|
message: this.translate('shared.confirm.delete.item', {
|
|
@@ -2433,6 +2716,17 @@ class BranchListComponent {
|
|
|
2433
2716
|
>
|
|
2434
2717
|
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2435
2718
|
</button>
|
|
2719
|
+
<button
|
|
2720
|
+
fButton
|
|
2721
|
+
*hasPermission="USER_PERMISSIONS.READ"
|
|
2722
|
+
[rounded]="true"
|
|
2723
|
+
[text]="true"
|
|
2724
|
+
severity="secondary"
|
|
2725
|
+
[fTooltip]="'administrative.permission.view.users' | translate"
|
|
2726
|
+
(click)="onViewUsers(branch)"
|
|
2727
|
+
>
|
|
2728
|
+
<ui-icon pButtonIcon name="users"></ui-icon>
|
|
2729
|
+
</button>
|
|
2436
2730
|
@if (!branch.readOnly) {
|
|
2437
2731
|
<button
|
|
2438
2732
|
fButton
|
|
@@ -2464,7 +2758,13 @@ class BranchListComponent {
|
|
|
2464
2758
|
</f-table>
|
|
2465
2759
|
</div>
|
|
2466
2760
|
</f-card>
|
|
2467
|
-
|
|
2761
|
+
|
|
2762
|
+
<lib-branch-permitted-users-dialog
|
|
2763
|
+
[visible]="permittedUsersDialogVisible()"
|
|
2764
|
+
[branch]="selectedBranch()"
|
|
2765
|
+
(closed)="permittedUsersDialogVisible.set(false)"
|
|
2766
|
+
/>
|
|
2767
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CardComponent, selector: "f-card", inputs: ["header", "subheader", "styleClass", "style"] }, { kind: "directive", type: FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "variant", "rounded", "raised", "fluid", "disabled", "loading", "loadingIcon", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "filterBy", "filterMatchMode", "filterLocale", "filterPlaceholder", "resetFilterOnHide", "autofocusFilter", "emptyMessage", "emptyFilterMessage", "showClear", "loading", "loadingIcon", "dropdownIcon", "clearIcon", "inputId", "invalid", "touched", "styleClass", "style", "appendTo", "editable", "readonly", "autofocus", "checkmark", "group", "optionGroupLabel", "optionGroupChildren", "virtualScroll", "virtualScrollItemSize", "lazy"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur", "onFocus", "onClear", "onLazyLoad"] }, { kind: "component", type: TableComponent, selector: "f-table", inputs: ["value", "lazy", "loading", "rows", "totalRecords", "rowHover", "dataKey", "scrollable", "scrollHeight", "paginator", "first", "rowsPerPageOptions", "showCurrentPageReport", "currentPageReportTemplate", "tableStyle", "styleClass", "globalFilterFields", "filterDelay", "responsiveLayout", "selectionMode", "sortMode", "rowExpandMode", "resizableColumns", "rowStyleClass", "virtualScroll", "virtualScrollItemSize", "sortField", "sortOrder", "multiSortMeta", "filters", "selection", "expandedRowKeys", "contextMenuSelection"], outputs: ["sortFieldChange", "sortOrderChange", "multiSortMetaChange", "filtersChange", "selectionChange", "expandedRowKeysChange", "contextMenuSelectionChange", "onLazyLoad", "onSort", "onFilter", "onRowSelect", "onRowUnselect", "onSelectAllChange", "onRowExpand", "onRowCollapse", "onColResize", "onRowContextMenu"] }, { kind: "component", type: TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color", "styleClass", "style"] }, { kind: "directive", type: TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "positionStyle", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay", "life", "autoHide", "positionTop", "positionLeft", "escape"] }, { kind: "component", type: UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill", "severity"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "component", type: BranchPermittedUsersDialogComponent, selector: "lib-branch-permitted-users-dialog", inputs: ["visible", "branch"], outputs: ["closed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2468
2768
|
}
|
|
2469
2769
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BranchListComponent, decorators: [{
|
|
2470
2770
|
type: Component,
|
|
@@ -2480,6 +2780,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
2480
2780
|
TooltipDirective,
|
|
2481
2781
|
UiIconComponent,
|
|
2482
2782
|
HasPermissionDirective,
|
|
2783
|
+
BranchPermittedUsersDialogComponent,
|
|
2483
2784
|
TranslatePipe,
|
|
2484
2785
|
],
|
|
2485
2786
|
template: `
|
|
@@ -2573,6 +2874,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
2573
2874
|
>
|
|
2574
2875
|
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
2575
2876
|
</button>
|
|
2877
|
+
<button
|
|
2878
|
+
fButton
|
|
2879
|
+
*hasPermission="USER_PERMISSIONS.READ"
|
|
2880
|
+
[rounded]="true"
|
|
2881
|
+
[text]="true"
|
|
2882
|
+
severity="secondary"
|
|
2883
|
+
[fTooltip]="'administrative.permission.view.users' | translate"
|
|
2884
|
+
(click)="onViewUsers(branch)"
|
|
2885
|
+
>
|
|
2886
|
+
<ui-icon pButtonIcon name="users"></ui-icon>
|
|
2887
|
+
</button>
|
|
2576
2888
|
@if (!branch.readOnly) {
|
|
2577
2889
|
<button
|
|
2578
2890
|
fButton
|
|
@@ -2604,6 +2916,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
2604
2916
|
</f-table>
|
|
2605
2917
|
</div>
|
|
2606
2918
|
</f-card>
|
|
2919
|
+
|
|
2920
|
+
<lib-branch-permitted-users-dialog
|
|
2921
|
+
[visible]="permittedUsersDialogVisible()"
|
|
2922
|
+
[branch]="selectedBranch()"
|
|
2923
|
+
(closed)="permittedUsersDialogVisible.set(false)"
|
|
2924
|
+
/>
|
|
2607
2925
|
`,
|
|
2608
2926
|
}]
|
|
2609
2927
|
}], ctorParameters: () => [] });
|
|
@@ -2747,6 +3065,241 @@ var companyForm_component = /*#__PURE__*/Object.freeze({
|
|
|
2747
3065
|
CompanyFormComponent: CompanyFormComponent
|
|
2748
3066
|
});
|
|
2749
3067
|
|
|
3068
|
+
/**
|
|
3069
|
+
* Read-only viewer for users permitted against a company, with a remove-only
|
|
3070
|
+
* action per user. Assigning new users stays on the user-centric permission
|
|
3071
|
+
* flow (`UserCompanyPermissionDialogComponent`) — this dialog intentionally
|
|
3072
|
+
* has no "add" affordance.
|
|
3073
|
+
*/
|
|
3074
|
+
class CompanyPermittedUsersDialogComponent {
|
|
3075
|
+
USER_PERMISSIONS = USER_PERMISSIONS;
|
|
3076
|
+
permissionApi = inject(UserPermissionApiService);
|
|
3077
|
+
confirmationService = inject(ConfirmationService);
|
|
3078
|
+
messageService = inject(MessageService);
|
|
3079
|
+
translateAdapter = inject(TranslateService, {
|
|
3080
|
+
optional: true,
|
|
3081
|
+
});
|
|
3082
|
+
t(key, params) {
|
|
3083
|
+
return this.translateAdapter?.translate(key, params) ?? key;
|
|
3084
|
+
}
|
|
3085
|
+
visible = input.required(/* @ts-ignore */
|
|
3086
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
3087
|
+
company = input.required(/* @ts-ignore */
|
|
3088
|
+
...(ngDevMode ? [{ debugName: "company" }] : /* istanbul ignore next */ []));
|
|
3089
|
+
closed = output();
|
|
3090
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
3091
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
3092
|
+
isRemoving = signal(false, /* @ts-ignore */
|
|
3093
|
+
...(ngDevMode ? [{ debugName: "isRemoving" }] : /* istanbul ignore next */ []));
|
|
3094
|
+
users = signal([], /* @ts-ignore */
|
|
3095
|
+
...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
|
|
3096
|
+
constructor() {
|
|
3097
|
+
effect(() => {
|
|
3098
|
+
if (this.visible() && this.company()) {
|
|
3099
|
+
this.loadUsers();
|
|
3100
|
+
}
|
|
3101
|
+
});
|
|
3102
|
+
}
|
|
3103
|
+
async loadUsers() {
|
|
3104
|
+
const company = this.company();
|
|
3105
|
+
if (!company)
|
|
3106
|
+
return;
|
|
3107
|
+
this.isLoading.set(true);
|
|
3108
|
+
try {
|
|
3109
|
+
const response = await firstValueFrom(this.permissionApi.getCompanyUsers(company.id));
|
|
3110
|
+
this.users.set(response.data ?? []);
|
|
3111
|
+
}
|
|
3112
|
+
catch {
|
|
3113
|
+
// Error toast handled by global interceptor
|
|
3114
|
+
}
|
|
3115
|
+
finally {
|
|
3116
|
+
this.isLoading.set(false);
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
onRemove(user) {
|
|
3120
|
+
const company = this.company();
|
|
3121
|
+
if (!company)
|
|
3122
|
+
return;
|
|
3123
|
+
this.confirmationService.confirm({
|
|
3124
|
+
message: this.t('administrative.permission.remove.confirm', {
|
|
3125
|
+
name: user.userName,
|
|
3126
|
+
}),
|
|
3127
|
+
header: this.t('administrative.permission.remove'),
|
|
3128
|
+
icon: 'exclamation-triangle',
|
|
3129
|
+
acceptButtonStyleClass: 'p-button-danger',
|
|
3130
|
+
accept: async () => {
|
|
3131
|
+
this.isRemoving.set(true);
|
|
3132
|
+
try {
|
|
3133
|
+
const response = await firstValueFrom(this.permissionApi.revokeUserFromCompany(user.userId, company.id));
|
|
3134
|
+
if (response.success) {
|
|
3135
|
+
this.users.update((list) => list.filter((u) => u.id !== user.id));
|
|
3136
|
+
this.messageService.add({
|
|
3137
|
+
severity: 'success',
|
|
3138
|
+
summary: this.t('shared.success'),
|
|
3139
|
+
detail: response?.messageKey
|
|
3140
|
+
? this.t(response.messageKey, response.messageVariables)
|
|
3141
|
+
: (response?.message ?? ''),
|
|
3142
|
+
});
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
catch {
|
|
3146
|
+
// Error toast handled by global interceptor
|
|
3147
|
+
}
|
|
3148
|
+
finally {
|
|
3149
|
+
this.isRemoving.set(false);
|
|
3150
|
+
}
|
|
3151
|
+
},
|
|
3152
|
+
});
|
|
3153
|
+
}
|
|
3154
|
+
onClose() {
|
|
3155
|
+
this.closed.emit();
|
|
3156
|
+
}
|
|
3157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CompanyPermittedUsersDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3158
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: CompanyPermittedUsersDialogComponent, isStandalone: true, selector: "lib-company-permitted-users-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: true, transformFunction: null }, company: { classPropertyName: "company", publicName: "company", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: `
|
|
3159
|
+
<f-dialog
|
|
3160
|
+
[visible]="visible()"
|
|
3161
|
+
[modal]="true"
|
|
3162
|
+
[closable]="true"
|
|
3163
|
+
[breakpoints]="{ '960px': '90vw', '640px': '95vw' }"
|
|
3164
|
+
[style]="{ width: '50vw', maxWidth: '600px' }"
|
|
3165
|
+
[header]="'administrative.permission.view.users' | translate"
|
|
3166
|
+
(onHide)="onClose()"
|
|
3167
|
+
>
|
|
3168
|
+
<div class="mb-4">
|
|
3169
|
+
<p class="text-sm text-muted-color">
|
|
3170
|
+
{{ 'administrative.company.title' | translate }}:
|
|
3171
|
+
<strong>{{ company()?.name }}</strong>
|
|
3172
|
+
</p>
|
|
3173
|
+
</div>
|
|
3174
|
+
|
|
3175
|
+
@if (isLoading()) {
|
|
3176
|
+
<div class="flex justify-center items-center py-8">
|
|
3177
|
+
<f-progressspinner />
|
|
3178
|
+
</div>
|
|
3179
|
+
} @else {
|
|
3180
|
+
<div class="flex flex-col gap-3">
|
|
3181
|
+
@for (user of users(); track user.id) {
|
|
3182
|
+
<div
|
|
3183
|
+
class="flex items-center justify-between p-3 border border-surface rounded"
|
|
3184
|
+
>
|
|
3185
|
+
<div>
|
|
3186
|
+
<div class="font-semibold">{{ user.userName }}</div>
|
|
3187
|
+
<div class="text-sm text-muted-color">{{ user.userEmail }}</div>
|
|
3188
|
+
</div>
|
|
3189
|
+
<button
|
|
3190
|
+
fButton
|
|
3191
|
+
*hasPermission="USER_PERMISSIONS.UPDATE"
|
|
3192
|
+
[text]="true"
|
|
3193
|
+
severity="danger"
|
|
3194
|
+
size="small"
|
|
3195
|
+
[disabled]="isRemoving()"
|
|
3196
|
+
[fTooltip]="'shared.remove' | translate"
|
|
3197
|
+
(click)="onRemove(user)"
|
|
3198
|
+
>
|
|
3199
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
3200
|
+
</button>
|
|
3201
|
+
</div>
|
|
3202
|
+
} @empty {
|
|
3203
|
+
<div class="text-center py-4 text-muted-color">
|
|
3204
|
+
{{ 'administrative.permission.no.users' | translate }}
|
|
3205
|
+
</div>
|
|
3206
|
+
}
|
|
3207
|
+
</div>
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
<ng-template #footer>
|
|
3211
|
+
<button
|
|
3212
|
+
fButton
|
|
3213
|
+
severity="secondary"
|
|
3214
|
+
[outlined]="true"
|
|
3215
|
+
(click)="onClose()"
|
|
3216
|
+
>
|
|
3217
|
+
<span pButtonLabel>{{ 'shared.close' | translate }}</span>
|
|
3218
|
+
</button>
|
|
3219
|
+
</ng-template>
|
|
3220
|
+
</f-dialog>
|
|
3221
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DialogComponent, selector: "f-dialog", inputs: ["header", "visible", "modal", "closable", "closeOnEscape", "dismissableMask", "resizable", "draggable", "maximizable", "blockScroll", "returnFocusOnClose", "position", "style", "styleClass", "breakpoints"], outputs: ["visibleChange", "onShow", "onHide", "onMaximize"] }, { kind: "directive", type: FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "variant", "rounded", "raised", "fluid", "disabled", "loading", "loadingIcon", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: ProgressSpinnerComponent, selector: "f-progressspinner", inputs: ["size", "strokeWidth", "animationDuration", "styleClass", "ariaLabel"] }, { kind: "directive", type: TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "positionStyle", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay", "life", "autoHide", "positionTop", "positionLeft", "escape"] }, { kind: "component", type: UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill", "severity"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
3222
|
+
}
|
|
3223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CompanyPermittedUsersDialogComponent, decorators: [{
|
|
3224
|
+
type: Component,
|
|
3225
|
+
args: [{
|
|
3226
|
+
selector: 'lib-company-permitted-users-dialog',
|
|
3227
|
+
imports: [
|
|
3228
|
+
DialogComponent,
|
|
3229
|
+
FButtonDirective,
|
|
3230
|
+
ProgressSpinnerComponent,
|
|
3231
|
+
TooltipDirective,
|
|
3232
|
+
UiIconComponent,
|
|
3233
|
+
HasPermissionDirective,
|
|
3234
|
+
TranslatePipe,
|
|
3235
|
+
],
|
|
3236
|
+
template: `
|
|
3237
|
+
<f-dialog
|
|
3238
|
+
[visible]="visible()"
|
|
3239
|
+
[modal]="true"
|
|
3240
|
+
[closable]="true"
|
|
3241
|
+
[breakpoints]="{ '960px': '90vw', '640px': '95vw' }"
|
|
3242
|
+
[style]="{ width: '50vw', maxWidth: '600px' }"
|
|
3243
|
+
[header]="'administrative.permission.view.users' | translate"
|
|
3244
|
+
(onHide)="onClose()"
|
|
3245
|
+
>
|
|
3246
|
+
<div class="mb-4">
|
|
3247
|
+
<p class="text-sm text-muted-color">
|
|
3248
|
+
{{ 'administrative.company.title' | translate }}:
|
|
3249
|
+
<strong>{{ company()?.name }}</strong>
|
|
3250
|
+
</p>
|
|
3251
|
+
</div>
|
|
3252
|
+
|
|
3253
|
+
@if (isLoading()) {
|
|
3254
|
+
<div class="flex justify-center items-center py-8">
|
|
3255
|
+
<f-progressspinner />
|
|
3256
|
+
</div>
|
|
3257
|
+
} @else {
|
|
3258
|
+
<div class="flex flex-col gap-3">
|
|
3259
|
+
@for (user of users(); track user.id) {
|
|
3260
|
+
<div
|
|
3261
|
+
class="flex items-center justify-between p-3 border border-surface rounded"
|
|
3262
|
+
>
|
|
3263
|
+
<div>
|
|
3264
|
+
<div class="font-semibold">{{ user.userName }}</div>
|
|
3265
|
+
<div class="text-sm text-muted-color">{{ user.userEmail }}</div>
|
|
3266
|
+
</div>
|
|
3267
|
+
<button
|
|
3268
|
+
fButton
|
|
3269
|
+
*hasPermission="USER_PERMISSIONS.UPDATE"
|
|
3270
|
+
[text]="true"
|
|
3271
|
+
severity="danger"
|
|
3272
|
+
size="small"
|
|
3273
|
+
[disabled]="isRemoving()"
|
|
3274
|
+
[fTooltip]="'shared.remove' | translate"
|
|
3275
|
+
(click)="onRemove(user)"
|
|
3276
|
+
>
|
|
3277
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
3278
|
+
</button>
|
|
3279
|
+
</div>
|
|
3280
|
+
} @empty {
|
|
3281
|
+
<div class="text-center py-4 text-muted-color">
|
|
3282
|
+
{{ 'administrative.permission.no.users' | translate }}
|
|
3283
|
+
</div>
|
|
3284
|
+
}
|
|
3285
|
+
</div>
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
<ng-template #footer>
|
|
3289
|
+
<button
|
|
3290
|
+
fButton
|
|
3291
|
+
severity="secondary"
|
|
3292
|
+
[outlined]="true"
|
|
3293
|
+
(click)="onClose()"
|
|
3294
|
+
>
|
|
3295
|
+
<span pButtonLabel>{{ 'shared.close' | translate }}</span>
|
|
3296
|
+
</button>
|
|
3297
|
+
</ng-template>
|
|
3298
|
+
</f-dialog>
|
|
3299
|
+
`,
|
|
3300
|
+
}]
|
|
3301
|
+
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: true }] }], company: [{ type: i0.Input, args: [{ isSignal: true, alias: "company", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
3302
|
+
|
|
2750
3303
|
class CompanyListComponent {
|
|
2751
3304
|
permissionValidator = inject(PermissionValidatorService);
|
|
2752
3305
|
translateAdapter = inject(TranslateService, {
|
|
@@ -2759,7 +3312,11 @@ class CompanyListComponent {
|
|
|
2759
3312
|
canEditFn = (_item) => this.permissionValidator.hasPermission(COMPANY_PERMISSIONS.UPDATE);
|
|
2760
3313
|
canDeleteFn = (item) => !item.readOnly &&
|
|
2761
3314
|
this.permissionValidator.hasPermission(COMPANY_PERMISSIONS.DELETE);
|
|
2762
|
-
|
|
3315
|
+
permittedUsersDialogVisible = signal(false, /* @ts-ignore */
|
|
3316
|
+
...(ngDevMode ? [{ debugName: "permittedUsersDialogVisible" }] : /* istanbul ignore next */ []));
|
|
3317
|
+
selectedCompany = signal(null, /* @ts-ignore */
|
|
3318
|
+
...(ngDevMode ? [{ debugName: "selectedCompany" }] : /* istanbul ignore next */ []));
|
|
3319
|
+
rowActions = [
|
|
2763
3320
|
{
|
|
2764
3321
|
icon: 'building',
|
|
2765
3322
|
tooltip: 'administrative.branch.view.branches',
|
|
@@ -2769,6 +3326,16 @@ class CompanyListComponent {
|
|
|
2769
3326
|
queryParams: { companyId: c.id },
|
|
2770
3327
|
}),
|
|
2771
3328
|
},
|
|
3329
|
+
{
|
|
3330
|
+
icon: 'users',
|
|
3331
|
+
tooltip: 'administrative.permission.view.users',
|
|
3332
|
+
severity: 'secondary',
|
|
3333
|
+
show: () => this.permissionValidator.hasPermission(USER_PERMISSIONS.READ),
|
|
3334
|
+
handler: (c) => {
|
|
3335
|
+
this.selectedCompany.set(c);
|
|
3336
|
+
this.permittedUsersDialogVisible.set(true);
|
|
3337
|
+
},
|
|
3338
|
+
},
|
|
2772
3339
|
];
|
|
2773
3340
|
columns = [
|
|
2774
3341
|
{
|
|
@@ -2803,7 +3370,7 @@ class CompanyListComponent {
|
|
|
2803
3370
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", type: CompanyListComponent, isStandalone: true, selector: "lib-company-list", ngImport: i0, template: `
|
|
2804
3371
|
<lib-base-list
|
|
2805
3372
|
[columns]="columns"
|
|
2806
|
-
[actions]="
|
|
3373
|
+
[actions]="rowActions"
|
|
2807
3374
|
[service]="companyService"
|
|
2808
3375
|
[title]="'administrative.company.title' | translate"
|
|
2809
3376
|
[showCreateButton]="canCreate()"
|
|
@@ -2826,7 +3393,13 @@ class CompanyListComponent {
|
|
|
2826
3393
|
/>
|
|
2827
3394
|
</ng-template>
|
|
2828
3395
|
</lib-base-list>
|
|
2829
|
-
|
|
3396
|
+
|
|
3397
|
+
<lib-company-permitted-users-dialog
|
|
3398
|
+
[visible]="permittedUsersDialogVisible()"
|
|
3399
|
+
[company]="selectedCompany()"
|
|
3400
|
+
(closed)="permittedUsersDialogVisible.set(false)"
|
|
3401
|
+
/>
|
|
3402
|
+
`, isInline: true, dependencies: [{ kind: "component", type: BaseListComponent, selector: "lib-base-list", inputs: ["columns", "actions", "title", "showCreateButton", "searchable", "pageSize", "scrollHeight", "emptyMessage", "createButtonLabel", "createButtonIcon", "data", "total", "isLoading", "service", "filter", "createRoute", "editRoute", "deleteConfirmField", "deleteType", "idField", "canEdit", "canDelete"], outputs: ["onCreate", "onLazyLoad", "onSearch"] }, { kind: "directive", type: BaseListTemplateDirective, selector: "ng-template[baseListTemplate]", inputs: ["baseListTemplate"] }, { kind: "component", type: TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color", "styleClass", "style"] }, { kind: "component", type: CompanyPermittedUsersDialogComponent, selector: "lib-company-permitted-users-dialog", inputs: ["visible", "company"], outputs: ["closed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2830
3403
|
}
|
|
2831
3404
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CompanyListComponent, decorators: [{
|
|
2832
3405
|
type: Component,
|
|
@@ -2836,12 +3409,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
2836
3409
|
BaseListComponent,
|
|
2837
3410
|
BaseListTemplateDirective,
|
|
2838
3411
|
TagComponent,
|
|
3412
|
+
CompanyPermittedUsersDialogComponent,
|
|
2839
3413
|
TranslatePipe,
|
|
2840
3414
|
],
|
|
2841
3415
|
template: `
|
|
2842
3416
|
<lib-base-list
|
|
2843
3417
|
[columns]="columns"
|
|
2844
|
-
[actions]="
|
|
3418
|
+
[actions]="rowActions"
|
|
2845
3419
|
[service]="companyService"
|
|
2846
3420
|
[title]="'administrative.company.title' | translate"
|
|
2847
3421
|
[showCreateButton]="canCreate()"
|
|
@@ -2864,6 +3438,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
2864
3438
|
/>
|
|
2865
3439
|
</ng-template>
|
|
2866
3440
|
</lib-base-list>
|
|
3441
|
+
|
|
3442
|
+
<lib-company-permitted-users-dialog
|
|
3443
|
+
[visible]="permittedUsersDialogVisible()"
|
|
3444
|
+
[company]="selectedCompany()"
|
|
3445
|
+
(closed)="permittedUsersDialogVisible.set(false)"
|
|
3446
|
+
/>
|
|
2867
3447
|
`,
|
|
2868
3448
|
}]
|
|
2869
3449
|
}] });
|
|
@@ -10770,5 +11350,5 @@ var verifyEmailPage_component = /*#__PURE__*/Object.freeze({
|
|
|
10770
11350
|
* Generated bundle index. Do not edit.
|
|
10771
11351
|
*/
|
|
10772
11352
|
|
|
10773
|
-
export { ADMINISTRATION_ROUTES, AUTH_ENDPOINTS, AUTH_MESSAGES, AUTH_PROFILE_EXTENSION, AUTH_REGISTRATION_EXTENSION, AUTH_ROUTES, AUTH_USER_DETAIL_CONFIG, AUTH_USER_FORM_EXTENSION, AUTH_USER_LIST_EXTENSION, AUTH_VALIDATION_CONFIG, AdministrationPageComponent, AuthApiService, AuthCompanyApiProviderAdapter, AuthInitService, AuthLayoutApiAdapter, AuthLayoutStateAdapter, AuthStateProviderAdapter, AuthStateService, AuthUserPermissionProviderAdapter, AuthUserProviderAdapter, BranchApiService, BranchFormComponent, BranchListComponent, CompanyApiService, CompanyFormComponent, CompanyListComponent, ForgotPasswordPageComponent, LoginPageComponent, PROFILE_FIELD_CONTEXT, PROFILE_ROUTES, ProfilePageComponent, REGISTRATION_FIELD_CONTEXT, RegisterPageComponent, ResetPasswordPageComponent, SOCIAL_PROVIDERS, SOCIAL_RETURN_URL_KEY, SocialAuthApiService, SocialAuthConfigApiService, SocialCallbackPageComponent, SocialConfigPageComponent, SocialLoginButtonsComponent, SocialProviderEnum, TokenRefreshStateService, USER_FORM_FIELD_CONTEXT, UserApiService, UserBranchPermissionDialogComponent, UserCompanyPermissionDialogComponent, UserFormComponent, UserListComponent, UserPermissionApiService, VerifyEmailPageComponent, authGuard, authInterceptor, companyFeatureGuard, emailFeatureGuard, guestGuard, isCompanySelectionResponse, isEmailVerificationRequired, isEndpoint, isLoginResponse, provideAuthLayoutIntegration, provideAuthProviders, signUpFeatureGuard, tokenRefreshInterceptor, validateEmail, validatePassword };
|
|
11353
|
+
export { ADMINISTRATION_ROUTES, AUTH_ENDPOINTS, AUTH_MESSAGES, AUTH_PROFILE_EXTENSION, AUTH_REGISTRATION_EXTENSION, AUTH_ROUTES, AUTH_USER_DETAIL_CONFIG, AUTH_USER_FORM_EXTENSION, AUTH_USER_LIST_EXTENSION, AUTH_VALIDATION_CONFIG, AdministrationPageComponent, AuthApiService, AuthCompanyApiProviderAdapter, AuthInitService, AuthLayoutApiAdapter, AuthLayoutStateAdapter, AuthStateProviderAdapter, AuthStateService, AuthUserPermissionProviderAdapter, AuthUserProviderAdapter, BranchApiService, BranchFormComponent, BranchListComponent, BranchPermittedUsersDialogComponent, CompanyApiService, CompanyFormComponent, CompanyListComponent, CompanyPermittedUsersDialogComponent, ForgotPasswordPageComponent, LoginPageComponent, PROFILE_FIELD_CONTEXT, PROFILE_ROUTES, ProfilePageComponent, REGISTRATION_FIELD_CONTEXT, RegisterPageComponent, ResetPasswordPageComponent, SOCIAL_PROVIDERS, SOCIAL_RETURN_URL_KEY, SocialAuthApiService, SocialAuthConfigApiService, SocialCallbackPageComponent, SocialConfigPageComponent, SocialLoginButtonsComponent, SocialProviderEnum, TokenRefreshStateService, USER_FORM_FIELD_CONTEXT, UserApiService, UserBranchPermissionDialogComponent, UserCompanyPermissionDialogComponent, UserFormComponent, UserListComponent, UserPermissionApiService, VerifyEmailPageComponent, authGuard, authInterceptor, companyFeatureGuard, emailFeatureGuard, guestGuard, isCompanySelectionResponse, isEmailVerificationRequired, isEndpoint, isLoginResponse, provideAuthLayoutIntegration, provideAuthProviders, signUpFeatureGuard, tokenRefreshInterceptor, validateEmail, validatePassword };
|
|
10774
11354
|
//# sourceMappingURL=flusys-ng-auth.mjs.map
|