@flusys/ng-iam 1.0.0-rc → 1.1.1-beta
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 +24 -175
- package/fesm2022/{flusys-ng-iam-action-form-page.component-C_BRrrWW.mjs → flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs} +202 -174
- package/fesm2022/flusys-ng-iam-action-form-page.component-C1j10Qhw.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs +281 -0
- package/fesm2022/flusys-ng-iam-action-list-page.component-BCzSardO.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-flusys-ng-iam-BPIpfrjN.mjs → flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs} +829 -822
- package/fesm2022/flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs +97 -0
- package/fesm2022/flusys-ng-iam-iam-container.component-BkhqmzLi.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-permission-page.component-CmxOBJPu.mjs → flusys-ng-iam-permission-page.component-BSQFPt_N.mjs} +12 -41
- package/fesm2022/flusys-ng-iam-permission-page.component-BSQFPt_N.mjs.map +1 -0
- package/fesm2022/{flusys-ng-iam-role-form-page.component-ByNueI1a.mjs → flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs} +134 -106
- package/fesm2022/flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs +266 -0
- package/fesm2022/flusys-ng-iam-role-list-page.component-BObCxHiB.mjs.map +1 -0
- package/fesm2022/flusys-ng-iam.mjs +1 -1
- package/package.json +2 -2
- package/types/flusys-ng-iam.d.ts +21 -40
- package/fesm2022/flusys-ng-iam-action-form-page.component-C_BRrrWW.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-action-list-page.component-Daf93zpS.mjs +0 -289
- package/fesm2022/flusys-ng-iam-action-list-page.component-Daf93zpS.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-flusys-ng-iam-BPIpfrjN.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-iam-container.component-Bn4kQtxW.mjs +0 -92
- package/fesm2022/flusys-ng-iam-iam-container.component-Bn4kQtxW.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-permission-page.component-CmxOBJPu.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-role-form-page.component-ByNueI1a.mjs.map +0 -1
- package/fesm2022/flusys-ng-iam-role-list-page.component-CFly5KnH.mjs +0 -316
- package/fesm2022/flusys-ng-iam-role-list-page.component-CFly5KnH.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-iam-role-form-page.component-Cqziu_BM.mjs","sources":["../../../projects/ng-iam/pages/role/role-form-page.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, OnInit, signal } from '@angular/core';\nimport { form, FormField, required } from '@angular/forms/signals';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { APP_CONFIG, isCompanyFeatureEnabled } from '@flusys/ng-core';\nimport { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';\nimport { AngularModule, PrimeModule } from '@flusys/ng-shared';\nimport { MessageService } from 'primeng/api';\nimport { firstValueFrom } from 'rxjs';\nimport { IRole } from '../../interfaces/role.interface';\nimport { RoleApiService } from '../../services/role-api.service';\n\n/** Role form model interface */\ninterface IRoleFormModel {\n id: string;\n name: string;\n description: string;\n serial: string;\n isActive: boolean;\n}\n\n/**\n * Role Form Page Component\n * Create/Edit role with signal-based form pattern (matches ng-auth)\n */\n@Component({\n selector: 'lib-role-form-page',\n standalone: true,\n imports: [AngularModule, PrimeModule, FormField],\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\">\n {{ isEditMode() ? 'Edit Role' : 'New Role' }}\n </h3>\n <p-button\n label=\"Back\"\n icon=\"pi pi-arrow-left\"\n [outlined]=\"true\"\n (onClick)=\"onBack()\" />\n </div>\n\n <form (ngSubmit)=\"onSubmit()\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <!-- Name -->\n <div class=\"md:col-span-2\">\n <label for=\"name\" class=\"block font-medium mb-2\">Name *</label>\n <input\n pInputText\n id=\"name\"\n [formField]=\"roleForm.name\"\n class=\"w-full\"\n placeholder=\"Enter role name\" />\n </div>\n\n <!-- Description -->\n <div class=\"md:col-span-2\">\n <label for=\"description\" class=\"block font-medium mb-2\">Description</label>\n <input\n pInputText\n id=\"description\"\n [formField]=\"roleForm.description\"\n class=\"w-full\"\n placeholder=\"Enter description\" />\n </div>\n\n <!-- Order -->\n <div>\n <label for=\"serial\" class=\"block font-medium mb-2\">Display Order</label>\n <input\n pInputText\n id=\"serial\"\n type=\"number\"\n [formField]=\"roleForm.serial\"\n class=\"w-full\"\n placeholder=\"Enter display order\" />\n </div>\n\n <!-- Is Active -->\n <div class=\"flex items-center pt-6\">\n <label class=\"p-checkbox-native\">\n <input\n type=\"checkbox\"\n [formField]=\"roleForm.isActive\" />\n <span>Active</span>\n </label>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex justify-end gap-2 mt-6\">\n <p-button\n label=\"Cancel\"\n severity=\"secondary\"\n [outlined]=\"true\"\n (onClick)=\"onBack()\" />\n <p-button\n [label]=\"isEditMode() ? 'Update' : 'Create'\"\n type=\"submit\"\n [loading]=\"isLoading()\"\n [disabled]=\"!isFormValid() || isLoading()\" />\n </div>\n </form>\n </div>\n `,\n})\nexport class RoleFormPageComponent implements OnInit {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly appConfig = inject(APP_CONFIG);\n private readonly companyContext = inject(LAYOUT_AUTH_STATE);\n private readonly roleApi = inject(RoleApiService);\n private readonly messageService = inject(MessageService);\n\n /** Loading state */\n readonly isLoading = signal(false);\n\n /** Existing role data when editing */\n readonly existingRole = signal<IRole | null>(null);\n\n /** Whether in edit mode */\n readonly isEditMode = computed(() => !!this.existingRole());\n\n // ============================================\n // Form (Signal Forms)\n // ============================================\n\n /** Form model */\n readonly formModel = signal<IRoleFormModel>({\n id: '',\n name: '',\n description: '',\n serial: '',\n isActive: true,\n });\n\n /** Form with validation schema */\n readonly roleForm = form(this.formModel, (f) => {\n required(f.name, { message: 'Name is required' });\n });\n\n /** Check if form is valid */\n readonly isFormValid = computed(() => {\n const model = this.formModel();\n return model.name.trim().length > 0;\n });\n\n ngOnInit(): void {\n const id = this.route.snapshot.paramMap.get('id');\n if (id && id !== 'new') {\n this.loadRole(id);\n }\n }\n\n async loadRole(id: string): Promise<void> {\n this.isLoading.set(true);\n try {\n const response = await firstValueFrom(this.roleApi.findById(id));\n const role = response?.data;\n\n if (role) {\n this.existingRole.set(role);\n this.formModel.set({\n id: role.id,\n name: role.name,\n description: role.description ?? '',\n serial: role.serial?.toString() ?? '',\n isActive: role.isActive,\n });\n } else {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: 'Role not found.',\n });\n this.router.navigate(['/iam/roles']);\n }\n } catch (error) {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: 'Failed to load role.',\n });\n this.router.navigate(['/iam/roles']);\n } finally {\n this.isLoading.set(false);\n }\n }\n\n async onSubmit(): Promise<void> {\n if (!this.isFormValid()) {\n this.messageService.add({\n severity: 'error',\n summary: 'Validation Error',\n detail: 'Please fill in all required fields.',\n });\n return;\n }\n\n this.isLoading.set(true);\n\n try {\n const formValue = this.formModel();\n\n // Get company context if feature enabled\n const companyId = isCompanyFeatureEnabled(this.appConfig)\n ? this.companyContext.currentCompanyInfo()?.id || undefined\n : undefined;\n\n // Convert empty strings to undefined for DTO compatibility\n const dto = {\n ...formValue,\n description: formValue.description || undefined,\n serial: formValue.serial ? parseInt(formValue.serial, 10) : undefined,\n companyId: this.isEditMode() ? undefined : companyId,\n };\n\n if (this.isEditMode()) {\n await this.roleApi.updateAsync(dto);\n this.messageService.add({\n severity: 'success',\n summary: 'Success',\n detail: 'Role updated successfully.',\n });\n } else {\n await this.roleApi.insertAsync(dto);\n this.messageService.add({\n severity: 'success',\n summary: 'Success',\n detail: 'Role created successfully.',\n });\n }\n\n this.router.navigate(['/iam/roles']);\n } catch (error: any) {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: error.message || 'Failed to save role.',\n });\n } finally {\n this.isLoading.set(false);\n }\n }\n\n onBack(): void {\n this.router.navigate(['/iam/roles']);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAoBA;;;AAGG;MAmFU,qBAAqB,CAAA;AACf,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;AAC9B,IAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,IAAA,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC;AAChC,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;;AAG/C,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;;AAGzB,IAAA,YAAY,GAAG,MAAM,CAAe,IAAI,wDAAC;;AAGzC,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,sDAAC;;;;;IAOlD,SAAS,GAAG,MAAM,CAAiB;AAC1C,QAAA,EAAE,EAAE,EAAE;AACN,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;;IAGO,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MAAA,EAAA,SAAA,EAAA,OAAA,EAAA,YAAA,EAAA,YAAA,EAAA,eAAA,EAAA,WAAA,EAAA,WAAA,EAAA,SAAA,EAAA,MAAA,EAAA,OAAA,EAAA,SAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,SAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,aAAA,EAAA,cAAA,EAAA,oBAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,SAAS,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA+EpC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAlFjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC;oBAChD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ET,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,266 @@
|
|
|
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 { APP_CONFIG, isCompanyFeatureEnabled } from '@flusys/ng-core';
|
|
5
|
+
import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
|
|
6
|
+
import { AngularModule, PrimeModule } from '@flusys/ng-shared';
|
|
7
|
+
import * as i2 from 'primeng/api';
|
|
8
|
+
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
9
|
+
import * as i6 from 'primeng/tag';
|
|
10
|
+
import { TagModule } from 'primeng/tag';
|
|
11
|
+
import { firstValueFrom } from 'rxjs';
|
|
12
|
+
import { R as RoleApiService } from './flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs';
|
|
13
|
+
import * as i2$1 from 'primeng/button';
|
|
14
|
+
import * as i5 from 'primeng/table';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Role List Page Component
|
|
18
|
+
*
|
|
19
|
+
* Displays paginated list of roles with search, filter, and CRUD operations.
|
|
20
|
+
* Uses RoleApiService directly with LAYOUT_AUTH_STATE for company context.
|
|
21
|
+
*/
|
|
22
|
+
class RoleListPageComponent {
|
|
23
|
+
router = inject(Router);
|
|
24
|
+
appConfig = inject(APP_CONFIG);
|
|
25
|
+
companyContext = inject(LAYOUT_AUTH_STATE);
|
|
26
|
+
roleApi = inject(RoleApiService);
|
|
27
|
+
messageService = inject(MessageService);
|
|
28
|
+
confirmationService = inject(ConfirmationService);
|
|
29
|
+
roles = signal([], ...(ngDevMode ? [{ debugName: "roles" }] : []));
|
|
30
|
+
isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
31
|
+
total = signal(0, ...(ngDevMode ? [{ debugName: "total" }] : []));
|
|
32
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
33
|
+
first = signal(0, ...(ngDevMode ? [{ debugName: "first" }] : []));
|
|
34
|
+
constructor() {
|
|
35
|
+
effect(() => {
|
|
36
|
+
this.companyContext.currentCompanyInfo();
|
|
37
|
+
untracked(() => this.loadRoles());
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async loadRoles() {
|
|
41
|
+
this.isLoading.set(true);
|
|
42
|
+
try {
|
|
43
|
+
const enableCompanyFeature = isCompanyFeatureEnabled(this.appConfig);
|
|
44
|
+
const companyId = enableCompanyFeature
|
|
45
|
+
? this.companyContext.currentCompanyInfo()?.id || undefined
|
|
46
|
+
: undefined;
|
|
47
|
+
const selectFields = ['id', 'name', 'description', 'isActive', 'readOnly', 'serial', 'createdAt', 'deletedAt'];
|
|
48
|
+
if (enableCompanyFeature) {
|
|
49
|
+
selectFields.push('companyId');
|
|
50
|
+
}
|
|
51
|
+
const response = await firstValueFrom(this.roleApi.getAll('', {
|
|
52
|
+
filter: companyId ? { companyId } : undefined,
|
|
53
|
+
pagination: {
|
|
54
|
+
currentPage: Math.floor(this.first() / this.pageSize()),
|
|
55
|
+
pageSize: this.pageSize(),
|
|
56
|
+
},
|
|
57
|
+
select: selectFields,
|
|
58
|
+
sort: { id: 'ASC' },
|
|
59
|
+
}));
|
|
60
|
+
this.roles.set(response?.data ?? []);
|
|
61
|
+
this.total.set(response?.meta?.total ?? 0);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
this.messageService.add({
|
|
65
|
+
severity: 'error',
|
|
66
|
+
summary: 'Error',
|
|
67
|
+
detail: 'Failed to load roles',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
this.isLoading.set(false);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
onCreate() {
|
|
75
|
+
this.router.navigate(['/iam/roles/new']);
|
|
76
|
+
}
|
|
77
|
+
onEdit(role) {
|
|
78
|
+
this.router.navigate(['/iam/roles', role.id]);
|
|
79
|
+
}
|
|
80
|
+
onDelete(role) {
|
|
81
|
+
this.confirmationService.confirm({
|
|
82
|
+
message: `Are you sure you want to delete role "${role.name}"?`,
|
|
83
|
+
header: 'Confirm Delete',
|
|
84
|
+
icon: 'pi pi-exclamation-triangle',
|
|
85
|
+
accept: async () => {
|
|
86
|
+
try {
|
|
87
|
+
await this.roleApi.deleteAsync({ id: role.id, type: 'delete' });
|
|
88
|
+
this.roles.update((list) => list.filter((r) => r.id !== role.id));
|
|
89
|
+
this.total.update((t) => Math.max(0, t - 1));
|
|
90
|
+
this.messageService.add({
|
|
91
|
+
severity: 'success',
|
|
92
|
+
summary: 'Success',
|
|
93
|
+
detail: 'Role deleted successfully',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
this.messageService.add({
|
|
98
|
+
severity: 'error',
|
|
99
|
+
summary: 'Error',
|
|
100
|
+
detail: error.message || 'Failed to delete role',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
onLazyLoad(event) {
|
|
107
|
+
this.first.set(event.first ?? 0);
|
|
108
|
+
this.pageSize.set(event.rows ?? 10);
|
|
109
|
+
this.loadRoles();
|
|
110
|
+
}
|
|
111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RoleListPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: RoleListPageComponent, isStandalone: true, selector: "lib-role-list-page", ngImport: i0, template: `
|
|
113
|
+
<div class="card">
|
|
114
|
+
<div class="flex justify-between items-center mb-4">
|
|
115
|
+
<h3 class="text-xl font-semibold">Roles</h3>
|
|
116
|
+
<p-button
|
|
117
|
+
label="New Role"
|
|
118
|
+
icon="pi pi-plus"
|
|
119
|
+
(onClick)="onCreate()" />
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<p-table
|
|
123
|
+
[value]="roles()"
|
|
124
|
+
[loading]="isLoading()"
|
|
125
|
+
[paginator]="true"
|
|
126
|
+
[rows]="pageSize()"
|
|
127
|
+
[first]="first()"
|
|
128
|
+
[totalRecords]="total()"
|
|
129
|
+
[lazy]="true"
|
|
130
|
+
(onLazyLoad)="onLazyLoad($event)"
|
|
131
|
+
[rowsPerPageOptions]="[10, 25, 50]"
|
|
132
|
+
styleClass="p-datatable-sm">
|
|
133
|
+
<ng-template pTemplate="header">
|
|
134
|
+
<tr>
|
|
135
|
+
<th>Name</th>
|
|
136
|
+
<th>Description</th>
|
|
137
|
+
<th>Active</th>
|
|
138
|
+
<th>Read Only</th>
|
|
139
|
+
<th style="width: 150px">Actions</th>
|
|
140
|
+
</tr>
|
|
141
|
+
</ng-template>
|
|
142
|
+
<ng-template pTemplate="body" let-role>
|
|
143
|
+
<tr>
|
|
144
|
+
<td>{{ role.name }}</td>
|
|
145
|
+
<td>{{ role.description ?? '-' }}</td>
|
|
146
|
+
<td>
|
|
147
|
+
<p-tag
|
|
148
|
+
[value]="role.isActive ? 'Active' : 'Inactive'"
|
|
149
|
+
[severity]="role.isActive ? 'success' : 'secondary'" />
|
|
150
|
+
</td>
|
|
151
|
+
<td>
|
|
152
|
+
<p-tag
|
|
153
|
+
[value]="role.readOnly ? 'Yes' : 'No'"
|
|
154
|
+
[severity]="role.readOnly ? 'warn' : 'secondary'" />
|
|
155
|
+
</td>
|
|
156
|
+
<td>
|
|
157
|
+
<div class="flex gap-2">
|
|
158
|
+
<p-button
|
|
159
|
+
icon="pi pi-pencil"
|
|
160
|
+
[outlined]="true"
|
|
161
|
+
severity="info"
|
|
162
|
+
size="small"
|
|
163
|
+
(onClick)="onEdit(role)" />
|
|
164
|
+
<p-button
|
|
165
|
+
icon="pi pi-trash"
|
|
166
|
+
[outlined]="true"
|
|
167
|
+
severity="danger"
|
|
168
|
+
size="small"
|
|
169
|
+
[disabled]="role.readOnly"
|
|
170
|
+
(onClick)="onDelete(role)" />
|
|
171
|
+
</div>
|
|
172
|
+
</td>
|
|
173
|
+
</tr>
|
|
174
|
+
</ng-template>
|
|
175
|
+
<ng-template pTemplate="emptymessage">
|
|
176
|
+
<tr>
|
|
177
|
+
<td colspan="5" class="text-center">No roles found.</td>
|
|
178
|
+
</tr>
|
|
179
|
+
</ng-template>
|
|
180
|
+
</p-table>
|
|
181
|
+
</div>
|
|
182
|
+
`, 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: i5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "component", type: i6.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: TagModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
183
|
+
}
|
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: RoleListPageComponent, decorators: [{
|
|
185
|
+
type: Component,
|
|
186
|
+
args: [{
|
|
187
|
+
selector: 'lib-role-list-page',
|
|
188
|
+
standalone: true,
|
|
189
|
+
imports: [AngularModule, PrimeModule, TagModule],
|
|
190
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
191
|
+
template: `
|
|
192
|
+
<div class="card">
|
|
193
|
+
<div class="flex justify-between items-center mb-4">
|
|
194
|
+
<h3 class="text-xl font-semibold">Roles</h3>
|
|
195
|
+
<p-button
|
|
196
|
+
label="New Role"
|
|
197
|
+
icon="pi pi-plus"
|
|
198
|
+
(onClick)="onCreate()" />
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<p-table
|
|
202
|
+
[value]="roles()"
|
|
203
|
+
[loading]="isLoading()"
|
|
204
|
+
[paginator]="true"
|
|
205
|
+
[rows]="pageSize()"
|
|
206
|
+
[first]="first()"
|
|
207
|
+
[totalRecords]="total()"
|
|
208
|
+
[lazy]="true"
|
|
209
|
+
(onLazyLoad)="onLazyLoad($event)"
|
|
210
|
+
[rowsPerPageOptions]="[10, 25, 50]"
|
|
211
|
+
styleClass="p-datatable-sm">
|
|
212
|
+
<ng-template pTemplate="header">
|
|
213
|
+
<tr>
|
|
214
|
+
<th>Name</th>
|
|
215
|
+
<th>Description</th>
|
|
216
|
+
<th>Active</th>
|
|
217
|
+
<th>Read Only</th>
|
|
218
|
+
<th style="width: 150px">Actions</th>
|
|
219
|
+
</tr>
|
|
220
|
+
</ng-template>
|
|
221
|
+
<ng-template pTemplate="body" let-role>
|
|
222
|
+
<tr>
|
|
223
|
+
<td>{{ role.name }}</td>
|
|
224
|
+
<td>{{ role.description ?? '-' }}</td>
|
|
225
|
+
<td>
|
|
226
|
+
<p-tag
|
|
227
|
+
[value]="role.isActive ? 'Active' : 'Inactive'"
|
|
228
|
+
[severity]="role.isActive ? 'success' : 'secondary'" />
|
|
229
|
+
</td>
|
|
230
|
+
<td>
|
|
231
|
+
<p-tag
|
|
232
|
+
[value]="role.readOnly ? 'Yes' : 'No'"
|
|
233
|
+
[severity]="role.readOnly ? 'warn' : 'secondary'" />
|
|
234
|
+
</td>
|
|
235
|
+
<td>
|
|
236
|
+
<div class="flex gap-2">
|
|
237
|
+
<p-button
|
|
238
|
+
icon="pi pi-pencil"
|
|
239
|
+
[outlined]="true"
|
|
240
|
+
severity="info"
|
|
241
|
+
size="small"
|
|
242
|
+
(onClick)="onEdit(role)" />
|
|
243
|
+
<p-button
|
|
244
|
+
icon="pi pi-trash"
|
|
245
|
+
[outlined]="true"
|
|
246
|
+
severity="danger"
|
|
247
|
+
size="small"
|
|
248
|
+
[disabled]="role.readOnly"
|
|
249
|
+
(onClick)="onDelete(role)" />
|
|
250
|
+
</div>
|
|
251
|
+
</td>
|
|
252
|
+
</tr>
|
|
253
|
+
</ng-template>
|
|
254
|
+
<ng-template pTemplate="emptymessage">
|
|
255
|
+
<tr>
|
|
256
|
+
<td colspan="5" class="text-center">No roles found.</td>
|
|
257
|
+
</tr>
|
|
258
|
+
</ng-template>
|
|
259
|
+
</p-table>
|
|
260
|
+
</div>
|
|
261
|
+
`,
|
|
262
|
+
}]
|
|
263
|
+
}], ctorParameters: () => [] });
|
|
264
|
+
|
|
265
|
+
export { RoleListPageComponent };
|
|
266
|
+
//# sourceMappingURL=flusys-ng-iam-role-list-page.component-BObCxHiB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-iam-role-list-page.component-BObCxHiB.mjs","sources":["../../../projects/ng-iam/pages/role/role-list-page.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, inject, signal, untracked } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { APP_CONFIG, isCompanyFeatureEnabled } from '@flusys/ng-core';\nimport { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';\nimport { AngularModule, PrimeModule } from '@flusys/ng-shared';\nimport { ConfirmationService, MessageService } from 'primeng/api';\nimport { TagModule } from 'primeng/tag';\nimport { firstValueFrom } from 'rxjs';\nimport { IRole } from '../../interfaces/role.interface';\nimport { RoleApiService } from '../../services/role-api.service';\n\n/**\n * Role List Page Component\n *\n * Displays paginated list of roles with search, filter, and CRUD operations.\n * Uses RoleApiService directly with LAYOUT_AUTH_STATE for company context.\n */\n@Component({\n selector: 'lib-role-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\">Roles</h3>\n <p-button\n label=\"New Role\"\n icon=\"pi pi-plus\"\n (onClick)=\"onCreate()\" />\n </div>\n\n <p-table\n [value]=\"roles()\"\n [loading]=\"isLoading()\"\n [paginator]=\"true\"\n [rows]=\"pageSize()\"\n [first]=\"first()\"\n [totalRecords]=\"total()\"\n [lazy]=\"true\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [rowsPerPageOptions]=\"[10, 25, 50]\"\n styleClass=\"p-datatable-sm\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th>Name</th>\n <th>Description</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-role>\n <tr>\n <td>{{ role.name }}</td>\n <td>{{ role.description ?? '-' }}</td>\n <td>\n <p-tag\n [value]=\"role.isActive ? 'Active' : 'Inactive'\"\n [severity]=\"role.isActive ? 'success' : 'secondary'\" />\n </td>\n <td>\n <p-tag\n [value]=\"role.readOnly ? 'Yes' : 'No'\"\n [severity]=\"role.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(role)\" />\n <p-button\n icon=\"pi pi-trash\"\n [outlined]=\"true\"\n severity=\"danger\"\n size=\"small\"\n [disabled]=\"role.readOnly\"\n (onClick)=\"onDelete(role)\" />\n </div>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td colspan=\"5\" class=\"text-center\">No roles found.</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n `,\n})\nexport class RoleListPageComponent {\n private readonly router = inject(Router);\n private readonly appConfig = inject(APP_CONFIG);\n private readonly companyContext = inject(LAYOUT_AUTH_STATE);\n private readonly roleApi = inject(RoleApiService);\n private readonly messageService = inject(MessageService);\n private readonly confirmationService = inject(ConfirmationService);\n\n readonly roles = signal<IRole[]>([]);\n readonly isLoading = signal(false);\n readonly total = signal(0);\n readonly pageSize = signal(10);\n readonly first = signal(0);\n\n constructor() {\n effect(() => {\n this.companyContext.currentCompanyInfo();\n untracked(() => this.loadRoles());\n });\n }\n\n private async loadRoles(): Promise<void> {\n this.isLoading.set(true);\n try {\n const enableCompanyFeature = isCompanyFeatureEnabled(this.appConfig);\n const companyId = enableCompanyFeature\n ? this.companyContext.currentCompanyInfo()?.id || undefined\n : undefined;\n\n const selectFields = ['id', 'name', 'description', 'isActive', 'readOnly', 'serial', 'createdAt', 'deletedAt'];\n if (enableCompanyFeature) {\n selectFields.push('companyId');\n }\n\n const response = await firstValueFrom(\n this.roleApi.getAll('', {\n filter: companyId ? { companyId } : undefined,\n pagination: {\n currentPage: Math.floor(this.first() / this.pageSize()),\n pageSize: this.pageSize(),\n },\n select: selectFields,\n sort: { id: 'ASC' },\n })\n );\n\n this.roles.set(response?.data ?? []);\n this.total.set(response?.meta?.total ?? 0);\n } catch {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: 'Failed to load roles',\n });\n } finally {\n this.isLoading.set(false);\n }\n }\n\n onCreate(): void {\n this.router.navigate(['/iam/roles/new']);\n }\n\n onEdit(role: IRole): void {\n this.router.navigate(['/iam/roles', role.id]);\n }\n\n onDelete(role: IRole): void {\n this.confirmationService.confirm({\n message: `Are you sure you want to delete role \"${role.name}\"?`,\n header: 'Confirm Delete',\n icon: 'pi pi-exclamation-triangle',\n accept: async () => {\n try {\n await this.roleApi.deleteAsync({ id: role.id, type: 'delete' });\n\n this.roles.update((list) => list.filter((r) => r.id !== role.id));\n this.total.update((t) => Math.max(0, t - 1));\n\n this.messageService.add({\n severity: 'success',\n summary: 'Success',\n detail: 'Role deleted successfully',\n });\n } catch (error: any) {\n this.messageService.add({\n severity: 'error',\n summary: 'Error',\n detail: error.message || 'Failed to delete role',\n });\n }\n },\n });\n }\n\n onLazyLoad(event: { first?: number | null; rows?: number | null }): void {\n this.first.set(event.first ?? 0);\n this.pageSize.set(event.rows ?? 10);\n this.loadRoles();\n }\n}\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;AAWA;;;;;AAKG;MA8EU,qBAAqB,CAAA;AACf,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;AAC9B,IAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,IAAA,OAAO,GAAG,MAAM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AA,YAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,wBAAA,EAAA,cAAA,EAAA,aAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,GAAA,EAAA,QAAA,EAAA,OAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,UAAA,EAAA,OAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,SAAS,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA0EpC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA7EjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC;oBAChD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsET,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ActionApiService, e as ActionPermissionLogicService, a as ActionType, C as CompanyActionSelectorComponent, I as IAM_ROUTES, L as LogicBuilderComponent, M as MAX_DROPDOWN_ITEMS, f as MyPermissionsApiService, P as PermissionApiService, g as PermissionStateService, h as ProfilePermissionProviderAdapter, b as RoleActionSelectorComponent, R as RoleApiService, d as UserActionSelectorComponent, U as UserRoleSelectorComponent, p as provideIamProviders } from './flusys-ng-iam-flusys-ng-iam-
|
|
1
|
+
export { A as ActionApiService, e as ActionPermissionLogicService, a as ActionType, C as CompanyActionSelectorComponent, I as IAM_ROUTES, L as LogicBuilderComponent, M as MAX_DROPDOWN_ITEMS, f as MyPermissionsApiService, P as PermissionApiService, g as PermissionStateService, h as ProfilePermissionProviderAdapter, b as RoleActionSelectorComponent, R as RoleApiService, d as UserActionSelectorComponent, U as UserRoleSelectorComponent, p as provideIamProviders } from './flusys-ng-iam-flusys-ng-iam-DISrddPh.mjs';
|
|
2
2
|
//# sourceMappingURL=flusys-ng-iam.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/ng-iam",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1-beta",
|
|
4
4
|
"description": "Identity and Access Management (IAM) for Angular - Independent from ng-auth through Provider Interface Pattern",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"tslib": "^2.3.0"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
package/types/flusys-ng-iam.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IBaseEntity, ILogicNode, ApiResourceService, ISingleResponse, IProfilePermissionProvider, IProfileRoleInfo, IProfileActionInfo } from '@flusys/ng-shared';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
|
-
import { Signal, Provider } from '@angular/core';
|
|
3
|
+
import { Signal, OnDestroy, Provider } from '@angular/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { BaseApiService } from '@flusys/ng-core';
|
|
6
|
-
export { PermissionMode } from '@flusys/ng-core';
|
|
7
6
|
import * as primeng_api from 'primeng/api';
|
|
8
7
|
import { Routes } from '@angular/router';
|
|
9
8
|
|
|
@@ -47,7 +46,7 @@ interface IRole extends IBaseEntity {
|
|
|
47
46
|
companyId: string | null;
|
|
48
47
|
isActive: boolean;
|
|
49
48
|
serial: number | null;
|
|
50
|
-
metadata: Record<string,
|
|
49
|
+
metadata: Record<string, any> | null;
|
|
51
50
|
}
|
|
52
51
|
/**
|
|
53
52
|
* Create Role DTO
|
|
@@ -59,7 +58,7 @@ interface ICreateRoleDto {
|
|
|
59
58
|
companyId?: string;
|
|
60
59
|
isActive?: boolean;
|
|
61
60
|
serial?: number;
|
|
62
|
-
metadata?: Record<string,
|
|
61
|
+
metadata?: Record<string, any>;
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* Update Role DTO
|
|
@@ -100,7 +99,7 @@ interface IAction extends IBaseEntity {
|
|
|
100
99
|
parentId: string | null;
|
|
101
100
|
serial: number | null;
|
|
102
101
|
isActive: boolean;
|
|
103
|
-
metadata: Record<string,
|
|
102
|
+
metadata: Record<string, any> | null;
|
|
104
103
|
}
|
|
105
104
|
/**
|
|
106
105
|
* Action Tree DTO
|
|
@@ -122,7 +121,7 @@ interface ICreateActionDto {
|
|
|
122
121
|
parentId?: string;
|
|
123
122
|
serial?: number;
|
|
124
123
|
isActive?: boolean;
|
|
125
|
-
metadata?: Record<string,
|
|
124
|
+
metadata?: Record<string, any>;
|
|
126
125
|
}
|
|
127
126
|
/**
|
|
128
127
|
* Update Action DTO
|
|
@@ -136,6 +135,10 @@ interface IUpdateActionDto extends Partial<ICreateActionDto> {
|
|
|
136
135
|
* Permission Action - 'add' or 'remove'
|
|
137
136
|
*/
|
|
138
137
|
type PermissionAction = 'add' | 'remove';
|
|
138
|
+
/**
|
|
139
|
+
* Permission Mode - matches backend IAMPermissionMode
|
|
140
|
+
*/
|
|
141
|
+
type PermissionMode = 'rbac' | 'direct' | 'full';
|
|
139
142
|
/**
|
|
140
143
|
* Permission Item DTO
|
|
141
144
|
* Used in all assignment operations
|
|
@@ -361,7 +364,7 @@ declare class ActionApiService extends ApiResourceService<IUpdateActionDto, IAct
|
|
|
361
364
|
constructor();
|
|
362
365
|
/**
|
|
363
366
|
* Get actions for permission assignment
|
|
364
|
-
*
|
|
367
|
+
* GET /iam/actions/tree-for-permission
|
|
365
368
|
* Returns actions filtered by company whitelist if enabled
|
|
366
369
|
*/
|
|
367
370
|
getActionsForPermission(): Observable<ISingleResponse<IActionTreeDto[]>>;
|
|
@@ -548,7 +551,7 @@ declare class PermissionApiService extends BaseApiService {
|
|
|
548
551
|
assignUserActions(data: IAssignUserActionsDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
|
|
549
552
|
/**
|
|
550
553
|
* Get user's direct action permissions
|
|
551
|
-
*
|
|
554
|
+
* GET /permissions/user-actions/:userId
|
|
552
555
|
*/
|
|
553
556
|
getUserActions(userId: string, query?: IGetUserActionsDto): Observable<ISingleResponse<IUserActionResponseDto[]>>;
|
|
554
557
|
/**
|
|
@@ -558,7 +561,7 @@ declare class PermissionApiService extends BaseApiService {
|
|
|
558
561
|
assignUserRoles(data: IAssignUserRolesDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
|
|
559
562
|
/**
|
|
560
563
|
* Get user's role assignments
|
|
561
|
-
*
|
|
564
|
+
* GET /permissions/user-roles/:userId
|
|
562
565
|
*/
|
|
563
566
|
getUserRoles(userId: string, query?: IGetUserRolesDto): Observable<ISingleResponse<IUserRoleResponseDto[]>>;
|
|
564
567
|
/**
|
|
@@ -568,7 +571,7 @@ declare class PermissionApiService extends BaseApiService {
|
|
|
568
571
|
assignRoleActions(data: IAssignRoleActionsDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
|
|
569
572
|
/**
|
|
570
573
|
* Get role's action permissions
|
|
571
|
-
*
|
|
574
|
+
* GET /permissions/role-actions/:roleId
|
|
572
575
|
*/
|
|
573
576
|
getRoleActions(roleId: string, query?: IGetRoleActionsDto): Observable<ISingleResponse<IRoleActionResponseDto[]>>;
|
|
574
577
|
/**
|
|
@@ -578,7 +581,7 @@ declare class PermissionApiService extends BaseApiService {
|
|
|
578
581
|
assignCompanyActions(data: IAssignCompanyActionsDto): Observable<ISingleResponse<IPermissionOperationResultDto>>;
|
|
579
582
|
/**
|
|
580
583
|
* Get company's whitelisted actions
|
|
581
|
-
*
|
|
584
|
+
* GET /permissions/company-actions/:companyId
|
|
582
585
|
*/
|
|
583
586
|
getCompanyActions(companyId: string): Observable<ISingleResponse<ICompanyActionResponseDto[]>>;
|
|
584
587
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PermissionApiService, never>;
|
|
@@ -671,10 +674,8 @@ declare class LogicBuilderComponent {
|
|
|
671
674
|
id: string;
|
|
672
675
|
name: string;
|
|
673
676
|
}[]>;
|
|
674
|
-
|
|
675
|
-
private readonly _builderTree;
|
|
677
|
+
private builderTree;
|
|
676
678
|
readonly builderLogic: _angular_core.Signal<IBuilderNode | null>;
|
|
677
|
-
constructor();
|
|
678
679
|
initializeLogic(): void;
|
|
679
680
|
clearLogic(): void;
|
|
680
681
|
toggleOperator(nodeId: string): void;
|
|
@@ -722,12 +723,7 @@ declare class LogicBuilderComponent {
|
|
|
722
723
|
* <flusys-role-action-selector />
|
|
723
724
|
* ```
|
|
724
725
|
*/
|
|
725
|
-
declare class RoleActionSelectorComponent {
|
|
726
|
-
readonly ROLE_ACTION_PERMISSIONS: {
|
|
727
|
-
readonly READ: "role-action.read";
|
|
728
|
-
readonly ASSIGN: "role-action.assign";
|
|
729
|
-
};
|
|
730
|
-
private readonly destroyRef;
|
|
726
|
+
declare class RoleActionSelectorComponent implements OnDestroy {
|
|
731
727
|
private readonly roleApi;
|
|
732
728
|
private readonly actionApi;
|
|
733
729
|
private readonly permissionApi;
|
|
@@ -755,6 +751,7 @@ declare class RoleActionSelectorComponent {
|
|
|
755
751
|
readonly canSave: _angular_core.Signal<boolean>;
|
|
756
752
|
private loadDataAbortController;
|
|
757
753
|
constructor();
|
|
754
|
+
ngOnDestroy(): void;
|
|
758
755
|
/**
|
|
759
756
|
* Load roles from API
|
|
760
757
|
*/
|
|
@@ -833,18 +830,13 @@ declare class RoleActionSelectorComponent {
|
|
|
833
830
|
* <flusys-company-action-selector />
|
|
834
831
|
* ```
|
|
835
832
|
*/
|
|
836
|
-
declare class CompanyActionSelectorComponent {
|
|
837
|
-
readonly COMPANY_ACTION_PERMISSIONS: {
|
|
838
|
-
readonly READ: "company-action.read";
|
|
839
|
-
readonly ASSIGN: "company-action.assign";
|
|
840
|
-
};
|
|
833
|
+
declare class CompanyActionSelectorComponent implements OnDestroy {
|
|
841
834
|
private readonly companyApiProvider;
|
|
842
835
|
private readonly actionApi;
|
|
843
836
|
private readonly permissionApi;
|
|
844
837
|
private readonly messageService;
|
|
845
838
|
private readonly confirmationService;
|
|
846
839
|
private readonly permissionLogic;
|
|
847
|
-
private readonly destroyRef;
|
|
848
840
|
readonly selectedCompanyId: _angular_core.WritableSignal<string | undefined>;
|
|
849
841
|
readonly companies: _angular_core.WritableSignal<ICompany[]>;
|
|
850
842
|
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
@@ -867,6 +859,7 @@ declare class CompanyActionSelectorComponent {
|
|
|
867
859
|
readonly canSave: _angular_core.Signal<boolean>;
|
|
868
860
|
private loadDataAbortController;
|
|
869
861
|
constructor();
|
|
862
|
+
ngOnDestroy(): void;
|
|
870
863
|
/**
|
|
871
864
|
* Load companies from API
|
|
872
865
|
*/
|
|
@@ -947,18 +940,12 @@ declare class CompanyActionSelectorComponent {
|
|
|
947
940
|
* ```
|
|
948
941
|
*/
|
|
949
942
|
declare class UserRoleSelectorComponent {
|
|
950
|
-
readonly USER_ROLE_PERMISSIONS: {
|
|
951
|
-
readonly READ: "user-role.read";
|
|
952
|
-
readonly ASSIGN: "user-role.assign";
|
|
953
|
-
};
|
|
954
943
|
private readonly appConfig;
|
|
955
944
|
private readonly companyContext;
|
|
956
945
|
private readonly userPermissionProvider;
|
|
957
946
|
private readonly roleApi;
|
|
958
947
|
private readonly permissionApi;
|
|
959
948
|
private readonly messageService;
|
|
960
|
-
private readonly destroyRef;
|
|
961
|
-
private loadDataAbortController;
|
|
962
949
|
readonly selectedUserId: _angular_core.WritableSignal<string | null>;
|
|
963
950
|
readonly selectedBranchId: _angular_core.WritableSignal<string | undefined>;
|
|
964
951
|
readonly branches: _angular_core.WritableSignal<IBranch[]>;
|
|
@@ -1050,10 +1037,6 @@ declare class UserRoleSelectorComponent {
|
|
|
1050
1037
|
* ```
|
|
1051
1038
|
*/
|
|
1052
1039
|
declare class UserActionSelectorComponent {
|
|
1053
|
-
readonly USER_ACTION_PERMISSIONS: {
|
|
1054
|
-
readonly READ: "user-action.read";
|
|
1055
|
-
readonly ASSIGN: "user-action.assign";
|
|
1056
|
-
};
|
|
1057
1040
|
private readonly appConfig;
|
|
1058
1041
|
private readonly companyContext;
|
|
1059
1042
|
private readonly userPermissionProvider;
|
|
@@ -1061,8 +1044,6 @@ declare class UserActionSelectorComponent {
|
|
|
1061
1044
|
private readonly permissionApi;
|
|
1062
1045
|
private readonly permissionLogic;
|
|
1063
1046
|
private readonly messageService;
|
|
1064
|
-
private readonly destroyRef;
|
|
1065
|
-
private loadDataAbortController;
|
|
1066
1047
|
readonly selectedUserId: _angular_core.WritableSignal<string | null>;
|
|
1067
1048
|
readonly selectedBranchId: _angular_core.WritableSignal<string | undefined>;
|
|
1068
1049
|
readonly branches: _angular_core.WritableSignal<IBranch[]>;
|
|
@@ -1104,7 +1085,7 @@ declare class UserActionSelectorComponent {
|
|
|
1104
1085
|
*/
|
|
1105
1086
|
hasUnmetPrerequisites(action: IAction): boolean;
|
|
1106
1087
|
/**
|
|
1107
|
-
* Handle action toggle
|
|
1088
|
+
* Handle action checkbox toggle
|
|
1108
1089
|
*/
|
|
1109
1090
|
onActionToggle(action: IAction, newValue: boolean): void;
|
|
1110
1091
|
/**
|
|
@@ -1189,4 +1170,4 @@ declare function provideIamProviders(): Provider[];
|
|
|
1189
1170
|
declare const IAM_ROUTES: Routes;
|
|
1190
1171
|
|
|
1191
1172
|
export { ActionApiService, ActionPermissionLogicService, ActionType, CompanyActionSelectorComponent, IAM_ROUTES, LogicBuilderComponent, MAX_DROPDOWN_ITEMS, MyPermissionsApiService, PermissionApiService, PermissionStateService, ProfilePermissionProviderAdapter, RoleActionSelectorComponent, RoleApiService, UserActionSelectorComponent, UserRoleSelectorComponent, provideIamProviders };
|
|
1192
|
-
export type { IAction, IActionTreeDto, IAssignCompanyActionsDto, IAssignRoleActionsDto, IAssignUserActionsDto, IAssignUserRolesDto, IBranch, ICompany, ICompanyActionResponseDto, ICreateActionDto, ICreateRoleDto, IGetMyPermissionsDto, IGetRoleActionsDto, IGetUserActionsDto, IGetUserRolesDto, IMenuAction, IMyPermissionsResponseDto, IPermissionItemDto, IPermissionOperationResultDto, IPrerequisiteActionDto, IPrerequisiteValidationError, IRole, IRoleActionResponseDto, IRoleQueryDto, IUpdateActionDto, IUpdateRoleDto, IUser, IUserActionResponseDto, IUserRoleResponseDto, PermissionAction };
|
|
1173
|
+
export type { IAction, IActionTreeDto, IAssignCompanyActionsDto, IAssignRoleActionsDto, IAssignUserActionsDto, IAssignUserRolesDto, IBranch, ICompany, ICompanyActionResponseDto, ICreateActionDto, ICreateRoleDto, IGetMyPermissionsDto, IGetRoleActionsDto, IGetUserActionsDto, IGetUserRolesDto, IMenuAction, IMyPermissionsResponseDto, IPermissionItemDto, IPermissionOperationResultDto, IPrerequisiteActionDto, IPrerequisiteValidationError, IRole, IRoleActionResponseDto, IRoleQueryDto, IUpdateActionDto, IUpdateRoleDto, IUser, IUserActionResponseDto, IUserRoleResponseDto, PermissionAction, PermissionMode };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flusys-ng-iam-action-form-page.component-C_BRrrWW.mjs","sources":["../../../projects/ng-iam/pages/action/action-form-page.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { form, FormField, required } from '@angular/forms/signals';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { AngularModule, ILogicNode, PrimeModule } from '@flusys/ng-shared';\nimport { MessageService } from 'primeng/api';\nimport { firstValueFrom } from 'rxjs';\nimport { ActionApiService } from '../../services/action-api.service';\nimport { IAction, ActionType } from '../../interfaces/action.interface';\nimport { LogicBuilderComponent } from '../../components/logic-builder.component';\n\n/** Action form model interface */\ninterface IActionFormModel {\n id: string;\n name: string;\n description: string;\n code: string;\n actionType: ActionType;\n permissionLogic: ILogicNode | null;\n parentId: string;\n serial: string;\n isActive: boolean;\n metadata: Record<string, unknown> | null;\n}\n\n/**\n * Action Form Page Component\n * Create/Edit action with signal-based form pattern (matches ng-auth)\n */\n@Component({\n selector: 'lib-action-form-page',\n standalone: true,\n imports: [AngularModule, PrimeModule, FormField, LogicBuilderComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"card\">\n <h3 class=\"text-lg sm:text-xl font-semibold mb-4\">\n {{ isEditMode() ? 'Edit Action' : 'New Action' }}\n </h3>\n\n <form (ngSubmit)=\"onSubmit()\" class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <!-- Name -->\n <div class=\"flex flex-col gap-2\">\n <label for=\"name\" class=\"font-medium\">Name *</label>\n <input\n pInputText\n id=\"name\"\n [formField]=\"actionForm.name\"\n placeholder=\"Enter action name\" />\n </div>\n\n <!-- Code -->\n <div class=\"flex flex-col gap-2\">\n <label for=\"code\" class=\"font-medium\">Code</label>\n <input\n pInputText\n id=\"code\"\n [formField]=\"actionForm.code\"\n placeholder=\"Enter action code\" />\n </div>\n\n <!-- Description -->\n <div class=\"flex flex-col gap-2\">\n <label for=\"description\" class=\"font-medium\">Description</label>\n <input\n pInputText\n id=\"description\"\n [formField]=\"actionForm.description\"\n placeholder=\"Enter description\" />\n </div>\n\n <!-- Action Type -->\n <div class=\"flex flex-col gap-2\">\n <label for=\"actionType\" class=\"font-medium\">Action Type *</label>\n <select\n id=\"actionType\"\n class=\"p-inputtext w-full\"\n [formField]=\"actionForm.actionType\">\n @for (type of actionTypes; track type.value) {\n <option [value]=\"type.value\">{{ type.label }}</option>\n }\n </select>\n </div>\n\n <!-- Parent Action -->\n <div class=\"flex flex-col gap-2\">\n <label for=\"parentId\" class=\"font-medium\">Parent Action</label>\n <select\n id=\"parentId\"\n class=\"p-inputtext w-full\"\n [formField]=\"actionForm.parentId\">\n <option value=\"\">Select parent action</option>\n @for (action of availableActions(); track action.id) {\n <option [value]=\"action.id\">{{ action.name }}</option>\n }\n </select>\n </div>\n\n <!-- Order -->\n <div class=\"flex flex-col gap-2\">\n <label for=\"serial\" class=\"font-medium\">Display Order</label>\n <input\n pInputText\n id=\"serial\"\n type=\"number\"\n [formField]=\"actionForm.serial\"\n placeholder=\"Enter display order\" />\n </div>\n\n <!-- Is Active -->\n <div class=\"flex items-end gap-2 pb-1 md:col-span-2\">\n <p-checkbox\n [formField]=\"actionForm.isActive\"\n [binary]=\"true\"\n inputId=\"isActive\" />\n <label for=\"isActive\">Active</label>\n </div>\n\n <!-- Permission Logic Builder -->\n <div class=\"md:col-span-2\">\n <lib-logic-builder\n [logic]=\"formModel().permissionLogic\"\n [actions]=\"allActionsForLogic()\"\n (logicChange)=\"onLogicChange($event)\" />\n </div>\n\n <!-- Actions -->\n <div class=\"flex justify-end gap-2 md:col-span-2 pt-4\">\n <p-button\n label=\"Cancel\"\n severity=\"secondary\"\n [outlined]=\"true\"\n (onClick)=\"onBack()\" />\n <p-button\n [label]=\"isEditMode() ? 'Update' : 'Create'\"\n type=\"submit\"\n [loading]=\"isLoading()\"\n [disabled]=\"!isFormValid() || isLoading()\" />\n </div>\n </form>\n </div>\n `,\n})\nexport class ActionFormPageComponent {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly actionApi = inject(ActionApiService);\n private readonly messageService = inject(MessageService);\n\n private readonly routeParams = toSignal(this.route.paramMap);\n private initialized = false;\n\n /** Loading state */\n readonly isLoading = signal(false);\n\n /** Existing action data when editing */\n readonly existingAction = signal<IAction | null>(null);\n\n /** Whether in edit mode */\n readonly isEditMode = computed(() => !!this.existingAction());\n\n /** All actions for LogicBuilder */\n readonly allActionsForLogic = signal<Array<{ id: string; name: string }>>([]);\n\n /** All loaded actions for parent dropdown */\n readonly allActions = signal<IAction[]>([]);\n\n /** Available actions for parent dropdown (excludes current action to prevent circular reference) */\n readonly availableActions = computed(() => {\n const actions = this.allActions();\n const currentId = this.existingAction()?.id;\n return currentId ? actions.filter(a => a.id !== currentId) : actions;\n });\n\n // ============================================\n // Form (Signal Forms)\n // ============================================\n\n /** Form model */\n readonly formModel = signal<IActionFormModel>({\n id: '',\n name: '',\n description: '',\n code: '',\n actionType: ActionType.BACKEND,\n permissionLogic: null,\n parentId: '',\n serial: '',\n isActive: true,\n metadata: null,\n });\n\n /** Available action types for dropdown */\n readonly actionTypes = [\n { label: 'Backend (API Endpoints)', value: ActionType.BACKEND },\n { label: 'Frontend (UI Features)', value: ActionType.FRONTEND },\n { label: 'Both (Backend + Frontend)', value: ActionType.BOTH },\n ];\n\n /** Form with validation schema */\n readonly actionForm = form(this.formModel, (f) => {\n required(f.name, { message: 'Name is required' });\n });\n\n /** Check if form is valid */\n readonly isFormValid = computed(() => {\n const model = this.formModel();\n return model.name.trim().length > 0;\n });\n\n constructor() {\n effect(() => {\n const params = this.routeParams();\n if (!params || this.initialized) return;\n\n this.initialized = true;\n this.initializeForm(params.get('id'));\n });\n }\n\n private async initializeForm(id: string | null): Promise<void> {\n // Load ALL actions FIRST - critical for LogicBuilder to display action names\n try {\n const response = await firstValueFrom(\n this.actionApi.getAll('', {\n pagination: { currentPage: 0, pageSize: 10000 },\n select: ['id', 'name', 'code', 'actionType', 'permissionLogic'],\n })\n );\n\n if (response?.success && response.data) {\n // Set actions for LogicBuilder dropdown\n this.allActionsForLogic.set(\n response.data.map(a => ({ id: a.id!, name: a.name ?? 'Unnamed' }))\n );\n\n // Store loaded actions locally for parent dropdown\n this.allActions.set(response.data);\n }\n } catch {\n // Actions load failed - form will show empty parent dropdown\n }\n\n // THEN load the specific action (ensures actions are loaded before setting permissionLogic)\n if (id && id !== 'new') {\n await this.loadAction(id);\n }\n }\n\n async loadAction(id: string): Promise<void> {\n this.isLoading.set(true);\n try {\n // Load fresh data from API to ensure permissionLogic is included\n const response = await this.actionApi.findByIdAsync(id, [\n 'id',\n 'name',\n 'description',\n 'code',\n 'actionType',\n 'permissionLogic',\n 'parentId',\n 'serial',\n 'isActive',\n 'metadata',\n ]);\n\n if (response?.success && response.data) {\n const action = response.data;\n\n // Set existing action for reference\n this.existingAction.set(action);\n\n // Populate form with action data\n this.formModel.set({\n id: action.id ?? '',\n name: action.name ?? '',\n description: action.description ?? '',\n code: action.code ?? '',\n actionType: action.actionType ?? ActionType.BACKEND,\n permissionLogic: action.permissionLogic ?? null,\n parentId: action.parentId ?? '',\n serial: action.serial?.toString() ?? '',\n isActive: action.isActive ?? true,\n metadata: action.metadata ?? null,\n });\n } else {\n // Error toast handled by global interceptor\n this.router.navigate(['/iam/actions']);\n }\n } catch {\n // Error toast handled by global interceptor\n this.router.navigate(['/iam/actions']);\n } finally {\n this.isLoading.set(false);\n }\n }\n\n async onSubmit(): Promise<void> {\n if (!this.isFormValid()) {\n this.messageService.add({\n severity: 'error',\n summary: 'Validation Error',\n detail: 'Please fill in all required fields.',\n });\n return;\n }\n\n this.isLoading.set(true);\n\n try {\n const formValue = this.formModel();\n\n // Convert empty strings to undefined for DTO compatibility\n const dto = {\n ...formValue,\n description: formValue.description || undefined,\n code: formValue.code || undefined,\n parentId: formValue.parentId || undefined,\n serial: formValue.serial ? parseInt(formValue.serial, 10) : undefined,\n metadata: formValue.metadata ?? undefined,\n permissionLogic: formValue.permissionLogic ?? undefined,\n };\n\n if (this.isEditMode()) {\n await this.actionApi.updateAsync(dto);\n this.messageService.add({\n severity: 'success',\n summary: 'Success',\n detail: 'Action updated successfully.',\n });\n } else {\n await this.actionApi.insertAsync(dto);\n this.messageService.add({\n severity: 'success',\n summary: 'Success',\n detail: 'Action created successfully.',\n });\n }\n\n this.router.navigate(['/iam/actions']);\n } catch {\n // Error toast handled by global interceptor\n } finally {\n this.isLoading.set(false);\n }\n }\n\n onBack(): void {\n this.router.navigate(['/iam/actions']);\n }\n\n /**\n * Handle permission logic changes from LogicBuilder\n */\n onLogicChange(logic: ILogicNode | null): void {\n this.formModel.update(model => ({\n ...model,\n permissionLogic: logic\n }));\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAyBA;;;AAGG;MAmHU,uBAAuB,CAAA;AACjB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACpC,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAEvC,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IACpD,WAAW,GAAG,KAAK;;AAGlB,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;;AAGzB,IAAA,cAAc,GAAG,MAAM,CAAiB,IAAI,0DAAC;;AAG7C,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,sDAAC;;AAGpD,IAAA,kBAAkB,GAAG,MAAM,CAAsC,EAAE,8DAAC;;AAGpE,IAAA,UAAU,GAAG,MAAM,CAAY,EAAE,sDAAC;;AAGlC,IAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAK;AACxC,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE;QAC3C,OAAO,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,GAAG,OAAO;AACtE,IAAA,CAAC,4DAAC;;;;;IAOO,SAAS,GAAG,MAAM,CAAmB;AAC5C,QAAA,EAAE,EAAE,EAAE;AACN,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,IAAI,EAAE,EAA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