@flusys/ng-iam 9.1.0-rc.1 → 9.1.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.
Files changed (37) hide show
  1. package/fesm2022/flusys-ng-iam-action-form-page.component-DJ-A1gc2.mjs +685 -0
  2. package/fesm2022/flusys-ng-iam-action-form-page.component-DJ-A1gc2.mjs.map +1 -0
  3. package/fesm2022/{flusys-ng-iam-action-list-page.component-Cf4Dhh5S.mjs → flusys-ng-iam-action-list-page.component-Br0PbgRa.mjs} +369 -166
  4. package/fesm2022/flusys-ng-iam-action-list-page.component-Br0PbgRa.mjs.map +1 -0
  5. package/fesm2022/flusys-ng-iam-iam-container.component-CIdxVCSW.mjs +141 -0
  6. package/fesm2022/flusys-ng-iam-iam-container.component-CIdxVCSW.mjs.map +1 -0
  7. package/fesm2022/flusys-ng-iam-permission-api.service-C7-Yxvz8.mjs +76 -0
  8. package/fesm2022/flusys-ng-iam-permission-api.service-C7-Yxvz8.mjs.map +1 -0
  9. package/fesm2022/flusys-ng-iam-permission-page.component-BlNt83uR.mjs +306 -0
  10. package/fesm2022/flusys-ng-iam-permission-page.component-BlNt83uR.mjs.map +1 -0
  11. package/fesm2022/flusys-ng-iam-role-api.service-OwPgmSFc.mjs +33 -0
  12. package/fesm2022/flusys-ng-iam-role-api.service-OwPgmSFc.mjs.map +1 -0
  13. package/fesm2022/flusys-ng-iam-role-form-page.component-DnkWkbTF.mjs +427 -0
  14. package/fesm2022/flusys-ng-iam-role-form-page.component-DnkWkbTF.mjs.map +1 -0
  15. package/fesm2022/flusys-ng-iam-role-list-page.component-BCO_gQ8k.mjs +685 -0
  16. package/fesm2022/flusys-ng-iam-role-list-page.component-BCO_gQ8k.mjs.map +1 -0
  17. package/fesm2022/flusys-ng-iam-tree-utils-B1pBG4At.mjs +110 -0
  18. package/fesm2022/flusys-ng-iam-tree-utils-B1pBG4At.mjs.map +1 -0
  19. package/fesm2022/flusys-ng-iam-user-action-selector.component-CAXEmJWx.mjs +4592 -0
  20. package/fesm2022/flusys-ng-iam-user-action-selector.component-CAXEmJWx.mjs.map +1 -0
  21. package/fesm2022/flusys-ng-iam.mjs +2051 -2
  22. package/fesm2022/flusys-ng-iam.mjs.map +1 -1
  23. package/package.json +5 -5
  24. package/types/flusys-ng-iam.d.ts +621 -604
  25. package/fesm2022/flusys-ng-iam-action-form-page.component-Dn0TD1Zu.mjs +0 -509
  26. package/fesm2022/flusys-ng-iam-action-form-page.component-Dn0TD1Zu.mjs.map +0 -1
  27. package/fesm2022/flusys-ng-iam-action-list-page.component-Cf4Dhh5S.mjs.map +0 -1
  28. package/fesm2022/flusys-ng-iam-flusys-ng-iam-Y7U2lGZk.mjs +0 -5584
  29. package/fesm2022/flusys-ng-iam-flusys-ng-iam-Y7U2lGZk.mjs.map +0 -1
  30. package/fesm2022/flusys-ng-iam-iam-container.component-XBoIeQ0t.mjs +0 -105
  31. package/fesm2022/flusys-ng-iam-iam-container.component-XBoIeQ0t.mjs.map +0 -1
  32. package/fesm2022/flusys-ng-iam-permission-page.component-CCAQuZSJ.mjs +0 -204
  33. package/fesm2022/flusys-ng-iam-permission-page.component-CCAQuZSJ.mjs.map +0 -1
  34. package/fesm2022/flusys-ng-iam-role-form-page.component-EFjxhBRY.mjs +0 -352
  35. package/fesm2022/flusys-ng-iam-role-form-page.component-EFjxhBRY.mjs.map +0 -1
  36. package/fesm2022/flusys-ng-iam-role-list-page.component-DBfhjdkM.mjs +0 -486
  37. package/fesm2022/flusys-ng-iam-role-list-page.component-DBfhjdkM.mjs.map +0 -1
