@flusys/ng-iam 1.1.1-beta → 3.0.0-rc
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/README.md +175 -24
- package/fesm2022/flusys-ng-iam-action-form-page.component-CVN8sV-c.mjs +389 -0
- package/fesm2022/flusys-ng-iam-action-form-page.component-CVN8sV-c.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-action-list-page.component-CQ6RazN0.mjs +262 -0
- package/fesm2022/flusys-ng-iam-action-list-page.component-CQ6RazN0.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs → flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs} +1016 -1585
- package/fesm2022/flusys-ng-iam-flusys-ng-iam-DrGHlTiz.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-iam-container.component-BToYxEej.mjs +92 -0
- package/fesm2022/flusys-ng-iam-iam-container.component-BToYxEej.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-permission-page.component-BS7xXmsn.mjs +137 -0
- package/fesm2022/flusys-ng-iam-permission-page.component-BS7xXmsn.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs → flusys-ng-iam-role-form-page.component-BjPwXkip.mjs} +106 -148
- package/fesm2022/flusys-ng-iam-role-form-page.component-BjPwXkip.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-role-list-page.component-Cz-jk-R_.mjs +299 -0
- package/fesm2022/flusys-ng-iam-role-list-page.component-Cz-jk-R_.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam.mjs +1 -1
- package/package.json +5 -5
- package/types/flusys-ng-iam.d.ts +75 -454
- package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs +0 -467
- package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs +0 -281
- package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs +0 -97
- package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs +0 -143
- package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs +0 -266
- package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs.map +0 -1
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
|
|
5
|
-
import { AngularModule, PrimeModule } from '@flusys/ng-shared';
|
|
6
|
-
import * as i2 from 'primeng/api';
|
|
7
|
-
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
8
|
-
import * as i6 from 'primeng/tag';
|
|
9
|
-
import { TagModule } from 'primeng/tag';
|
|
10
|
-
import { firstValueFrom } from 'rxjs';
|
|
11
|
-
import { A as ActionApiService, c as convertActionToTreeNode, a as ActionType } from './flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs';
|
|
12
|
-
import * as i2$1 from 'primeng/button';
|
|
13
|
-
import * as i8 from 'primeng/treetable';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Action List Page Component
|
|
17
|
-
*
|
|
18
|
-
* Displays hierarchical tree of actions with search, filter, and CRUD operations
|
|
19
|
-
*/
|
|
20
|
-
class ActionListPageComponent {
|
|
21
|
-
router = inject(Router);
|
|
22
|
-
companyContext = inject(LAYOUT_AUTH_STATE);
|
|
23
|
-
actionApi = inject(ActionApiService);
|
|
24
|
-
messageService = inject(MessageService);
|
|
25
|
-
confirmationService = inject(ConfirmationService);
|
|
26
|
-
isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
27
|
-
treeNodes = signal([], ...(ngDevMode ? [{ debugName: "treeNodes" }] : []));
|
|
28
|
-
constructor() {
|
|
29
|
-
effect(() => {
|
|
30
|
-
this.companyContext.currentCompanyInfo();
|
|
31
|
-
untracked(() => this.loadActions());
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
async loadActions() {
|
|
35
|
-
this.isLoading.set(true);
|
|
36
|
-
try {
|
|
37
|
-
const response = await firstValueFrom(this.actionApi.getTree());
|
|
38
|
-
const tree = response?.success ? response.data ?? [] : [];
|
|
39
|
-
this.treeNodes.set(convertActionToTreeNode(tree));
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
this.messageService.add({
|
|
43
|
-
severity: 'error',
|
|
44
|
-
summary: 'Error',
|
|
45
|
-
detail: 'Failed to load actions',
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
this.isLoading.set(false);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get action type label
|
|
54
|
-
*/
|
|
55
|
-
getActionTypeLabel(type) {
|
|
56
|
-
switch (type) {
|
|
57
|
-
case ActionType.BACKEND:
|
|
58
|
-
return 'Backend';
|
|
59
|
-
case ActionType.FRONTEND:
|
|
60
|
-
return 'Frontend';
|
|
61
|
-
case ActionType.BOTH:
|
|
62
|
-
return 'Both';
|
|
63
|
-
default:
|
|
64
|
-
return 'Unknown';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get action type severity for tag styling
|
|
69
|
-
*/
|
|
70
|
-
getActionTypeSeverity(type) {
|
|
71
|
-
switch (type) {
|
|
72
|
-
case ActionType.BACKEND:
|
|
73
|
-
return 'info';
|
|
74
|
-
case ActionType.FRONTEND:
|
|
75
|
-
return 'success';
|
|
76
|
-
case ActionType.BOTH:
|
|
77
|
-
return 'warn';
|
|
78
|
-
default:
|
|
79
|
-
return 'info';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
onCreate() {
|
|
83
|
-
this.router.navigate(['/iam/actions/new']);
|
|
84
|
-
}
|
|
85
|
-
onEdit(action) {
|
|
86
|
-
this.router.navigate(['/iam/actions', action.id]);
|
|
87
|
-
}
|
|
88
|
-
onDelete(action) {
|
|
89
|
-
if (!action?.id || !action?.name) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
this.confirmationService.confirm({
|
|
93
|
-
message: `Are you sure you want to delete action "${action.name}"?`,
|
|
94
|
-
header: 'Confirm Delete',
|
|
95
|
-
icon: 'pi pi-exclamation-triangle',
|
|
96
|
-
accept: async () => {
|
|
97
|
-
try {
|
|
98
|
-
await this.actionApi.deleteAsync({ id: action.id, type: 'delete' });
|
|
99
|
-
await this.loadActions();
|
|
100
|
-
this.messageService.add({
|
|
101
|
-
severity: 'success',
|
|
102
|
-
summary: 'Success',
|
|
103
|
-
detail: 'Action deleted successfully',
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
this.messageService.add({
|
|
108
|
-
severity: 'error',
|
|
109
|
-
summary: 'Error',
|
|
110
|
-
detail: error instanceof Error ? error.message : 'Failed to delete action',
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ActionListPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
117
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ActionListPageComponent, isStandalone: true, selector: "lib-action-list-page", ngImport: i0, template: `
|
|
118
|
-
<div class="card">
|
|
119
|
-
<div class="flex justify-between items-center mb-4">
|
|
120
|
-
<h3 class="text-xl font-semibold">Actions</h3>
|
|
121
|
-
<p-button
|
|
122
|
-
label="New Action"
|
|
123
|
-
icon="pi pi-plus"
|
|
124
|
-
(onClick)="onCreate()" />
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<p-treeTable
|
|
128
|
-
[value]="treeNodes()"
|
|
129
|
-
[loading]="isLoading()"
|
|
130
|
-
[scrollable]="true"
|
|
131
|
-
scrollHeight="flex"
|
|
132
|
-
dataKey="id"
|
|
133
|
-
styleClass="p-treetable-sm">
|
|
134
|
-
<ng-template pTemplate="header">
|
|
135
|
-
<tr>
|
|
136
|
-
<th>Name</th>
|
|
137
|
-
<th>Code</th>
|
|
138
|
-
<th>Action Type</th>
|
|
139
|
-
<th>Active</th>
|
|
140
|
-
<th>Read Only</th>
|
|
141
|
-
<th style="width: 150px">Actions</th>
|
|
142
|
-
</tr>
|
|
143
|
-
</ng-template>
|
|
144
|
-
<ng-template pTemplate="body" let-rowNode let-rowData="rowData">
|
|
145
|
-
<tr>
|
|
146
|
-
<td>
|
|
147
|
-
<p-treeTableToggler [rowNode]="rowNode" />
|
|
148
|
-
{{ rowData.name }}
|
|
149
|
-
</td>
|
|
150
|
-
<td>{{ rowData.code ?? '-' }}</td>
|
|
151
|
-
<td>
|
|
152
|
-
<p-tag
|
|
153
|
-
[value]="getActionTypeLabel(rowData.actionType)"
|
|
154
|
-
[severity]="getActionTypeSeverity(rowData.actionType)" />
|
|
155
|
-
</td>
|
|
156
|
-
<td>
|
|
157
|
-
<p-tag
|
|
158
|
-
[value]="rowData.isActive ? 'Active' : 'Inactive'"
|
|
159
|
-
[severity]="rowData.isActive ? 'success' : 'secondary'" />
|
|
160
|
-
</td>
|
|
161
|
-
<td>
|
|
162
|
-
<p-tag
|
|
163
|
-
[value]="rowData.readOnly ? 'Yes' : 'No'"
|
|
164
|
-
[severity]="rowData.readOnly ? 'warn' : 'secondary'" />
|
|
165
|
-
</td>
|
|
166
|
-
<td>
|
|
167
|
-
<div class="flex gap-2">
|
|
168
|
-
<p-button
|
|
169
|
-
icon="pi pi-pencil"
|
|
170
|
-
[outlined]="true"
|
|
171
|
-
severity="info"
|
|
172
|
-
size="small"
|
|
173
|
-
(onClick)="onEdit(rowData)" />
|
|
174
|
-
<p-button
|
|
175
|
-
icon="pi pi-trash"
|
|
176
|
-
[outlined]="true"
|
|
177
|
-
severity="danger"
|
|
178
|
-
size="small"
|
|
179
|
-
[disabled]="rowData.readOnly"
|
|
180
|
-
(onClick)="onDelete(rowData)" />
|
|
181
|
-
</div>
|
|
182
|
-
</td>
|
|
183
|
-
</tr>
|
|
184
|
-
</ng-template>
|
|
185
|
-
<ng-template pTemplate="emptymessage">
|
|
186
|
-
<tr>
|
|
187
|
-
<td colspan="6" class="text-center">No actions found.</td>
|
|
188
|
-
</tr>
|
|
189
|
-
</ng-template>
|
|
190
|
-
</p-treeTable>
|
|
191
|
-
</div>
|
|
192
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: PrimeModule }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i6.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i8.TreeTable, selector: "p-treeTable, p-treetable, p-tree-table", inputs: ["columns", "styleClass", "tableStyle", "tableStyleClass", "autoLayout", "lazy", "lazyLoadOnInit", "paginator", "rows", "first", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "customSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "compareSelectionBy", "rowHover", "loading", "loadingIcon", "showLoader", "scrollable", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "frozenColumns", "resizableColumns", "columnResizeMode", "reorderableColumns", "contextMenu", "rowTrackBy", "filters", "globalFilterFields", "filterDelay", "filterMode", "filterLocale", "paginatorLocale", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "value", "virtualRowHeight", "selectionKeys", "showGridlines"], outputs: ["selectionChange", "contextMenuSelectionChange", "onFilter", "onNodeExpand", "onNodeCollapse", "onPage", "onSort", "onLazyLoad", "sortFunction", "onColResize", "onColReorder", "onNodeSelect", "onNodeUnselect", "onContextMenuSelect", "onHeaderCheckboxToggle", "onEditInit", "onEditComplete", "onEditCancel", "selectionKeysChange"] }, { kind: "component", type: i8.TreeTableToggler, selector: "p-treeTableToggler, p-treetabletoggler, p-treetable-toggler", inputs: ["rowNode"] }, { kind: "ngmodule", type: TagModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
193
|
-
}
|
|
194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ActionListPageComponent, decorators: [{
|
|
195
|
-
type: Component,
|
|
196
|
-
args: [{
|
|
197
|
-
selector: 'lib-action-list-page',
|
|
198
|
-
standalone: true,
|
|
199
|
-
imports: [AngularModule, PrimeModule, TagModule],
|
|
200
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
201
|
-
template: `
|
|
202
|
-
<div class="card">
|
|
203
|
-
<div class="flex justify-between items-center mb-4">
|
|
204
|
-
<h3 class="text-xl font-semibold">Actions</h3>
|
|
205
|
-
<p-button
|
|
206
|
-
label="New Action"
|
|
207
|
-
icon="pi pi-plus"
|
|
208
|
-
(onClick)="onCreate()" />
|
|
209
|
-
</div>
|
|
210
|
-
|
|
211
|
-
<p-treeTable
|
|
212
|
-
[value]="treeNodes()"
|
|
213
|
-
[loading]="isLoading()"
|
|
214
|
-
[scrollable]="true"
|
|
215
|
-
scrollHeight="flex"
|
|
216
|
-
dataKey="id"
|
|
217
|
-
styleClass="p-treetable-sm">
|
|
218
|
-
<ng-template pTemplate="header">
|
|
219
|
-
<tr>
|
|
220
|
-
<th>Name</th>
|
|
221
|
-
<th>Code</th>
|
|
222
|
-
<th>Action Type</th>
|
|
223
|
-
<th>Active</th>
|
|
224
|
-
<th>Read Only</th>
|
|
225
|
-
<th style="width: 150px">Actions</th>
|
|
226
|
-
</tr>
|
|
227
|
-
</ng-template>
|
|
228
|
-
<ng-template pTemplate="body" let-rowNode let-rowData="rowData">
|
|
229
|
-
<tr>
|
|
230
|
-
<td>
|
|
231
|
-
<p-treeTableToggler [rowNode]="rowNode" />
|
|
232
|
-
{{ rowData.name }}
|
|
233
|
-
</td>
|
|
234
|
-
<td>{{ rowData.code ?? '-' }}</td>
|
|
235
|
-
<td>
|
|
236
|
-
<p-tag
|
|
237
|
-
[value]="getActionTypeLabel(rowData.actionType)"
|
|
238
|
-
[severity]="getActionTypeSeverity(rowData.actionType)" />
|
|
239
|
-
</td>
|
|
240
|
-
<td>
|
|
241
|
-
<p-tag
|
|
242
|
-
[value]="rowData.isActive ? 'Active' : 'Inactive'"
|
|
243
|
-
[severity]="rowData.isActive ? 'success' : 'secondary'" />
|
|
244
|
-
</td>
|
|
245
|
-
<td>
|
|
246
|
-
<p-tag
|
|
247
|
-
[value]="rowData.readOnly ? 'Yes' : 'No'"
|
|
248
|
-
[severity]="rowData.readOnly ? 'warn' : 'secondary'" />
|
|
249
|
-
</td>
|
|
250
|
-
<td>
|
|
251
|
-
<div class="flex gap-2">
|
|
252
|
-
<p-button
|
|
253
|
-
icon="pi pi-pencil"
|
|
254
|
-
[outlined]="true"
|
|
255
|
-
severity="info"
|
|
256
|
-
size="small"
|
|
257
|
-
(onClick)="onEdit(rowData)" />
|
|
258
|
-
<p-button
|
|
259
|
-
icon="pi pi-trash"
|
|
260
|
-
[outlined]="true"
|
|
261
|
-
severity="danger"
|
|
262
|
-
size="small"
|
|
263
|
-
[disabled]="rowData.readOnly"
|
|
264
|
-
(onClick)="onDelete(rowData)" />
|
|
265
|
-
</div>
|
|
266
|
-
</td>
|
|
267
|
-
</tr>
|
|
268
|
-
</ng-template>
|
|
269
|
-
<ng-template pTemplate="emptymessage">
|
|
270
|
-
<tr>
|
|
271
|
-
<td colspan="6" class="text-center">No actions found.</td>
|
|
272
|
-
</tr>
|
|
273
|
-
</ng-template>
|
|
274
|
-
</p-treeTable>
|
|
275
|
-
</div>
|
|
276
|
-
`,
|
|
277
|
-
}]
|
|
278
|
-
}], ctorParameters: () => [] });
|
|
279
|
-
|
|
280
|
-
export { ActionListPageComponent };
|
|
281
|
-
//# sourceMappingURL=flusys-ng-iam-action-list-page.component-BCzSardO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flusys-ng-iam-action-list-page.component-BCzSardO.mjs","sources":["../../../projects/ng-iam/pages/action/action-list-page.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, inject, signal, untracked } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';\nimport { AngularModule, PrimeModule } from '@flusys/ng-shared';\nimport { MessageService, ConfirmationService, TreeNode } from 'primeng/api';\nimport { TagModule } from 'primeng/tag';\nimport { firstValueFrom } from 'rxjs';\nimport { ActionApiService } from '../../services/action-api.service';\nimport { ActionType, IAction } from '../../interfaces/action.interface';\nimport { convertActionToTreeNode } from '../../utils/tree-utils';\n\n/**\n * Action List Page Component\n *\n * Displays hierarchical tree of actions with search, filter, and CRUD operations\n */\n@Component({\n selector: 'lib-action-list-page',\n standalone: true,\n imports: [AngularModule, PrimeModule, TagModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"card\">\n <div class=\"flex justify-between items-center mb-4\">\n <h3 class=\"text-xl font-semibold\">Actions</h3>\n <p-button\n label=\"New Action\"\n icon=\"pi pi-plus\"\n (onClick)=\"onCreate()\" />\n </div>\n\n <p-treeTable\n [value]=\"treeNodes()\"\n [loading]=\"isLoading()\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n dataKey=\"id\"\n styleClass=\"p-treetable-sm\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th>Name</th>\n <th>Code</th>\n <th>Action Type</th>\n <th>Active</th>\n <th>Read Only</th>\n <th style=\"width: 150px\">Actions</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowNode let-rowData=\"rowData\">\n <tr>\n <td>\n <p-treeTableToggler [rowNode]=\"rowNode\" />\n {{ rowData.name }}\n </td>\n <td>{{ rowData.code ?? '-' }}</td>\n <td>\n <p-tag\n [value]=\"getActionTypeLabel(rowData.actionType)\"\n [severity]=\"getActionTypeSeverity(rowData.actionType)\" />\n </td>\n <td>\n <p-tag\n [value]=\"rowData.isActive ? 'Active' : 'Inactive'\"\n [severity]=\"rowData.isActive ? 'success' : 'secondary'\" />\n </td>\n <td>\n <p-tag\n [value]=\"rowData.readOnly ? 'Yes' : 'No'\"\n [severity]=\"rowData.readOnly ? 'warn' : 'secondary'\" />\n </td>\n <td>\n <div class=\"flex gap-2\">\n <p-button\n icon=\"pi pi-pencil\"\n [outlined]=\"true\"\n severity=\"info\"\n size=\"small\"\n (onClick)=\"onEdit(rowData)\" />\n <p-button\n icon=\"pi pi-trash\"\n [outlined]=\"true\"\n severity=\"danger\"\n size=\"small\"\n [disabled]=\"rowData.readOnly\"\n (onClick)=\"onDelete(rowData)\" />\n </div>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td colspan=\"6\" class=\"text-center\">No actions found.</td>\n </tr>\n </ng-template>\n </p-treeTable>\n </div>\n `,\n})\nexport class ActionListPageComponent {\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\n readonly isLoading = signal(false);\n readonly treeNodes = signal<TreeNode<IAction>[]>([]);\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 const tree = response?.success ? response.data ?? [] : [];\n this.treeNodes.set(convertActionToTreeNode(tree));\n } catch {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: 'Failed to load actions',\n });\n } finally {\n this.isLoading.set(false);\n }\n }\n\n /**\n * Get action type label\n */\n getActionTypeLabel(type: ActionType): string {\n switch (type) {\n case ActionType.BACKEND:\n return 'Backend';\n case ActionType.FRONTEND:\n return 'Frontend';\n case ActionType.BOTH:\n return 'Both';\n default:\n return 'Unknown';\n }\n }\n\n /**\n * Get action type severity for tag styling\n */\n getActionTypeSeverity(type: ActionType): 'info' | 'success' | 'warn' {\n switch (type) {\n case ActionType.BACKEND:\n return 'info';\n case ActionType.FRONTEND:\n return 'success';\n case ActionType.BOTH:\n return 'warn';\n default:\n return 'info';\n }\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) {\n return;\n }\n\n this.confirmationService.confirm({\n message: `Are you sure you want to delete action \"${action.name}\"?`,\n header: 'Confirm Delete',\n icon: 'pi pi-exclamation-triangle',\n accept: async () => {\n try {\n await this.actionApi.deleteAsync({ id: action.id, type: 'delete' });\n await this.loadActions();\n this.messageService.add({\n severity: 'success',\n summary: 'Success',\n detail: 'Action deleted successfully',\n });\n } catch (error) {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: error instanceof Error ? error.message : 'Failed to delete action',\n });\n }\n },\n });\n }\n}\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;AAWA;;;;AAIG;MAmFU,uBAAuB,CAAA;AACjB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACpC,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAEzD,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;AACzB,IAAA,SAAS,GAAG,MAAM,CAAsB,EAAE,qDAAC;AAEpD,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE;YACxC,SAAS,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;AACrC,QAAA,CAAC,CAAC;IACJ;AAEQ,IAAA,MAAM,WAAW,GAAA;AACvB,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;AACxB,QAAA,IAAI;AACF,YAAA,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;AAC/D,YAAA,MAAM,IAAI,GAAG,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,GAAG,EAAE;YACzD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACnD;AAAE,QAAA,MAAM;AACN,YAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC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