@flusys/ng-iam 5.4.1 → 6.0.0-beta.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/fesm2022/{flusys-ng-iam-action-form-page.component-BQJkl9pU.mjs → flusys-ng-iam-action-form-page.component-DTJT8Dc-.mjs} +102 -91
- package/fesm2022/flusys-ng-iam-action-form-page.component-DTJT8Dc-.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-action-list-page.component-BJ-tu6vu.mjs → flusys-ng-iam-action-list-page.component-B1hUE4lD.mjs} +71 -64
- package/fesm2022/flusys-ng-iam-action-list-page.component-B1hUE4lD.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-flusys-ng-iam-Bb39q1Bu.mjs → flusys-ng-iam-flusys-ng-iam-DzIO0zsO.mjs} +632 -547
- package/fesm2022/flusys-ng-iam-flusys-ng-iam-DzIO0zsO.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-iam-container.component-D0m8u6nu.mjs +105 -0
- package/fesm2022/flusys-ng-iam-iam-container.component-D0m8u6nu.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-permission-page.component-D4IHueFW.mjs → flusys-ng-iam-permission-page.component-rcijgKmE.mjs} +33 -28
- package/fesm2022/flusys-ng-iam-permission-page.component-rcijgKmE.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-role-form-page.component-CX8LxsdO.mjs → flusys-ng-iam-role-form-page.component-DrUQ0taO.mjs} +62 -47
- package/fesm2022/flusys-ng-iam-role-form-page.component-DrUQ0taO.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-role-list-page.component-CNOsO-gH.mjs → flusys-ng-iam-role-list-page.component-BcS9_ysT.mjs} +77 -65
- package/fesm2022/flusys-ng-iam-role-list-page.component-BcS9_ysT.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam.mjs +1 -1
- package/package.json +10 -11
- package/types/flusys-ng-iam.d.ts +2 -2
- package/fesm2022/flusys-ng-iam-action-form-page.component-BQJkl9pU.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-action-list-page.component-BJ-tu6vu.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-flusys-ng-iam-Bb39q1Bu.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-iam-container.component-DAiS1Mtk.mjs +0 -118
- package/fesm2022/flusys-ng-iam-iam-container.component-DAiS1Mtk.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-permission-page.component-D4IHueFW.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-role-form-page.component-CX8LxsdO.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-role-list-page.component-CNOsO-gH.mjs.map +0 -1
|
@@ -2,15 +2,11 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, signal, effect, untracked, Component } from '@angular/core';
|
|
3
3
|
import { Router } from '@angular/router';
|
|
4
4
|
import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
|
|
5
|
-
import
|
|
6
|
-
import { MessageService, ConfirmationService } from '
|
|
7
|
-
import
|
|
8
|
-
import { TagModule } from 'primeng/tag';
|
|
5
|
+
import * as i2 from '@flusys/ng-ui';
|
|
6
|
+
import { MessageService, ConfirmationService, UiModule } from '@flusys/ng-ui';
|
|
7
|
+
import { ACTION_PERMISSIONS, TranslateService, AngularModule, HasPermissionDirective, TranslatePipe } from '@flusys/ng-shared';
|
|
9
8
|
import { firstValueFrom } from 'rxjs';
|
|
10
|
-
import { A as ActionApiService, a as ActionType, c as convertActionToTreeNode } from './flusys-ng-iam-flusys-ng-iam-
|
|
11
|
-
import * as i2 from 'primeng/button';
|
|
12
|
-
import * as i6 from 'primeng/tooltip';
|
|
13
|
-
import * as i7 from 'primeng/treetable';
|
|
9
|
+
import { A as ActionApiService, a as ActionType, c as convertActionToTreeNode } from './flusys-ng-iam-flusys-ng-iam-DzIO0zsO.mjs';
|
|
14
10
|
|
|
15
11
|
class ActionListPageComponent {
|
|
16
12
|
ACTION_PERMISSIONS = ACTION_PERMISSIONS;
|
|
@@ -22,8 +18,10 @@ class ActionListPageComponent {
|
|
|
22
18
|
translateAdapter = inject(TranslateService, {
|
|
23
19
|
optional: true,
|
|
24
20
|
});
|
|
25
|
-
isLoading = signal(false,
|
|
26
|
-
|
|
21
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
23
|
+
treeNodes = signal([], /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "treeNodes" }] : /* istanbul ignore next */ []));
|
|
27
25
|
translate(key, vars) {
|
|
28
26
|
return this.translateAdapter?.translate(key, vars) ?? key;
|
|
29
27
|
}
|
|
@@ -77,7 +75,7 @@ class ActionListPageComponent {
|
|
|
77
75
|
name: action.name,
|
|
78
76
|
}),
|
|
79
77
|
header: this.translate('iam.action.delete.title'),
|
|
80
|
-
icon: '
|
|
78
|
+
icon: 'exclamation-triangle',
|
|
81
79
|
accept: async () => {
|
|
82
80
|
try {
|
|
83
81
|
const response = await this.actionApi.delete({
|
|
@@ -99,8 +97,8 @@ class ActionListPageComponent {
|
|
|
99
97
|
},
|
|
100
98
|
});
|
|
101
99
|
}
|
|
102
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
103
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
100
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ActionListPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: ActionListPageComponent, isStandalone: true, selector: "lib-action-list-page", ngImport: i0, template: `
|
|
104
102
|
<div class="card">
|
|
105
103
|
<div
|
|
106
104
|
class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4"
|
|
@@ -108,21 +106,22 @@ class ActionListPageComponent {
|
|
|
108
106
|
<h3 class="text-lg sm:text-xl font-semibold">
|
|
109
107
|
{{ 'iam.action.title' | translate }}
|
|
110
108
|
</h3>
|
|
111
|
-
<
|
|
109
|
+
<button
|
|
110
|
+
fButton
|
|
112
111
|
*hasPermission="ACTION_PERMISSIONS.CREATE"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
(click)="onCreate()"
|
|
113
|
+
class="w-full sm:w-auto"
|
|
114
|
+
>
|
|
115
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
116
|
+
<span pButtonLabel>{{ 'iam.action.new' | translate }}</span>
|
|
117
|
+
</button>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
121
|
-
<
|
|
121
|
+
<f-treetable
|
|
122
122
|
[value]="treeNodes()"
|
|
123
123
|
[loading]="isLoading()"
|
|
124
124
|
dataKey="id"
|
|
125
|
-
styleClass="p-treetable-sm"
|
|
126
125
|
[tableStyle]="{ 'min-width': '50rem' }"
|
|
127
126
|
>
|
|
128
127
|
<ng-template #header>
|
|
@@ -144,18 +143,18 @@ class ActionListPageComponent {
|
|
|
144
143
|
<ng-template #body let-rowNode let-rowData="rowData">
|
|
145
144
|
<tr>
|
|
146
145
|
<td>
|
|
147
|
-
<
|
|
146
|
+
<f-treetabletoggler [rowNode]="rowNode" />
|
|
148
147
|
{{ rowData.name }}
|
|
149
148
|
</td>
|
|
150
149
|
<td class="hidden md:table-cell">{{ rowData.code ?? '-' }}</td>
|
|
151
150
|
<td>
|
|
152
|
-
<
|
|
151
|
+
<f-tag
|
|
153
152
|
[value]="getActionTypeLabel(rowData.actionType)"
|
|
154
153
|
[severity]="getActionTypeSeverity(rowData.actionType)"
|
|
155
154
|
/>
|
|
156
155
|
</td>
|
|
157
156
|
<td class="hidden sm:table-cell">
|
|
158
|
-
<
|
|
157
|
+
<f-tag
|
|
159
158
|
[value]="
|
|
160
159
|
rowData.isActive
|
|
161
160
|
? ('shared.active' | translate)
|
|
@@ -165,7 +164,7 @@ class ActionListPageComponent {
|
|
|
165
164
|
/>
|
|
166
165
|
</td>
|
|
167
166
|
<td class="hidden lg:table-cell">
|
|
168
|
-
<
|
|
167
|
+
<f-tag
|
|
169
168
|
[value]="
|
|
170
169
|
rowData.readOnly
|
|
171
170
|
? ('shared.yes' | translate)
|
|
@@ -176,26 +175,30 @@ class ActionListPageComponent {
|
|
|
176
175
|
</td>
|
|
177
176
|
<td>
|
|
178
177
|
<div class="flex gap-1">
|
|
179
|
-
<
|
|
178
|
+
<button
|
|
179
|
+
fButton
|
|
180
180
|
*hasPermission="ACTION_PERMISSIONS.UPDATE"
|
|
181
|
-
icon="pi pi-pencil"
|
|
182
181
|
[text]="true"
|
|
183
182
|
severity="secondary"
|
|
184
183
|
size="small"
|
|
185
184
|
[disabled]="rowData.readOnly"
|
|
186
|
-
[
|
|
187
|
-
(
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
[fTooltip]="'shared.edit' | translate"
|
|
186
|
+
(click)="onEdit(rowData)"
|
|
187
|
+
>
|
|
188
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
189
|
+
</button>
|
|
190
|
+
<button
|
|
191
|
+
fButton
|
|
190
192
|
*hasPermission="ACTION_PERMISSIONS.DELETE"
|
|
191
|
-
icon="pi pi-trash"
|
|
192
193
|
[text]="true"
|
|
193
194
|
severity="danger"
|
|
194
195
|
size="small"
|
|
195
|
-
[
|
|
196
|
+
[fTooltip]="'shared.delete' | translate"
|
|
196
197
|
[disabled]="rowData.readOnly"
|
|
197
|
-
(
|
|
198
|
-
|
|
198
|
+
(click)="onDelete(rowData)"
|
|
199
|
+
>
|
|
200
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
201
|
+
</button>
|
|
199
202
|
</div>
|
|
200
203
|
</td>
|
|
201
204
|
</tr>
|
|
@@ -207,19 +210,18 @@ class ActionListPageComponent {
|
|
|
207
210
|
</td>
|
|
208
211
|
</tr>
|
|
209
212
|
</ng-template>
|
|
210
|
-
</
|
|
213
|
+
</f-treetable>
|
|
211
214
|
</div>
|
|
212
215
|
</div>
|
|
213
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type:
|
|
216
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: UiModule }, { kind: "directive", type: i2.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i2.TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color"] }, { kind: "directive", type: i2.TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay"] }, { kind: "component", type: i2.TreeTableComponent, selector: "f-treetable", inputs: ["value", "loading", "dataKey", "styleClass", "tableStyle", "scrollable"] }, { kind: "component", type: i2.TreeTableTogglerComponent, selector: "f-treetabletoggler", inputs: ["rowNode"] }, { kind: "component", type: i2.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "directive", type: HasPermissionDirective, selector: "[hasPermission]", inputs: ["hasPermission"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
214
217
|
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ActionListPageComponent, decorators: [{
|
|
216
219
|
type: Component,
|
|
217
220
|
args: [{
|
|
218
221
|
selector: 'lib-action-list-page',
|
|
219
222
|
imports: [
|
|
220
223
|
AngularModule,
|
|
221
|
-
|
|
222
|
-
TagModule,
|
|
224
|
+
UiModule,
|
|
223
225
|
HasPermissionDirective,
|
|
224
226
|
TranslatePipe,
|
|
225
227
|
],
|
|
@@ -231,21 +233,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
231
233
|
<h3 class="text-lg sm:text-xl font-semibold">
|
|
232
234
|
{{ 'iam.action.title' | translate }}
|
|
233
235
|
</h3>
|
|
234
|
-
<
|
|
236
|
+
<button
|
|
237
|
+
fButton
|
|
235
238
|
*hasPermission="ACTION_PERMISSIONS.CREATE"
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
(click)="onCreate()"
|
|
240
|
+
class="w-full sm:w-auto"
|
|
241
|
+
>
|
|
242
|
+
<ui-icon pButtonIcon name="plus"></ui-icon>
|
|
243
|
+
<span pButtonLabel>{{ 'iam.action.new' | translate }}</span>
|
|
244
|
+
</button>
|
|
241
245
|
</div>
|
|
242
246
|
|
|
243
247
|
<div class="overflow-x-auto -mx-4 sm:mx-0">
|
|
244
|
-
<
|
|
248
|
+
<f-treetable
|
|
245
249
|
[value]="treeNodes()"
|
|
246
250
|
[loading]="isLoading()"
|
|
247
251
|
dataKey="id"
|
|
248
|
-
styleClass="p-treetable-sm"
|
|
249
252
|
[tableStyle]="{ 'min-width': '50rem' }"
|
|
250
253
|
>
|
|
251
254
|
<ng-template #header>
|
|
@@ -267,18 +270,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
267
270
|
<ng-template #body let-rowNode let-rowData="rowData">
|
|
268
271
|
<tr>
|
|
269
272
|
<td>
|
|
270
|
-
<
|
|
273
|
+
<f-treetabletoggler [rowNode]="rowNode" />
|
|
271
274
|
{{ rowData.name }}
|
|
272
275
|
</td>
|
|
273
276
|
<td class="hidden md:table-cell">{{ rowData.code ?? '-' }}</td>
|
|
274
277
|
<td>
|
|
275
|
-
<
|
|
278
|
+
<f-tag
|
|
276
279
|
[value]="getActionTypeLabel(rowData.actionType)"
|
|
277
280
|
[severity]="getActionTypeSeverity(rowData.actionType)"
|
|
278
281
|
/>
|
|
279
282
|
</td>
|
|
280
283
|
<td class="hidden sm:table-cell">
|
|
281
|
-
<
|
|
284
|
+
<f-tag
|
|
282
285
|
[value]="
|
|
283
286
|
rowData.isActive
|
|
284
287
|
? ('shared.active' | translate)
|
|
@@ -288,7 +291,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
288
291
|
/>
|
|
289
292
|
</td>
|
|
290
293
|
<td class="hidden lg:table-cell">
|
|
291
|
-
<
|
|
294
|
+
<f-tag
|
|
292
295
|
[value]="
|
|
293
296
|
rowData.readOnly
|
|
294
297
|
? ('shared.yes' | translate)
|
|
@@ -299,26 +302,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
299
302
|
</td>
|
|
300
303
|
<td>
|
|
301
304
|
<div class="flex gap-1">
|
|
302
|
-
<
|
|
305
|
+
<button
|
|
306
|
+
fButton
|
|
303
307
|
*hasPermission="ACTION_PERMISSIONS.UPDATE"
|
|
304
|
-
icon="pi pi-pencil"
|
|
305
308
|
[text]="true"
|
|
306
309
|
severity="secondary"
|
|
307
310
|
size="small"
|
|
308
311
|
[disabled]="rowData.readOnly"
|
|
309
|
-
[
|
|
310
|
-
(
|
|
311
|
-
|
|
312
|
-
|
|
312
|
+
[fTooltip]="'shared.edit' | translate"
|
|
313
|
+
(click)="onEdit(rowData)"
|
|
314
|
+
>
|
|
315
|
+
<ui-icon pButtonIcon name="pencil"></ui-icon>
|
|
316
|
+
</button>
|
|
317
|
+
<button
|
|
318
|
+
fButton
|
|
313
319
|
*hasPermission="ACTION_PERMISSIONS.DELETE"
|
|
314
|
-
icon="pi pi-trash"
|
|
315
320
|
[text]="true"
|
|
316
321
|
severity="danger"
|
|
317
322
|
size="small"
|
|
318
|
-
[
|
|
323
|
+
[fTooltip]="'shared.delete' | translate"
|
|
319
324
|
[disabled]="rowData.readOnly"
|
|
320
|
-
(
|
|
321
|
-
|
|
325
|
+
(click)="onDelete(rowData)"
|
|
326
|
+
>
|
|
327
|
+
<ui-icon pButtonIcon name="trash"></ui-icon>
|
|
328
|
+
</button>
|
|
322
329
|
</div>
|
|
323
330
|
</td>
|
|
324
331
|
</tr>
|
|
@@ -330,7 +337,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
330
337
|
</td>
|
|
331
338
|
</tr>
|
|
332
339
|
</ng-template>
|
|
333
|
-
</
|
|
340
|
+
</f-treetable>
|
|
334
341
|
</div>
|
|
335
342
|
</div>
|
|
336
343
|
`,
|
|
@@ -338,4 +345,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
338
345
|
}], ctorParameters: () => [] });
|
|
339
346
|
|
|
340
347
|
export { ActionListPageComponent };
|
|
341
|
-
//# sourceMappingURL=flusys-ng-iam-action-list-page.component-
|
|
348
|
+
//# sourceMappingURL=flusys-ng-iam-action-list-page.component-B1hUE4lD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-iam-action-list-page.component-B1hUE4lD.mjs","sources":["../../../projects/ng-iam/pages/action/action-list-page.component.ts"],"sourcesContent":["import { Component, effect, inject, signal, untracked } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';\nimport { ConfirmationService, MessageService, TreeNode } from '@flusys/ng-ui';\nimport {\n ACTION_PERMISSIONS,\n AngularModule,\n HasPermissionDirective,\n TranslatePipe,\n TranslateService,\n} from '@flusys/ng-shared';\nimport { firstValueFrom } from 'rxjs';\nimport { ActionType, IAction } from '../../interfaces/action.interface';\nimport { ActionApiService } from '../../services/action-api.service';\nimport { convertActionToTreeNode } from '../../utils/tree-utils';\nimport { UiModule } from '@flusys/ng-ui';\n\n@Component({\n selector: 'lib-action-list-page',\n imports: [\n AngularModule,\n UiModule,\n HasPermissionDirective,\n TranslatePipe,\n ],\n template: `\n <div class=\"card\">\n <div\n class=\"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4\"\n >\n <h3 class=\"text-lg sm:text-xl font-semibold\">\n {{ 'iam.action.title' | translate }}\n </h3>\n <button\n fButton\n *hasPermission=\"ACTION_PERMISSIONS.CREATE\"\n (click)=\"onCreate()\"\n class=\"w-full sm:w-auto\"\n >\n <ui-icon pButtonIcon name=\"plus\"></ui-icon>\n <span pButtonLabel>{{ 'iam.action.new' | translate }}</span>\n </button>\n </div>\n\n <div class=\"overflow-x-auto -mx-4 sm:mx-0\">\n <f-treetable\n [value]=\"treeNodes()\"\n [loading]=\"isLoading()\"\n dataKey=\"id\"\n [tableStyle]=\"{ 'min-width': '50rem' }\"\n >\n <ng-template #header>\n <tr>\n <th>{{ 'iam.action.name' | translate }}</th>\n <th class=\"hidden md:table-cell\">\n {{ 'iam.action.code' | translate }}\n </th>\n <th>{{ 'iam.action.type' | translate }}</th>\n <th class=\"hidden sm:table-cell\">\n {{ 'shared.active' | translate }}\n </th>\n <th class=\"hidden lg:table-cell\">\n {{ 'shared.read.only' | translate }}\n </th>\n <th class=\"w-[100px]\">{{ 'shared.actions' | translate }}</th>\n </tr>\n </ng-template>\n <ng-template #body let-rowNode let-rowData=\"rowData\">\n <tr>\n <td>\n <f-treetabletoggler [rowNode]=\"rowNode\" />\n {{ rowData.name }}\n </td>\n <td class=\"hidden md:table-cell\">{{ rowData.code ?? '-' }}</td>\n <td>\n <f-tag\n [value]=\"getActionTypeLabel(rowData.actionType)\"\n [severity]=\"getActionTypeSeverity(rowData.actionType)\"\n />\n </td>\n <td class=\"hidden sm:table-cell\">\n <f-tag\n [value]=\"\n rowData.isActive\n ? ('shared.active' | translate)\n : ('shared.inactive' | translate)\n \"\n [severity]=\"rowData.isActive ? 'success' : 'secondary'\"\n />\n </td>\n <td class=\"hidden lg:table-cell\">\n <f-tag\n [value]=\"\n rowData.readOnly\n ? ('shared.yes' | translate)\n : ('shared.no' | translate)\n \"\n [severity]=\"rowData.readOnly ? 'warn' : 'secondary'\"\n />\n </td>\n <td>\n <div class=\"flex gap-1\">\n <button\n fButton\n *hasPermission=\"ACTION_PERMISSIONS.UPDATE\"\n [text]=\"true\"\n severity=\"secondary\"\n size=\"small\"\n [disabled]=\"rowData.readOnly\"\n [fTooltip]=\"'shared.edit' | translate\"\n (click)=\"onEdit(rowData)\"\n >\n <ui-icon pButtonIcon name=\"pencil\"></ui-icon>\n </button>\n <button\n fButton\n *hasPermission=\"ACTION_PERMISSIONS.DELETE\"\n [text]=\"true\"\n severity=\"danger\"\n size=\"small\"\n [fTooltip]=\"'shared.delete' | translate\"\n [disabled]=\"rowData.readOnly\"\n (click)=\"onDelete(rowData)\"\n >\n <ui-icon pButtonIcon name=\"trash\"></ui-icon>\n </button>\n </div>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td colspan=\"6\" class=\"text-center py-4 text-muted-color\">\n {{ 'iam.action.no.actions' | translate }}\n </td>\n </tr>\n </ng-template>\n </f-treetable>\n </div>\n </div>\n `,\n})\nexport class ActionListPageComponent {\n readonly ACTION_PERMISSIONS = ACTION_PERMISSIONS;\n\n private readonly router = inject(Router);\n private readonly companyContext = inject(LAYOUT_AUTH_STATE);\n private readonly actionApi = inject(ActionApiService);\n private readonly messageService = inject(MessageService);\n private readonly confirmationService = inject(ConfirmationService);\n private readonly translateAdapter = inject(TranslateService, {\n optional: true,\n });\n\n readonly isLoading = signal(false);\n readonly treeNodes = signal<TreeNode<IAction>[]>([]);\n\n private translate(\n key: string,\n vars?: Record<string, string | number>,\n ): string {\n return this.translateAdapter?.translate(key, vars) ?? key;\n }\n\n private static readonly TYPE_SEVERITIES: Record<\n ActionType,\n 'info' | 'success' | 'warn'\n > = {\n [ActionType.BACKEND]: 'info',\n [ActionType.FRONTEND]: 'success',\n [ActionType.BOTH]: 'warn',\n };\n\n private static readonly TYPE_LABEL_KEYS: Record<ActionType, string> = {\n [ActionType.BACKEND]: 'iam.action.type.backend',\n [ActionType.FRONTEND]: 'iam.action.type.frontend',\n [ActionType.BOTH]: 'iam.action.type.both',\n };\n\n constructor() {\n effect(() => {\n this.companyContext.currentCompanyInfo();\n untracked(() => this.loadActions());\n });\n }\n\n private async loadActions(): Promise<void> {\n this.isLoading.set(true);\n try {\n const response = await firstValueFrom(this.actionApi.getTree());\n this.treeNodes.set(\n convertActionToTreeNode(response?.success ? (response.data ?? []) : []),\n );\n } catch {\n // Handled by global interceptor\n } finally {\n this.isLoading.set(false);\n }\n }\n\n getActionTypeLabel(type: ActionType): string {\n const key =\n ActionListPageComponent.TYPE_LABEL_KEYS[type] ?? 'shared.unknown';\n return this.translate(key);\n }\n\n getActionTypeSeverity(type: ActionType): 'info' | 'success' | 'warn' {\n return ActionListPageComponent.TYPE_SEVERITIES[type] ?? 'info';\n }\n\n onCreate(): void {\n this.router.navigate(['/iam/actions/new']);\n }\n\n onEdit(action: IAction): void {\n this.router.navigate(['/iam/actions', action.id]);\n }\n\n onDelete(action: IAction): void {\n if (!action?.id || !action?.name) return;\n\n this.confirmationService.confirm({\n message: this.translate('shared.confirm.delete.item', {\n name: action.name,\n }),\n header: this.translate('iam.action.delete.title'),\n icon: 'exclamation-triangle',\n accept: async () => {\n try {\n const response = await this.actionApi.delete({\n id: action.id,\n type: 'delete',\n });\n await this.loadActions();\n this.messageService.add({\n severity: 'success',\n summary: this.translate('shared.success'),\n detail: response?.messageKey\n ? this.translate(\n response.messageKey,\n response.messageVariables as Record<string, string | number>,\n )\n : (response?.message ?? ''),\n });\n } catch {\n // Handled by global interceptor\n }\n },\n });\n }\n}\n"],"names":["i1"],"mappings":";;;;;;;;;;MA8Ia,uBAAuB,CAAA;IACzB,kBAAkB,GAAG,kBAAkB;AAE/B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;A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