@@ -0,0 +1,685 @@
1
+ import { t as RoleApiService } from "./flusys-ng-iam-role-api.service-OwPgmSFc.mjs";
2
+ import { RolePermittedUsersDialogComponent } from "./flusys-ng-iam.mjs";
3
+ import * as i0 from "@angular/core";
4
+ import { Component, computed, effect, inject, signal, untracked } from "@angular/core";
5
+ import { HasPermissionDirective, ROLE_PERMISSIONS, TranslatePipe, TranslateService, USER_ROLE_PERMISSIONS } from "@flusys/ng-shared";
6
+ import { APP_CONFIG, DEFAULT_APP_NAME, getPermissionMode, isCompanyFeatureEnabled } from "@flusys/ng-core";
7
+ import { ConfirmationService, FButtonDirective, IconFieldComponent, InputIconComponent, InputTextDirective, MessageService, TableComponent, TagComponent, TooltipDirective, UiIconComponent } from "@flusys/ng-ui";
8
+ import * as i1 from "@angular/forms";
9
+ import { FormsModule } from "@angular/forms";
10
+ import { LAYOUT_AUTH_STATE } from "@flusys/ng-layout";
11
+ import { Router } from "@angular/router";
12
+ var RoleListPageComponent = class RoleListPageComponent {
13
+ ROLE_PERMISSIONS = ROLE_PERMISSIONS;
14
+ USER_ROLE_PERMISSIONS = USER_ROLE_PERMISSIONS;
15
+ router = inject(Router);
16
+ appConfig = inject(APP_CONFIG);
17
+ companyContext = inject(LAYOUT_AUTH_STATE);
18
+ roleApi = inject(RoleApiService);
19
+ messageService = inject(MessageService);
20
+ confirmationService = inject(ConfirmationService);
21
+ translateAdapter = inject(TranslateService, { optional: true });
22
+ translate(key, vars) {
23
+ return this.translateAdapter?.translate(key, vars) ?? key;
24
+ }
25
+ roles = signal([], ...ngDevMode ? [{ debugName: "roles" }] : /* istanbul ignore next */ []);
26
+ isLoading = signal(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
27
+ total = signal(0, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
28
+ pageSize = signal(10, ...ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []);
29
+ first = signal(0, ...ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []);
30
+ _searchTerm = signal("", ...ngDevMode ? [{ debugName: "_searchTerm" }] : /* istanbul ignore next */ []);
31
+ searchTerm = this._searchTerm.asReadonly();
32
+ showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, ...ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []);
33
+ showRoleUsers = computed(() => {
34
+ const permissionMode = getPermissionMode(this.appConfig);
35
+ return permissionMode === "rbac" || permissionMode === "full";
36
+ }, ...ngDevMode ? [{ debugName: "showRoleUsers" }] : /* istanbul ignore next */ []);
37
+ currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, ...ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []);
38
+ permittedUsersDialogVisible = signal(false, ...ngDevMode ? [{ debugName: "permittedUsersDialogVisible" }] : /* istanbul ignore next */ []);
39
+ selectedRole = signal(null, ...ngDevMode ? [{ debugName: "selectedRole" }] : /* istanbul ignore next */ []);
40
+ previousCompanyId = void 0;
41
+ constructor() {
42
+ effect(() => {
43
+ const currentCompanyId = this.companyContext.currentCompanyInfo()?.id ?? null;
44
+ if (this.previousCompanyId === void 0) {
45
+ this.previousCompanyId = currentCompanyId;
46
+ return;
47
+ }
48
+ if (this.previousCompanyId === currentCompanyId) return;
49
+ this.previousCompanyId = currentCompanyId;
50
+ untracked(() => {
51
+ this.first.set(0);
52
+ this.loadRoles();
53
+ });
54
+ });
55
+ }
56
+ async loadRoles() {
57
+ this.isLoading.set(true);
58
+ try {
59
+ const enableCompanyFeature = isCompanyFeatureEnabled(this.appConfig);
60
+ const companyId = enableCompanyFeature ? this.companyContext.currentCompanyInfo()?.id || void 0 : void 0;
61
+ const selectFields = [
62
+ "id",
63
+ "name",
64
+ "description",
65
+ "isActive",
66
+ "readOnly",
67
+ "serial",
68
+ "createdAt",
69
+ "deletedAt"
70
+ ];
71
+ if (enableCompanyFeature) selectFields.push("companyId");
72
+ const response = await this.roleApi.getAll({
73
+ filter: companyId ? { companyId } : void 0,
74
+ pagination: {
75
+ currentPage: Math.floor(this.first() / this.pageSize()),
76
+ pageSize: this.pageSize()
77
+ },
78
+ select: selectFields,
79
+ sort: { id: "ASC" }
80
+ }, this._searchTerm());
81
+ this.roles.set(response?.data ?? []);
82
+ this.total.set(response?.meta?.total ?? 0);
83
+ } catch {} finally {
84
+ this.isLoading.set(false);
85
+ }
86
+ }
87
+ onCreate() {
88
+ this.router.navigate(["/iam/roles/new"]);
89
+ }
90
+ onEdit(role) {
91
+ this.router.navigate(["/iam/roles", role.id]);
92
+ }
93
+ onViewUsers(role) {
94
+ this.selectedRole.set(role);
95
+ this.permittedUsersDialogVisible.set(true);
96
+ }
97
+ onDelete(role) {
98
+ this.confirmationService.confirm({
99
+ message: this.translate("shared.confirm.delete.item", { name: role.name }),
100
+ header: this.translate("iam.role.delete.title"),
101
+ icon: "exclamation-triangle",
102
+ accept: async () => {
103
+ try {
104
+ const response = await this.roleApi.delete({
105
+ id: role.id,
106
+ type: "permanent"
107
+ });
108
+ this.roles.update((list) => list.filter((r) => r.id !== role.id));
109
+ this.total.update((t) => Math.max(0, t - 1));
110
+ this.messageService.add({
111
+ severity: "success",
112
+ summary: this.translate("shared.success"),
113
+ detail: response?.messageKey ? this.translate(response.messageKey, response.messageVariables) : response?.message
114
+ });
115
+ } catch {}
116
+ }
117
+ });
118
+ }
119
+ onLazyLoad(event) {
120
+ this.first.set(event.first ?? 0);
121
+ this.pageSize.set(event.rows ?? 10);
122
+ this.loadRoles();
123
+ }
124
+ onSearchChange(value) {
125
+ this._searchTerm.set(value);
126
+ this.first.set(0);
127
+ this.loadRoles();
128
+ }
129
+ static ɵfac = i0.ɵɵngDeclareFactory({
130
+ minVersion: "12.0.0",
131
+ version: "22.2.1",
132
+ ngImport: i0,
133
+ type: RoleListPageComponent,
134
+ deps: [],
135
+ target: i0.ɵɵFactoryTarget.Component
136
+ });
137
+ static ɵcmp = i0.ɵɵngDeclareComponent({
138
+ minVersion: "17.0.0",
139
+ version: "22.2.1",
140
+ type: RoleListPageComponent,
141
+ isStandalone: true,
142
+ selector: "lib-role-list-page",
143
+ ngImport: i0,
144
+ template: `
145
+ <div class="card">
146
+ <div
147
+ class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
148
+ >
149
+ <div>
150
+ <h3 class="text-lg sm:text-xl font-semibold">
151
+ {{ 'iam.role.title' | translate }}
152
+ </h3>
153
+ @if (showCompanyInfo()) {
154
+ <p class="text-sm text-muted-color mt-1">
155
+ {{ 'iam.company.title' | translate }}: {{ currentCompanyName() }}
156
+ </p>
157
+ }
158
+ </div>
159
+ <div class="flex flex-wrap items-center gap-2 w-full sm:w-auto">
160
+ <f-iconfield class="w-full sm:w-64">
161
+ <f-inputicon icon="search" />
162
+ <input
163
+ fInputText
164
+ type="text"
165
+ [ngModel]="searchTerm()"
166
+ (ngModelChange)="onSearchChange($event)"
167
+ [placeholder]="'shared.search' | translate"
168
+ class="w-full"
169
+ />
170
+ </f-iconfield>
171
+ <button
172
+ fButton
173
+ *hasPermission="ROLE_PERMISSIONS.CREATE"
174
+ (click)="onCreate()"
175
+ class="w-full sm:w-auto"
176
+ >
177
+ <ui-icon pButtonIcon name="plus"></ui-icon>
178
+ <span pButtonLabel>{{ 'iam.role.new' | translate }}</span>
179
+ </button>
180
+ </div>
181
+ </div>
182
+
183
+ <div class="overflow-x-auto -mx-4 sm:mx-0">
184
+ <f-table
185
+ [value]="roles()"
186
+ [loading]="isLoading()"
187
+ [paginator]="total() > 0"
188
+ [rows]="pageSize()"
189
+ [first]="first()"
190
+ [totalRecords]="total()"
191
+ [lazy]="true"
192
+ (onLazyLoad)="onLazyLoad($event)"
193
+ [rowsPerPageOptions]="[10, 25, 50]"
194
+ [scrollable]="true"
195
+ [tableStyle]="{ 'min-width': '40rem' }"
196
+ >
197
+ <ng-template #header>
198
+ <tr>
199
+ <th>{{ 'iam.role.name' | translate }}</th>
200
+ <th class="hidden md:table-cell">
201
+ {{ 'shared.description' | translate }}
202
+ </th>
203
+ <th>{{ 'shared.active' | translate }}</th>
204
+ <th class="hidden sm:table-cell">
205
+ {{ 'shared.read.only' | translate }}
206
+ </th>
207
+ <th class="w-[120px]">{{ 'shared.actions' | translate }}</th>
208
+ </tr>
209
+ </ng-template>
210
+ <ng-template #body let-role>
211
+ <tr>
212
+ <td>{{ role.name }}</td>
213
+ <td class="hidden md:table-cell">
214
+ {{ role.description ?? '-' }}
215
+ </td>
216
+ <td>
217
+ <f-tag
218
+ [value]="
219
+ role.isActive
220
+ ? ('shared.active' | translate)
221
+ : ('shared.inactive' | translate)
222
+ "
223
+ [severity]="role.isActive ? 'success' : 'secondary'"
224
+ />
225
+ </td>
226
+ <td class="hidden sm:table-cell">
227
+ <f-tag
228
+ [value]="
229
+ role.readOnly
230
+ ? ('shared.yes' | translate)
231
+ : ('shared.no' | translate)
232
+ "
233
+ [severity]="role.readOnly ? 'warn' : 'secondary'"
234
+ />
235
+ </td>
236
+ <td>
237
+ <div class="flex gap-1">
238
+ <button
239
+ fButton
240
+ *hasPermission="ROLE_PERMISSIONS.UPDATE"
241
+ [text]="true"
242
+ severity="secondary"
243
+ size="small"
244
+ [disabled]="role.readOnly"
245
+ [fTooltip]="'shared.edit' | translate"
246
+ (click)="onEdit(role)"
247
+ >
248
+ <ui-icon pButtonIcon name="pencil"></ui-icon>
249
+ </button>
250
+ @if (showRoleUsers()) {
251
+ <button
252
+ fButton
253
+ *hasPermission="USER_ROLE_PERMISSIONS.READ"
254
+ [text]="true"
255
+ severity="secondary"
256
+ size="small"
257
+ [fTooltip]="'iam.permission.view.users' | translate"
258
+ (click)="onViewUsers(role)"
259
+ >
260
+ <ui-icon pButtonIcon name="users"></ui-icon>
261
+ </button>
262
+ }
263
+ <button
264
+ fButton
265
+ *hasPermission="ROLE_PERMISSIONS.DELETE"
266
+ [text]="true"
267
+ severity="danger"
268
+ size="small"
269
+ [fTooltip]="'shared.delete' | translate"
270
+ [disabled]="role.readOnly"
271
+ (click)="onDelete(role)"
272
+ >
273
+ <ui-icon pButtonIcon name="trash"></ui-icon>
274
+ </button>
275
+ </div>
276
+ </td>
277
+ </tr>
278
+ </ng-template>
279
+ <ng-template #emptymessage>
280
+ <tr>
281
+ <td colspan="5" class="text-center py-4 text-muted-color">
282
+ {{ 'iam.role.no.roles' | translate }}
283
+ </td>
284
+ </tr>
285
+ </ng-template>
286
+ </f-table>
287
+ </div>
288
+ </div>
289
+
290
+ <flusys-role-permitted-users-dialog
291
+ [visible]="permittedUsersDialogVisible()"
292
+ [role]="selectedRole()"
293
+ (closed)="permittedUsersDialogVisible.set(false)"
294
+ />
295
+ `,
296
+ isInline: true,
297
+ dependencies: [
298
+ {
299
+ kind: "directive",
300
+ type: FButtonDirective,
301
+ selector: "[fButton]",
302
+ inputs: [
303
+ "severity",
304
+ "text",
305
+ "outlined",
306
+ "link",
307
+ "variant",
308
+ "rounded",
309
+ "raised",
310
+ "fluid",
311
+ "disabled",
312
+ "loading",
313
+ "loadingIcon",
314
+ "size",
315
+ "label",
316
+ "icon",
317
+ "iconPos",
318
+ "ariaLabel",
319
+ "plain"
320
+ ]
321
+ },
322
+ {
323
+ kind: "ngmodule",
324
+ type: FormsModule
325
+ },
326
+ {
327
+ kind: "directive",
328
+ type: i1.DefaultValueAccessor,
329
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
330
+ },
331
+ {
332
+ kind: "directive",
333
+ type: i1.NgControlStatus,
334
+ selector: "[formControlName],[ngModel],[formControl]"
335
+ },
336
+ {
337
+ kind: "directive",
338
+ type: i1.NgModel,
339
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
340
+ inputs: [
341
+ "name",
342
+ "disabled",
343
+ "ngModel",
344
+ "ngModelOptions"
345
+ ],
346
+ outputs: ["ngModelChange"],
347
+ exportAs: ["ngModel"]
348
+ },
349
+ {
350
+ kind: "component",
351
+ type: IconFieldComponent,
352
+ selector: "f-iconfield",
353
+ inputs: ["iconPosition", "styleClass"]
354
+ },
355
+ {
356
+ kind: "component",
357
+ type: InputIconComponent,
358
+ selector: "f-inputicon",
359
+ inputs: [
360
+ "icon",
361
+ "position",
362
+ "styleClass",
363
+ "style"
364
+ ]
365
+ },
366
+ {
367
+ kind: "directive",
368
+ type: InputTextDirective,
369
+ selector: "[fInputText]",
370
+ inputs: [
371
+ "invalid",
372
+ "touched",
373
+ "variant",
374
+ "size",
375
+ "fluid"
376
+ ]
377
+ },
378
+ {
379
+ kind: "component",
380
+ type: TableComponent,
381
+ selector: "f-table",
382
+ inputs: [
383
+ "value",
384
+ "lazy",
385
+ "loading",
386
+ "rows",
387
+ "totalRecords",
388
+ "rowHover",
389
+ "dataKey",
390
+ "scrollable",
391
+ "scrollHeight",
392
+ "paginator",
393
+ "first",
394
+ "rowsPerPageOptions",
395
+ "showCurrentPageReport",
396
+ "currentPageReportTemplate",
397
+ "tableStyle",
398
+ "styleClass",
399
+ "globalFilterFields",
400
+ "filterDelay",
401
+ "responsiveLayout",
402
+ "selectionMode",
403
+ "sortMode",
404
+ "rowExpandMode",
405
+ "resizableColumns",
406
+ "rowStyleClass",
407
+ "virtualScroll",
408
+ "virtualScrollItemSize",
409
+ "sortField",
410
+ "sortOrder",
411
+ "multiSortMeta",
412
+ "filters",
413
+ "selection",
414
+ "expandedRowKeys",
415
+ "contextMenuSelection"
416
+ ],
417
+ outputs: [
418
+ "sortFieldChange",
419
+ "sortOrderChange",
420
+ "multiSortMetaChange",
421
+ "filtersChange",
422
+ "selectionChange",
423
+ "expandedRowKeysChange",
424
+ "contextMenuSelectionChange",
425
+ "onLazyLoad",
426
+ "onSort",
427
+ "onFilter",
428
+ "onRowSelect",
429
+ "onRowUnselect",
430
+ "onSelectAllChange",
431
+ "onRowExpand",
432
+ "onRowCollapse",
433
+ "onColResize",
434
+ "onRowContextMenu"
435
+ ]
436
+ },
437
+ {
438
+ kind: "component",
439
+ type: TagComponent,
440
+ selector: "f-tag",
441
+ inputs: [
442
+ "value",
443
+ "severity",
444
+ "icon",
445
+ "rounded",
446
+ "color",
447
+ "styleClass",
448
+ "style"
449
+ ]
450
+ },
451
+ {
452
+ kind: "directive",
453
+ type: TooltipDirective,
454
+ selector: "[fTooltip]",
455
+ inputs: [
456
+ "fTooltip",
457
+ "tooltipPosition",
458
+ "positionStyle",
459
+ "tooltipStyleClass",
460
+ "disabled",
461
+ "tooltipEvent",
462
+ "showDelay",
463
+ "hideDelay",
464
+ "life",
465
+ "autoHide",
466
+ "positionTop",
467
+ "positionLeft",
468
+ "escape"
469
+ ]
470
+ },
471
+ {
472
+ kind: "component",
473
+ type: UiIconComponent,
474
+ selector: "ui-icon",
475
+ inputs: [
476
+ "name",
477
+ "size",
478
+ "spin",
479
+ "fill",
480
+ "severity"
481
+ ]
482
+ },
483
+ {
484
+ kind: "directive",
485
+ type: HasPermissionDirective,
486
+ selector: "[hasPermission]",
487
+ inputs: ["hasPermission"]
488
+ },
489
+ {
490
+ kind: "component",
491
+ type: RolePermittedUsersDialogComponent,
492
+ selector: "flusys-role-permitted-users-dialog",
493
+ inputs: ["visible", "role"],
494
+ outputs: ["closed"]
495
+ },
496
+ {
497
+ kind: "pipe",
498
+ type: TranslatePipe,
499
+ name: "translate"
500
+ }
501
+ ]
502
+ });
503
+ };
504
+ i0.ɵɵngDeclareClassMetadata({
505
+ minVersion: "12.0.0",
506
+ version: "22.2.1",
507
+ ngImport: i0,
508
+ type: RoleListPageComponent,
509
+ decorators: [{
510
+ type: Component,
511
+ args: [{
512
+ selector: "lib-role-list-page",
513
+ imports: [
514
+ FButtonDirective,
515
+ FormsModule,
516
+ IconFieldComponent,
517
+ InputIconComponent,
518
+ InputTextDirective,
519
+ TableComponent,
520
+ TagComponent,
521
+ TooltipDirective,
522
+ UiIconComponent,
523
+ HasPermissionDirective,
524
+ RolePermittedUsersDialogComponent,
525
+ TranslatePipe
526
+ ],
527
+ template: `
528
+ <div class="card">
529
+ <div
530
+ class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
531
+ >
532
+ <div>
533
+ <h3 class="text-lg sm:text-xl font-semibold">
534
+ {{ 'iam.role.title' | translate }}
535
+ </h3>
536
+ @if (showCompanyInfo()) {
537
+ <p class="text-sm text-muted-color mt-1">
538
+ {{ 'iam.company.title' | translate }}: {{ currentCompanyName() }}
539
+ </p>
540
+ }
541
+ </div>
542
+ <div class="flex flex-wrap items-center gap-2 w-full sm:w-auto">
543
+ <f-iconfield class="w-full sm:w-64">
544
+ <f-inputicon icon="search" />
545
+ <input
546
+ fInputText
547
+ type="text"
548
+ [ngModel]="searchTerm()"
549
+ (ngModelChange)="onSearchChange($event)"
550
+ [placeholder]="'shared.search' | translate"
551
+ class="w-full"
552
+ />
553
+ </f-iconfield>
554
+ <button
555
+ fButton
556
+ *hasPermission="ROLE_PERMISSIONS.CREATE"
557
+ (click)="onCreate()"
558
+ class="w-full sm:w-auto"
559
+ >
560
+ <ui-icon pButtonIcon name="plus"></ui-icon>
561
+ <span pButtonLabel>{{ 'iam.role.new' | translate }}</span>
562
+ </button>
563
+ </div>
564
+ </div>
565
+
566
+ <div class="overflow-x-auto -mx-4 sm:mx-0">
567
+ <f-table
568
+ [value]="roles()"
569
+ [loading]="isLoading()"
570
+ [paginator]="total() > 0"
571
+ [rows]="pageSize()"
572
+ [first]="first()"
573
+ [totalRecords]="total()"
574
+ [lazy]="true"
575
+ (onLazyLoad)="onLazyLoad($event)"
576
+ [rowsPerPageOptions]="[10, 25, 50]"
577
+ [scrollable]="true"
578
+ [tableStyle]="{ 'min-width': '40rem' }"
579
+ >
580
+ <ng-template #header>
581
+ <tr>
582
+ <th>{{ 'iam.role.name' | translate }}</th>
583
+ <th class="hidden md:table-cell">
584
+ {{ 'shared.description' | translate }}
585
+ </th>
586
+ <th>{{ 'shared.active' | translate }}</th>
587
+ <th class="hidden sm:table-cell">
588
+ {{ 'shared.read.only' | translate }}
589
+ </th>
590
+ <th class="w-[120px]">{{ 'shared.actions' | translate }}</th>
591
+ </tr>
592
+ </ng-template>
593
+ <ng-template #body let-role>
594
+ <tr>
595
+ <td>{{ role.name }}</td>
596
+ <td class="hidden md:table-cell">
597
+ {{ role.description ?? '-' }}
598
+ </td>
599
+ <td>
600
+ <f-tag
601
+ [value]="
602
+ role.isActive
603
+ ? ('shared.active' | translate)
604
+ : ('shared.inactive' | translate)
605
+ "
606
+ [severity]="role.isActive ? 'success' : 'secondary'"
607
+ />
608
+ </td>
609
+ <td class="hidden sm:table-cell">
610
+ <f-tag
611
+ [value]="
612
+ role.readOnly
613
+ ? ('shared.yes' | translate)
614
+ : ('shared.no' | translate)
615
+ "
616
+ [severity]="role.readOnly ? 'warn' : 'secondary'"
617
+ />
618
+ </td>
619
+ <td>
620
+ <div class="flex gap-1">
621
+ <button
622
+ fButton
623
+ *hasPermission="ROLE_PERMISSIONS.UPDATE"
624
+ [text]="true"
625
+ severity="secondary"
626
+ size="small"
627
+ [disabled]="role.readOnly"
628
+ [fTooltip]="'shared.edit' | translate"
629
+ (click)="onEdit(role)"
630
+ >
631
+ <ui-icon pButtonIcon name="pencil"></ui-icon>
632
+ </button>
633
+ @if (showRoleUsers()) {
634
+ <button
635
+ fButton
636
+ *hasPermission="USER_ROLE_PERMISSIONS.READ"
637
+ [text]="true"
638
+ severity="secondary"
639
+ size="small"
640
+ [fTooltip]="'iam.permission.view.users' | translate"
641
+ (click)="onViewUsers(role)"
642
+ >
643
+ <ui-icon pButtonIcon name="users"></ui-icon>
644
+ </button>
645
+ }
646
+ <button
647
+ fButton
648
+ *hasPermission="ROLE_PERMISSIONS.DELETE"
649
+ [text]="true"
650
+ severity="danger"
651
+ size="small"
652
+ [fTooltip]="'shared.delete' | translate"
653
+ [disabled]="role.readOnly"
654
+ (click)="onDelete(role)"
655
+ >
656
+ <ui-icon pButtonIcon name="trash"></ui-icon>
657
+ </button>
658
+ </div>
659
+ </td>
660
+ </tr>
661
+ </ng-template>
662
+ <ng-template #emptymessage>
663
+ <tr>
664
+ <td colspan="5" class="text-center py-4 text-muted-color">
665
+ {{ 'iam.role.no.roles' | translate }}
666
+ </td>
667
+ </tr>
668
+ </ng-template>
669
+ </f-table>
670
+ </div>
671
+ </div>
672
+
673
+ <flusys-role-permitted-users-dialog
674
+ [visible]="permittedUsersDialogVisible()"
675
+ [role]="selectedRole()"
676
+ (closed)="permittedUsersDialogVisible.set(false)"
677
+ />
678
+ `
679
+ }]
680
+ }],
681
+ ctorParameters: () => []
682
+ });
683
+ export { RoleListPageComponent };
684
+
685
+ //# sourceMappingURL=flusys-ng-iam-role-list-page.component-BCO_gQ8k.mjs.map