cloud-ide-core 2.0.3 → 2.0.5
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/cloud-ide-core-user-role-form.component-CjoX7xmg.mjs +353 -0
- package/fesm2022/cloud-ide-core-user-role-form.component-CjoX7xmg.mjs.map +1 -0
- package/fesm2022/cloud-ide-core-user-role-list.component-C6h9Zcyp.mjs +475 -0
- package/fesm2022/cloud-ide-core-user-role-list.component-C6h9Zcyp.mjs.map +1 -0
- package/fesm2022/cloud-ide-core-user-role.service-DNI0f0PM.mjs +124 -0
- package/fesm2022/cloud-ide-core-user-role.service-DNI0f0PM.mjs.map +1 -0
- package/fesm2022/cloud-ide-core.mjs +252 -113
- package/fesm2022/cloud-ide-core.mjs.map +1 -1
- package/index.d.ts +458 -9
- package/package.json +1 -1
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, viewChild, signal, computed, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import { Router } from '@angular/router';
|
|
7
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { NotificationService, ConfirmationService, CideIconComponent, CideEleButtonComponent, CideEleDataGridComponent, CideEleDropdownComponent } from 'cloud-ide-element';
|
|
9
|
+
import { generateStringFromObject } from 'cloud-ide-lms-model';
|
|
10
|
+
import { AppStateHelperService } from 'cloud-ide-layout';
|
|
11
|
+
import { C as CideCoreUserRoleService } from './cloud-ide-core-user-role.service-DNI0f0PM.mjs';
|
|
12
|
+
|
|
13
|
+
class CideCoreUserRoleListComponent {
|
|
14
|
+
// Dependency injection
|
|
15
|
+
destroyRef = inject(DestroyRef);
|
|
16
|
+
userRoleService = inject(CideCoreUserRoleService);
|
|
17
|
+
router = inject(Router);
|
|
18
|
+
appState = inject(AppStateHelperService);
|
|
19
|
+
notificationService = inject(NotificationService);
|
|
20
|
+
confirmationService = inject(ConfirmationService);
|
|
21
|
+
// Modern ViewChild signals for template renderers (Angular 20 approach)
|
|
22
|
+
userRoleDetailsRendererTemplate = viewChild.required('userRoleDetailsRendererTemplate');
|
|
23
|
+
entityRendererTemplate = viewChild.required('entityRendererTemplate');
|
|
24
|
+
statusRendererTemplate = viewChild.required('statusRendererTemplate');
|
|
25
|
+
actionsDropdownRendererTemplate = viewChild.required('actionsDropdownRendererTemplate');
|
|
26
|
+
// State management using Angular Signals for server-side operations
|
|
27
|
+
userRoles = signal([], ...(ngDevMode ? [{ debugName: "userRoles" }] : []));
|
|
28
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
29
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
30
|
+
// Server-side pagination state
|
|
31
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
32
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
33
|
+
totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
34
|
+
totalPages = signal(0, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
35
|
+
// Server-side search state
|
|
36
|
+
searchQuery = signal('', ...(ngDevMode ? [{ debugName: "searchQuery" }] : []));
|
|
37
|
+
// Server-side sorting state
|
|
38
|
+
sortColumn = signal('syusrol_role_name', ...(ngDevMode ? [{ debugName: "sortColumn" }] : []));
|
|
39
|
+
sortDirection = signal('asc', ...(ngDevMode ? [{ debugName: "sortDirection" }] : []));
|
|
40
|
+
// Server-side filtering state
|
|
41
|
+
selectedStatusFilter = signal('', ...(ngDevMode ? [{ debugName: "selectedStatusFilter" }] : []));
|
|
42
|
+
// Getter and setter for ngModel compatibility
|
|
43
|
+
get selectedStatusFilterValue() {
|
|
44
|
+
return this.selectedStatusFilter();
|
|
45
|
+
}
|
|
46
|
+
set selectedStatusFilterValue(value) {
|
|
47
|
+
this.selectedStatusFilter.set(value);
|
|
48
|
+
}
|
|
49
|
+
// Filter options
|
|
50
|
+
statusFilterOptions = signal([
|
|
51
|
+
{ value: '', label: 'All Status' },
|
|
52
|
+
{ value: 'active', label: 'Active Roles' },
|
|
53
|
+
{ value: 'inactive', label: 'Inactive Roles' },
|
|
54
|
+
{ value: 'locked', label: 'Locked Roles' }
|
|
55
|
+
], ...(ngDevMode ? [{ debugName: "statusFilterOptions" }] : []));
|
|
56
|
+
// Grid configuration signal
|
|
57
|
+
gridConfig = signal({
|
|
58
|
+
id: 'user-role-list-grid',
|
|
59
|
+
columns: [
|
|
60
|
+
{
|
|
61
|
+
key: 'details',
|
|
62
|
+
header: 'Role Details',
|
|
63
|
+
type: 'custom',
|
|
64
|
+
width: 'auto',
|
|
65
|
+
truncate: true,
|
|
66
|
+
align: 'left',
|
|
67
|
+
renderer: 'userRoleDetailsRenderer'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'entity',
|
|
71
|
+
header: 'Entity',
|
|
72
|
+
type: 'custom',
|
|
73
|
+
width: '150px',
|
|
74
|
+
truncate: true,
|
|
75
|
+
align: 'left',
|
|
76
|
+
renderer: 'entityRenderer'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'syusrol_isactive',
|
|
80
|
+
header: 'Status',
|
|
81
|
+
type: 'custom',
|
|
82
|
+
width: '120px',
|
|
83
|
+
truncate: false,
|
|
84
|
+
align: 'center',
|
|
85
|
+
renderer: 'statusRenderer'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: 'actions',
|
|
89
|
+
header: '',
|
|
90
|
+
type: 'custom',
|
|
91
|
+
width: '150px',
|
|
92
|
+
truncate: false,
|
|
93
|
+
align: 'center',
|
|
94
|
+
renderer: 'actionsDropdownRenderer'
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
data: [],
|
|
98
|
+
trackBy: '_id',
|
|
99
|
+
pagination: {
|
|
100
|
+
enabled: true,
|
|
101
|
+
pageSize: 10,
|
|
102
|
+
pageSizeOptions: [10, 25, 50, 100],
|
|
103
|
+
showQuickJump: true,
|
|
104
|
+
showPageInfo: true,
|
|
105
|
+
showRefresh: true
|
|
106
|
+
},
|
|
107
|
+
search: {
|
|
108
|
+
enabled: true,
|
|
109
|
+
placeholder: 'Search user roles...',
|
|
110
|
+
searchableColumns: ['syusrol_role_name', 'syusrol_role_description'],
|
|
111
|
+
debounceMs: 300
|
|
112
|
+
},
|
|
113
|
+
loading: {
|
|
114
|
+
useDefer: true,
|
|
115
|
+
skeletonRows: 5,
|
|
116
|
+
showOverlay: false
|
|
117
|
+
},
|
|
118
|
+
scroll: {
|
|
119
|
+
enabled: true,
|
|
120
|
+
maxHeight: '',
|
|
121
|
+
minHeight: '',
|
|
122
|
+
stickyHeader: true,
|
|
123
|
+
virtualScroll: false,
|
|
124
|
+
rowHeight: 50
|
|
125
|
+
},
|
|
126
|
+
responsive: true,
|
|
127
|
+
striped: false,
|
|
128
|
+
bordered: true,
|
|
129
|
+
compact: false,
|
|
130
|
+
tableClass: 'tw-table-fixed tw-w-full tw-rounded-none'
|
|
131
|
+
}, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
132
|
+
ngOnInit() {
|
|
133
|
+
console.log('👥 User Role List Component initialized');
|
|
134
|
+
this.loadUserRoles();
|
|
135
|
+
}
|
|
136
|
+
ngOnDestroy() {
|
|
137
|
+
console.log('👥 User Role List Component destroyed');
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Load user roles from API
|
|
141
|
+
*/
|
|
142
|
+
loadUserRoles() {
|
|
143
|
+
this.loading.set(true);
|
|
144
|
+
this.error.set(null);
|
|
145
|
+
const payload = {
|
|
146
|
+
pageIndex: this.currentPage(),
|
|
147
|
+
pageSize: this.pageSize(),
|
|
148
|
+
query: this.searchQuery() || "",
|
|
149
|
+
sort: {
|
|
150
|
+
key: this.sortColumn(),
|
|
151
|
+
order: this.sortDirection()
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
this.userRoleService.getUserRoleList(payload)
|
|
155
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
156
|
+
.subscribe({
|
|
157
|
+
next: (response) => {
|
|
158
|
+
if (response?.success && response.data) {
|
|
159
|
+
this.userRoles.set(response.data);
|
|
160
|
+
this.totalItems.set(response.data.length);
|
|
161
|
+
this.totalPages.set(Math.ceil(response.data.length / this.pageSize()));
|
|
162
|
+
this.updateGridData();
|
|
163
|
+
this.notificationService.success(`Loaded ${response.data.length} user role(s) successfully.`);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
console.warn('⚠️ No user role data received');
|
|
167
|
+
this.userRoles.set([]);
|
|
168
|
+
this.totalItems.set(0);
|
|
169
|
+
this.totalPages.set(0);
|
|
170
|
+
this.notificationService.warning('No user roles found.');
|
|
171
|
+
}
|
|
172
|
+
this.loading.set(false);
|
|
173
|
+
},
|
|
174
|
+
error: (error) => {
|
|
175
|
+
console.error('❌ Error loading user roles:', error);
|
|
176
|
+
this.error.set('Failed to load user roles. Please try again.');
|
|
177
|
+
this.userRoles.set([]);
|
|
178
|
+
this.totalItems.set(0);
|
|
179
|
+
this.totalPages.set(0);
|
|
180
|
+
this.loading.set(false);
|
|
181
|
+
this.notificationService.error('Failed to load user roles. Please try again.');
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Update grid data
|
|
187
|
+
*/
|
|
188
|
+
updateGridData() {
|
|
189
|
+
this.gridConfig.update(config => ({
|
|
190
|
+
...config,
|
|
191
|
+
data: this.userRoles()
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
// Computed template renderers for grid
|
|
195
|
+
templateRenderers = computed(() => ({
|
|
196
|
+
userRoleDetailsRenderer: this.userRoleDetailsRendererTemplate(),
|
|
197
|
+
entityRenderer: this.entityRendererTemplate(),
|
|
198
|
+
statusRenderer: this.statusRendererTemplate(),
|
|
199
|
+
actionsDropdownRenderer: this.actionsDropdownRendererTemplate()
|
|
200
|
+
}), ...(ngDevMode ? [{ debugName: "templateRenderers" }] : []));
|
|
201
|
+
/**
|
|
202
|
+
* Handle grid events
|
|
203
|
+
*/
|
|
204
|
+
onGridEvent(event) {
|
|
205
|
+
switch (event.type) {
|
|
206
|
+
case 'pageChange':
|
|
207
|
+
if (event.data && typeof event.data === 'object' && 'pageIndex' in event.data && 'pageSize' in event.data) {
|
|
208
|
+
this.currentPage.set(event.data['pageIndex']);
|
|
209
|
+
this.pageSize.set(event.data['pageSize']);
|
|
210
|
+
this.loadUserRoles();
|
|
211
|
+
}
|
|
212
|
+
break;
|
|
213
|
+
case 'search':
|
|
214
|
+
if (event.data && typeof event.data === 'string') {
|
|
215
|
+
this.searchQuery.set(event.data);
|
|
216
|
+
this.currentPage.set(1);
|
|
217
|
+
this.loadUserRoles();
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
case 'refresh':
|
|
221
|
+
this.loadUserRoles();
|
|
222
|
+
break;
|
|
223
|
+
case 'action':
|
|
224
|
+
// Handle action events if needed
|
|
225
|
+
console.log('Action event:', event);
|
|
226
|
+
break;
|
|
227
|
+
case 'rowClick':
|
|
228
|
+
// Handle row click events if needed
|
|
229
|
+
console.log('Row click event:', event);
|
|
230
|
+
break;
|
|
231
|
+
case 'sort':
|
|
232
|
+
// Handle sort events if needed
|
|
233
|
+
console.log('Sort event:', event);
|
|
234
|
+
break;
|
|
235
|
+
case 'export':
|
|
236
|
+
// Handle export events if needed
|
|
237
|
+
console.log('Export event:', event);
|
|
238
|
+
break;
|
|
239
|
+
default:
|
|
240
|
+
console.log('🔄 Unhandled grid event:', event.type);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Filter handlers
|
|
244
|
+
onStatusFilterChange() {
|
|
245
|
+
console.log('🔍 Status filter changed:', this.selectedStatusFilter());
|
|
246
|
+
this.currentPage.set(1); // Reset to first page when filtering
|
|
247
|
+
this.loadUserRoles();
|
|
248
|
+
}
|
|
249
|
+
clearFilters() {
|
|
250
|
+
console.log('🧹 Clearing filters');
|
|
251
|
+
this.selectedStatusFilter.set('');
|
|
252
|
+
this.searchQuery.set('');
|
|
253
|
+
this.currentPage.set(1);
|
|
254
|
+
this.loadUserRoles();
|
|
255
|
+
}
|
|
256
|
+
// User Role actions
|
|
257
|
+
createUserRole() {
|
|
258
|
+
console.log('➕ Navigating to create user role');
|
|
259
|
+
this.notificationService.info('Opening user role creation form.');
|
|
260
|
+
this.router.navigate(['/control-panel/user-role/create']);
|
|
261
|
+
}
|
|
262
|
+
viewUserRole(userRole) {
|
|
263
|
+
console.log('👁️ Viewing user role:', userRole);
|
|
264
|
+
this.notificationService.info(`Opening user role "${userRole.syusrol_role_name}" for viewing.`);
|
|
265
|
+
const queryParams = generateStringFromObject({ syusrol_id: userRole._id });
|
|
266
|
+
this.router.navigate(['/control-panel/user-role/view', queryParams]);
|
|
267
|
+
}
|
|
268
|
+
editUserRole(userRole) {
|
|
269
|
+
console.log('✏️ Editing user role:', userRole);
|
|
270
|
+
this.notificationService.info(`Opening user role "${userRole.syusrol_role_name}" for editing.`);
|
|
271
|
+
const queryParams = generateStringFromObject({ syusrol_id: userRole._id });
|
|
272
|
+
this.router.navigate(['/control-panel/user-role/edit', queryParams]);
|
|
273
|
+
}
|
|
274
|
+
deleteUserRole(userRole) {
|
|
275
|
+
console.log('🗑️ DELETE METHOD CALLED - Deleting user role:', userRole);
|
|
276
|
+
// Show confirmation dialog
|
|
277
|
+
console.log('🔔 Showing confirmation dialog for delete');
|
|
278
|
+
this.confirmationService.ask({
|
|
279
|
+
title: 'Delete User Role',
|
|
280
|
+
message: `Are you sure you want to delete the user role "${userRole.syusrol_role_name}"?\n\nThis action cannot be undone and will also delete all associated role rights.`,
|
|
281
|
+
confirmText: 'Delete',
|
|
282
|
+
cancelText: 'Cancel',
|
|
283
|
+
type: 'danger'
|
|
284
|
+
}).then((confirmed) => {
|
|
285
|
+
console.log('🔔 Confirmation dialog result:', confirmed);
|
|
286
|
+
if (confirmed) {
|
|
287
|
+
console.log('🗑️ Confirmed deletion, calling service with ID:', userRole._id);
|
|
288
|
+
this.loading.set(true);
|
|
289
|
+
this.userRoleService.deleteUserRole({ syusrol_id: userRole._id || '' }).subscribe({
|
|
290
|
+
next: (response) => {
|
|
291
|
+
if (response?.success) {
|
|
292
|
+
console.log('✅ User role deleted successfully');
|
|
293
|
+
this.notificationService.success(`User role "${userRole.syusrol_role_name}" has been deleted successfully.`);
|
|
294
|
+
this.loadUserRoles(); // Reload the list
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
console.error('❌ Failed to delete user role');
|
|
298
|
+
this.notificationService.error(response?.message || 'Failed to delete user role');
|
|
299
|
+
this.loading.set(false);
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
error: (error) => {
|
|
303
|
+
console.error('❌ Error deleting user role:', error);
|
|
304
|
+
this.notificationService.error('Failed to delete user role. Please try again.');
|
|
305
|
+
this.loading.set(false);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
toggleUserRoleStatus(userRole) {
|
|
312
|
+
console.log('🔄 Toggling user role status:', userRole);
|
|
313
|
+
const action = userRole.syusrol_isactive ? 'deactivate' : 'activate';
|
|
314
|
+
const actionText = userRole.syusrol_isactive ? 'Deactivate' : 'Activate';
|
|
315
|
+
// Show confirmation dialog
|
|
316
|
+
console.log('🔔 Showing confirmation dialog for toggle status');
|
|
317
|
+
this.confirmationService.ask({
|
|
318
|
+
title: `${actionText} User Role`,
|
|
319
|
+
message: `Are you sure you want to ${action} the user role "${userRole.syusrol_role_name}"?`,
|
|
320
|
+
confirmText: actionText,
|
|
321
|
+
cancelText: 'Cancel',
|
|
322
|
+
type: 'warning'
|
|
323
|
+
}).then((confirmed) => {
|
|
324
|
+
console.log('🔔 Confirmation dialog result:', confirmed);
|
|
325
|
+
if (confirmed) {
|
|
326
|
+
console.log('🔄 Calling toggleUserRoleStatus with ID:', userRole._id);
|
|
327
|
+
this.userRoleService.toggleUserRoleStatus({ syusrol_id: userRole._id || '' }).subscribe({
|
|
328
|
+
next: (response) => {
|
|
329
|
+
console.log('🔄 Toggle user role status response:', response);
|
|
330
|
+
if (response?.success) {
|
|
331
|
+
console.log('✅ User role status toggled successfully');
|
|
332
|
+
this.notificationService.success(`User role "${userRole.syusrol_role_name}" has been ${action}d successfully.`);
|
|
333
|
+
this.loadUserRoles();
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
console.error('❌ Failed to toggle user role status');
|
|
337
|
+
this.notificationService.error(response?.message || 'Failed to toggle user role status');
|
|
338
|
+
this.loading.set(false);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
error: (error) => {
|
|
342
|
+
console.error('❌ Error toggling user role status:', error);
|
|
343
|
+
this.notificationService.error('Failed to toggle user role status. Please try again.');
|
|
344
|
+
this.loading.set(false);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Get dropdown configuration
|
|
352
|
+
*/
|
|
353
|
+
getDropdownConfig() {
|
|
354
|
+
return {
|
|
355
|
+
triggerIcon: 'more_vert',
|
|
356
|
+
triggerSize: 'sm',
|
|
357
|
+
menuPosition: 'right',
|
|
358
|
+
forcePosition: 'bottom',
|
|
359
|
+
offsetX: 0,
|
|
360
|
+
offsetY: 4,
|
|
361
|
+
usePortal: true
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Get action dropdown items
|
|
366
|
+
*/
|
|
367
|
+
getActionDropdownItems(userRole) {
|
|
368
|
+
console.log('🔽 Generating dropdown items for:', userRole.syusrol_role_name);
|
|
369
|
+
console.log('🔽 User role data:', {
|
|
370
|
+
isActive: userRole.syusrol_isactive
|
|
371
|
+
});
|
|
372
|
+
const items = [
|
|
373
|
+
{
|
|
374
|
+
id: 'view',
|
|
375
|
+
label: 'View Details',
|
|
376
|
+
icon: 'visibility',
|
|
377
|
+
iconColor: 'tw-text-gray-400',
|
|
378
|
+
textColor: 'tw-text-gray-700',
|
|
379
|
+
hoverBgColor: 'hover:tw-bg-gray-100'
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
id: 'edit',
|
|
383
|
+
label: 'Edit',
|
|
384
|
+
icon: 'edit',
|
|
385
|
+
iconColor: 'tw-text-blue-400',
|
|
386
|
+
textColor: 'tw-text-blue-600',
|
|
387
|
+
hoverBgColor: 'hover:tw-bg-blue-50'
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
id: 'toggle-status',
|
|
391
|
+
label: userRole.syusrol_isactive ? 'Deactivate' : 'Activate',
|
|
392
|
+
icon: userRole.syusrol_isactive ? 'toggle_off' : 'toggle_on',
|
|
393
|
+
iconColor: 'tw-text-gray-400',
|
|
394
|
+
textColor: 'tw-text-gray-700',
|
|
395
|
+
hoverBgColor: 'hover:tw-bg-gray-100'
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
id: 'delete',
|
|
399
|
+
label: 'Delete',
|
|
400
|
+
icon: 'delete',
|
|
401
|
+
iconColor: 'tw-text-red-400',
|
|
402
|
+
textColor: 'tw-text-red-600',
|
|
403
|
+
hoverBgColor: 'hover:tw-bg-red-50',
|
|
404
|
+
divider: true
|
|
405
|
+
}
|
|
406
|
+
];
|
|
407
|
+
return items;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Handle dropdown item click
|
|
411
|
+
*/
|
|
412
|
+
onDropdownItemClick(item, userRole) {
|
|
413
|
+
console.log('🔽 Dropdown item clicked:', item.id, 'for user role:', userRole.syusrol_role_name);
|
|
414
|
+
switch (item.id) {
|
|
415
|
+
case 'view':
|
|
416
|
+
this.viewUserRole(userRole);
|
|
417
|
+
break;
|
|
418
|
+
case 'edit':
|
|
419
|
+
this.editUserRole(userRole);
|
|
420
|
+
break;
|
|
421
|
+
case 'toggle-status':
|
|
422
|
+
this.toggleUserRoleStatus(userRole);
|
|
423
|
+
break;
|
|
424
|
+
case 'delete':
|
|
425
|
+
this.deleteUserRole(userRole);
|
|
426
|
+
break;
|
|
427
|
+
default:
|
|
428
|
+
console.log('❓ Unknown dropdown item clicked:', item.id);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
// Export handler
|
|
432
|
+
handleExport(format) {
|
|
433
|
+
console.log(`📤 Exporting user roles as ${format}`);
|
|
434
|
+
// Implement export logic here
|
|
435
|
+
// Could export current filtered/sorted data or all data
|
|
436
|
+
}
|
|
437
|
+
// Utility methods
|
|
438
|
+
formatDate(date) {
|
|
439
|
+
if (!date)
|
|
440
|
+
return '-';
|
|
441
|
+
return new Date(date).toLocaleDateString();
|
|
442
|
+
}
|
|
443
|
+
getStatusBadgeClass(userRole) {
|
|
444
|
+
if (userRole.syusrol_isactive)
|
|
445
|
+
return 'tw-bg-green-100 tw-text-green-800';
|
|
446
|
+
return 'tw-bg-orange-100 tw-text-orange-800';
|
|
447
|
+
}
|
|
448
|
+
getStatusText(userRole) {
|
|
449
|
+
if (userRole.syusrol_isactive)
|
|
450
|
+
return 'Active';
|
|
451
|
+
return 'Inactive';
|
|
452
|
+
}
|
|
453
|
+
getEntityName(entity) {
|
|
454
|
+
if (typeof entity === 'object' && entity?.syen_name) {
|
|
455
|
+
return entity.syen_name;
|
|
456
|
+
}
|
|
457
|
+
return entity || 'N/A';
|
|
458
|
+
}
|
|
459
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreUserRoleListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
460
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideCoreUserRoleListComponent, isStandalone: true, selector: "cide-core-user-role-list", viewQueries: [{ propertyName: "userRoleDetailsRendererTemplate", first: true, predicate: ["userRoleDetailsRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "entityRendererTemplate", first: true, predicate: ["entityRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "statusRendererTemplate", first: true, predicate: ["statusRendererTemplate"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRendererTemplate", first: true, predicate: ["actionsDropdownRendererTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- User Role Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-2 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0\">\n \n <!-- Title and Back Button -->\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <h1 class=\"tw-text-2xl tw-font-bold tw-text-gray-900 tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">admin_panel_settings</cide-ele-icon>\n User Role Management\n </h1>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0 sm:tw-space-x-3\">\n <button cideEleButton variant=\"primary\" size=\"md\" leftIcon=\"add\" \n (click)=\"createUserRole()\">\n Create User Role\n </button>\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-3 tw-p-3 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\n <div class=\"tw-flex tw-items-start\">\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-4 tw-h-4 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"tw-table-row\">\n <div class=\"tw-table-cell tw-h-full tw-relative\">\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"templateRenderers()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Template Renderers -->\n<ng-template #userRoleDetailsRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col tw-w-full\">\n <div class=\"tw-font-medium tw-text-gray-900\">{{ row.syusrol_role_name || 'N/A' }}</div>\n <div class=\"tw-text-sm tw-text-gray-500 tw-truncate\">{{ row.syusrol_role_description || 'No description' }}</div>\n </div>\n</ng-template>\n\n<ng-template #entityRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col tw-text-sm\">\n <span class=\"tw-text-gray-900\">{{ getEntityName(row.syusrol_role_entity_id_syen) }}</span>\n </div>\n</ng-template>\n\n<ng-template #statusRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-items-center tw-justify-center\">\n <!-- Active/Inactive Status Badge -->\n <span class=\"tw-inline-flex tw-items-center tw-justify-center tw-px-2.5 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-text-center\"\n [ngClass]=\"getStatusBadgeClass(row)\">\n <cide-ele-icon size=\"2xs\" class=\"tw-mr-1\">\n {{ row.syusrol_isactive ? 'check_circle' : 'cancel' }}\n </cide-ele-icon>\n {{ getStatusText(row) }}\n </span>\n </div>\n</ng-template>\n\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\">\n <cide-ele-dropdown\n [items]=\"getActionDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>\n", styles: [".user-role-listing-container{@apply tw-w-full tw-h-full;}:host{@apply tw-w-full tw-h-full tw-flex tw-flex-col;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideEleDataGridComponent, selector: "cide-ele-data-grid", inputs: ["config", "templateRenderers", "customFormatters", "actionHandlers", "serverSidePagination", "totalServerItems", "currentServerPage", "currentServerPageSize", "dragDropEnabled"], outputs: ["gridEvent"] }, { kind: "component", type: CideEleDropdownComponent, selector: "cide-ele-dropdown", inputs: ["items", "config", "triggerTemplate", "menuTemplate"], outputs: ["itemClick", "dropdownToggle"] }] });
|
|
461
|
+
}
|
|
462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideCoreUserRoleListComponent, decorators: [{
|
|
463
|
+
type: Component,
|
|
464
|
+
args: [{ selector: 'cide-core-user-role-list', standalone: true, imports: [
|
|
465
|
+
CommonModule,
|
|
466
|
+
FormsModule,
|
|
467
|
+
CideIconComponent,
|
|
468
|
+
CideEleButtonComponent,
|
|
469
|
+
CideEleDataGridComponent,
|
|
470
|
+
CideEleDropdownComponent
|
|
471
|
+
], template: "<!-- User Role Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-2 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0\">\n \n <!-- Title and Back Button -->\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <h1 class=\"tw-text-2xl tw-font-bold tw-text-gray-900 tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">admin_panel_settings</cide-ele-icon>\n User Role Management\n </h1>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0 sm:tw-space-x-3\">\n <button cideEleButton variant=\"primary\" size=\"md\" leftIcon=\"add\" \n (click)=\"createUserRole()\">\n Create User Role\n </button>\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-3 tw-p-3 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\n <div class=\"tw-flex tw-items-start\">\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-4 tw-h-4 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"tw-table-row\">\n <div class=\"tw-table-cell tw-h-full tw-relative\">\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"templateRenderers()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Template Renderers -->\n<ng-template #userRoleDetailsRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col tw-w-full\">\n <div class=\"tw-font-medium tw-text-gray-900\">{{ row.syusrol_role_name || 'N/A' }}</div>\n <div class=\"tw-text-sm tw-text-gray-500 tw-truncate\">{{ row.syusrol_role_description || 'No description' }}</div>\n </div>\n</ng-template>\n\n<ng-template #entityRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col tw-text-sm\">\n <span class=\"tw-text-gray-900\">{{ getEntityName(row.syusrol_role_entity_id_syen) }}</span>\n </div>\n</ng-template>\n\n<ng-template #statusRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-items-center tw-justify-center\">\n <!-- Active/Inactive Status Badge -->\n <span class=\"tw-inline-flex tw-items-center tw-justify-center tw-px-2.5 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-text-center\"\n [ngClass]=\"getStatusBadgeClass(row)\">\n <cide-ele-icon size=\"2xs\" class=\"tw-mr-1\">\n {{ row.syusrol_isactive ? 'check_circle' : 'cancel' }}\n </cide-ele-icon>\n {{ getStatusText(row) }}\n </span>\n </div>\n</ng-template>\n\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\">\n <cide-ele-dropdown\n [items]=\"getActionDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>\n", styles: [".user-role-listing-container{@apply tw-w-full tw-h-full;}:host{@apply tw-w-full tw-h-full tw-flex tw-flex-col;}\n"] }]
|
|
472
|
+
}] });
|
|
473
|
+
|
|
474
|
+
export { CideCoreUserRoleListComponent };
|
|
475
|
+
//# sourceMappingURL=cloud-ide-core-user-role-list.component-C6h9Zcyp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-ide-core-user-role-list.component-C6h9Zcyp.mjs","sources":["../../../projects/cloud-ide-core/src/lib/core/user-role-management/components/user-role-list/user-role-list.component.ts","../../../projects/cloud-ide-core/src/lib/core/user-role-management/components/user-role-list/user-role-list.component.html"],"sourcesContent":["import { Component, signal, computed, viewChild, TemplateRef, DestroyRef, inject, OnInit, OnDestroy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { Router } from '@angular/router';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CideEleDataGridComponent, CideIconComponent, CideEleButtonComponent, CideSelectComponent, GridConfiguration, GridEvent, CideEleDropdownComponent, DropdownItem, TemplateContext, NotificationService, ConfirmationService, DropdownConfig } from 'cloud-ide-element';\nimport { type MUserRole, generateStringFromObject } from 'cloud-ide-lms-model';\nimport { AppStateHelperService } from 'cloud-ide-layout';\nimport { CideCoreUserRoleService } from '../../services/user-role.service';\nimport { Observable, forkJoin, of } from 'rxjs';\nimport { map, catchError, switchMap } from 'rxjs/operators';\nimport type { UserRole, Entity, ApiResponse } from '../../interfaces/user-role.interface';\nimport type { MUserRoleDeletePayload, MUserRoleToggleStatusPayload } from 'cloud-ide-lms-model';\n\n@Component({\n selector: 'cide-core-user-role-list',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n CideIconComponent,\n CideEleButtonComponent,\n CideEleDataGridComponent,\n CideEleDropdownComponent\n ],\n templateUrl: './user-role-list.component.html',\n styles: [`\n .user-role-listing-container {\n @apply tw-w-full tw-h-full;\n }\n \n :host {\n @apply tw-w-full tw-h-full tw-flex tw-flex-col;\n }\n `]\n})\nexport class CideCoreUserRoleListComponent implements OnInit, OnDestroy {\n // Dependency injection\n private readonly destroyRef = inject(DestroyRef);\n private readonly userRoleService = inject(CideCoreUserRoleService);\n private readonly router = inject(Router);\n private readonly appState = inject(AppStateHelperService);\n private readonly notificationService = inject(NotificationService);\n private readonly confirmationService = inject(ConfirmationService);\n\n // Modern ViewChild signals for template renderers (Angular 20 approach)\n userRoleDetailsRendererTemplate = viewChild.required<TemplateRef<TemplateContext>>('userRoleDetailsRendererTemplate');\n entityRendererTemplate = viewChild.required<TemplateRef<TemplateContext>>('entityRendererTemplate');\n statusRendererTemplate = viewChild.required<TemplateRef<TemplateContext>>('statusRendererTemplate');\n actionsDropdownRendererTemplate = viewChild.required<TemplateRef<TemplateContext>>('actionsDropdownRendererTemplate');\n\n // State management using Angular Signals for server-side operations\n userRoles = signal<UserRole[]>([]);\n loading = signal(false);\n error = signal<string | null>(null);\n\n // Server-side pagination state\n currentPage = signal(1);\n pageSize = signal(10);\n totalItems = signal(0);\n totalPages = signal(0);\n\n // Server-side search state\n searchQuery = signal('');\n\n // Server-side sorting state\n sortColumn = signal('syusrol_role_name');\n sortDirection = signal<'asc' | 'desc'>('asc');\n\n // Server-side filtering state\n selectedStatusFilter = signal('');\n\n // Getter and setter for ngModel compatibility\n get selectedStatusFilterValue(): string {\n return this.selectedStatusFilter();\n }\n\n set selectedStatusFilterValue(value: string) {\n this.selectedStatusFilter.set(value);\n }\n\n // Filter options\n statusFilterOptions = signal([\n { value: '', label: 'All Status' },\n { value: 'active', label: 'Active Roles' },\n { value: 'inactive', label: 'Inactive Roles' },\n { value: 'locked', label: 'Locked Roles' }\n ]);\n\n // Grid configuration signal\n gridConfig = signal<GridConfiguration<UserRole>>({\n id: 'user-role-list-grid',\n columns: [\n {\n key: 'details',\n header: 'Role Details',\n type: 'custom',\n width: 'auto',\n truncate: true,\n align: 'left',\n renderer: 'userRoleDetailsRenderer'\n },\n {\n key: 'entity',\n header: 'Entity',\n type: 'custom',\n width: '150px',\n truncate: true,\n align: 'left',\n renderer: 'entityRenderer'\n },\n {\n key: 'syusrol_isactive',\n header: 'Status',\n type: 'custom',\n width: '120px',\n truncate: false,\n align: 'center',\n renderer: 'statusRenderer'\n },\n {\n key: 'actions',\n header: '',\n type: 'custom',\n width: '150px',\n truncate: false,\n align: 'center',\n renderer: 'actionsDropdownRenderer'\n }\n ],\n data: [],\n trackBy: '_id',\n pagination: {\n enabled: true,\n pageSize: 10,\n pageSizeOptions: [10, 25, 50, 100],\n showQuickJump: true,\n showPageInfo: true,\n showRefresh: true\n },\n search: {\n enabled: true,\n placeholder: 'Search user roles...',\n searchableColumns: ['syusrol_role_name', 'syusrol_role_description'],\n debounceMs: 300\n },\n loading: {\n useDefer: true,\n skeletonRows: 5,\n showOverlay: false\n },\n scroll: {\n enabled: true,\n maxHeight: '',\n minHeight: '',\n stickyHeader: true,\n virtualScroll: false,\n rowHeight: 50\n },\n responsive: true,\n striped: false,\n bordered: true,\n compact: false,\n tableClass: 'tw-table-fixed tw-w-full tw-rounded-none'\n });\n\n ngOnInit(): void {\n console.log('👥 User Role List Component initialized');\n this.loadUserRoles();\n }\n\n ngOnDestroy(): void {\n console.log('👥 User Role List Component destroyed');\n }\n\n /**\n * Load user roles from API\n */\n loadUserRoles(): void {\n this.loading.set(true);\n this.error.set(null);\n\n const payload: MUserRole = {\n pageIndex: this.currentPage(),\n pageSize: this.pageSize(),\n query: this.searchQuery() || \"\",\n sort: {\n key: this.sortColumn(),\n order: this.sortDirection()\n }\n };\n\n this.userRoleService.getUserRoleList(payload)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (response) => {\n if (response?.success && response.data) {\n this.userRoles.set(response.data);\n this.totalItems.set(response.data.length);\n this.totalPages.set(Math.ceil(response.data.length / this.pageSize()));\n this.updateGridData();\n this.notificationService.success(`Loaded ${response.data.length} user role(s) successfully.`);\n } else {\n console.warn('⚠️ No user role data received');\n this.userRoles.set([]);\n this.totalItems.set(0);\n this.totalPages.set(0);\n this.notificationService.warning('No user roles found.');\n }\n this.loading.set(false);\n },\n error: (error) => {\n console.error('❌ Error loading user roles:', error);\n this.error.set('Failed to load user roles. Please try again.');\n this.userRoles.set([]);\n this.totalItems.set(0);\n this.totalPages.set(0);\n this.loading.set(false);\n this.notificationService.error('Failed to load user roles. Please try again.');\n }\n });\n }\n\n /**\n * Update grid data\n */\n private updateGridData(): void {\n this.gridConfig.update(config => ({\n ...config,\n data: this.userRoles()\n }));\n }\n\n // Computed template renderers for grid\n templateRenderers = computed((): Record<string, TemplateRef<TemplateContext>> => ({\n userRoleDetailsRenderer: this.userRoleDetailsRendererTemplate(),\n entityRenderer: this.entityRendererTemplate(),\n statusRenderer: this.statusRendererTemplate(),\n actionsDropdownRenderer: this.actionsDropdownRendererTemplate()\n }));\n\n /**\n * Handle grid events\n */\n onGridEvent(event: GridEvent<UserRole>): void {\n switch (event.type) {\n case 'pageChange':\n if (event.data && typeof event.data === 'object' && 'pageIndex' in event.data && 'pageSize' in event.data) {\n this.currentPage.set(event.data['pageIndex'] as number);\n this.pageSize.set(event.data['pageSize'] as number);\n this.loadUserRoles();\n }\n break;\n case 'search':\n if (event.data && typeof event.data === 'string') {\n this.searchQuery.set(event.data);\n this.currentPage.set(1);\n this.loadUserRoles();\n }\n break;\n case 'refresh':\n this.loadUserRoles();\n break;\n case 'action':\n // Handle action events if needed\n console.log('Action event:', event);\n break;\n case 'rowClick':\n // Handle row click events if needed\n console.log('Row click event:', event);\n break;\n case 'sort':\n // Handle sort events if needed\n console.log('Sort event:', event);\n break;\n case 'export':\n // Handle export events if needed\n console.log('Export event:', event);\n break;\n default:\n console.log('🔄 Unhandled grid event:', event.type);\n }\n }\n\n // Filter handlers\n onStatusFilterChange(): void {\n console.log('🔍 Status filter changed:', this.selectedStatusFilter());\n this.currentPage.set(1); // Reset to first page when filtering\n this.loadUserRoles();\n }\n\n clearFilters(): void {\n console.log('🧹 Clearing filters');\n this.selectedStatusFilter.set('');\n this.searchQuery.set('');\n this.currentPage.set(1);\n this.loadUserRoles();\n }\n\n // User Role actions\n createUserRole(): void {\n console.log('➕ Navigating to create user role');\n this.notificationService.info('Opening user role creation form.');\n this.router.navigate(['/control-panel/user-role/create']);\n }\n\n viewUserRole(userRole: UserRole): void {\n console.log('👁️ Viewing user role:', userRole);\n this.notificationService.info(`Opening user role \"${userRole.syusrol_role_name}\" for viewing.`);\n const queryParams = generateStringFromObject({ syusrol_id: userRole._id });\n this.router.navigate(['/control-panel/user-role/view', queryParams]);\n }\n\n editUserRole(userRole: UserRole): void {\n console.log('✏️ Editing user role:', userRole);\n \n this.notificationService.info(`Opening user role \"${userRole.syusrol_role_name}\" for editing.`);\n const queryParams = generateStringFromObject({ syusrol_id: userRole._id });\n this.router.navigate(['/control-panel/user-role/edit', queryParams]);\n }\n\n deleteUserRole(userRole: UserRole): void {\n console.log('🗑️ DELETE METHOD CALLED - Deleting user role:', userRole);\n \n // Show confirmation dialog\n console.log('🔔 Showing confirmation dialog for delete');\n this.confirmationService.ask({\n title: 'Delete User Role',\n message: `Are you sure you want to delete the user role \"${userRole.syusrol_role_name}\"?\\n\\nThis action cannot be undone and will also delete all associated role rights.`,\n confirmText: 'Delete',\n cancelText: 'Cancel',\n type: 'danger'\n }).then((confirmed: boolean) => {\n console.log('🔔 Confirmation dialog result:', confirmed);\n if (confirmed) {\n console.log('🗑️ Confirmed deletion, calling service with ID:', userRole._id);\n this.loading.set(true);\n \n this.userRoleService.deleteUserRole({ syusrol_id: userRole._id || '' } as MUserRoleDeletePayload).subscribe({\n next: (response) => {\n if (response?.success) {\n console.log('✅ User role deleted successfully');\n this.notificationService.success(`User role \"${userRole.syusrol_role_name}\" has been deleted successfully.`);\n this.loadUserRoles(); // Reload the list\n } else {\n console.error('❌ Failed to delete user role');\n this.notificationService.error(response?.message || 'Failed to delete user role');\n this.loading.set(false);\n }\n },\n error: (error) => {\n console.error('❌ Error deleting user role:', error);\n this.notificationService.error('Failed to delete user role. Please try again.');\n this.loading.set(false);\n }\n });\n }\n });\n }\n\n toggleUserRoleStatus(userRole: UserRole): void {\n console.log('🔄 Toggling user role status:', userRole);\n \n const action = userRole.syusrol_isactive ? 'deactivate' : 'activate';\n const actionText = userRole.syusrol_isactive ? 'Deactivate' : 'Activate';\n \n // Show confirmation dialog\n console.log('🔔 Showing confirmation dialog for toggle status');\n this.confirmationService.ask({\n title: `${actionText} User Role`,\n message: `Are you sure you want to ${action} the user role \"${userRole.syusrol_role_name}\"?`,\n confirmText: actionText,\n cancelText: 'Cancel',\n type: 'warning'\n }).then((confirmed: boolean) => {\n console.log('🔔 Confirmation dialog result:', confirmed);\n if (confirmed) {\n console.log('🔄 Calling toggleUserRoleStatus with ID:', userRole._id);\n this.userRoleService.toggleUserRoleStatus({ syusrol_id: userRole._id || '' } as MUserRoleToggleStatusPayload).subscribe({\n next: (response) => {\n console.log('🔄 Toggle user role status response:', response);\n if (response?.success) {\n console.log('✅ User role status toggled successfully');\n this.notificationService.success(`User role \"${userRole.syusrol_role_name}\" has been ${action}d successfully.`);\n this.loadUserRoles();\n } else {\n console.error('❌ Failed to toggle user role status');\n this.notificationService.error(response?.message || 'Failed to toggle user role status');\n this.loading.set(false);\n }\n },\n error: (error) => {\n console.error('❌ Error toggling user role status:', error);\n this.notificationService.error('Failed to toggle user role status. Please try again.');\n this.loading.set(false);\n }\n });\n }\n });\n }\n\n /**\n * Get dropdown configuration\n */\n getDropdownConfig(): DropdownConfig {\n return {\n triggerIcon: 'more_vert',\n triggerSize: 'sm',\n menuPosition: 'right',\n forcePosition: 'bottom',\n offsetX: 0,\n offsetY: 4,\n usePortal: true\n };\n }\n\n /**\n * Get action dropdown items\n */\n getActionDropdownItems(userRole: UserRole): DropdownItem[] {\n console.log('🔽 Generating dropdown items for:', userRole.syusrol_role_name);\n console.log('🔽 User role data:', {\n isActive: userRole.syusrol_isactive\n });\n \n const items: DropdownItem[] = [\n {\n id: 'view',\n label: 'View Details',\n icon: 'visibility',\n iconColor: 'tw-text-gray-400',\n textColor: 'tw-text-gray-700',\n hoverBgColor: 'hover:tw-bg-gray-100'\n },\n {\n id: 'edit',\n label: 'Edit',\n icon: 'edit',\n iconColor: 'tw-text-blue-400',\n textColor: 'tw-text-blue-600',\n hoverBgColor: 'hover:tw-bg-blue-50'\n },\n {\n id: 'toggle-status',\n label: userRole.syusrol_isactive ? 'Deactivate' : 'Activate',\n icon: userRole.syusrol_isactive ? 'toggle_off' : 'toggle_on',\n iconColor: 'tw-text-gray-400',\n textColor: 'tw-text-gray-700',\n hoverBgColor: 'hover:tw-bg-gray-100'\n },\n {\n id: 'delete',\n label: 'Delete',\n icon: 'delete',\n iconColor: 'tw-text-red-400',\n textColor: 'tw-text-red-600',\n hoverBgColor: 'hover:tw-bg-red-50',\n divider: true\n }\n ];\n return items;\n }\n\n /**\n * Handle dropdown item click\n */\n onDropdownItemClick(item: DropdownItem, userRole: UserRole): void {\n console.log('🔽 Dropdown item clicked:', item.id, 'for user role:', userRole.syusrol_role_name);\n \n switch (item.id) {\n case 'view':\n this.viewUserRole(userRole);\n break;\n case 'edit':\n this.editUserRole(userRole);\n break;\n case 'toggle-status':\n this.toggleUserRoleStatus(userRole);\n break;\n case 'delete':\n this.deleteUserRole(userRole);\n break;\n default:\n console.log('❓ Unknown dropdown item clicked:', item.id);\n }\n }\n\n // Export handler\n private handleExport(format: string): void {\n console.log(`📤 Exporting user roles as ${format}`);\n // Implement export logic here\n // Could export current filtered/sorted data or all data\n }\n\n // Utility methods\n formatDate(date: string | Date): string {\n if (!date) return '-';\n return new Date(date).toLocaleDateString();\n }\n\n getStatusBadgeClass(userRole: UserRole): string {\n if (userRole.syusrol_isactive) return 'tw-bg-green-100 tw-text-green-800';\n return 'tw-bg-orange-100 tw-text-orange-800';\n }\n\n getStatusText(userRole: UserRole): string {\n if (userRole.syusrol_isactive) return 'Active';\n return 'Inactive';\n }\n\n getEntityName(entity: any): string {\n if (typeof entity === 'object' && entity?.syen_name) {\n return entity.syen_name;\n }\n return entity || 'N/A';\n }\n}\n","<!-- User Role Container -->\n<div class=\"tw-table tw-w-full tw-h-full\">\n\n <!-- Header Section with Filters -->\n <div class=\"tw-table-row tw-h-0\">\n <div class=\"tw-table-cell tw-px-4 tw-py-2 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-justify-between tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0\">\n \n <!-- Title and Back Button -->\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\n <h1 class=\"tw-text-2xl tw-font-bold tw-text-gray-900 tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon variant=\"blue\" size=\"lg\">admin_panel_settings</cide-ele-icon>\n User Role Management\n </h1>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"tw-flex tw-flex-col sm:tw-flex-row tw-items-start sm:tw-items-center tw-space-y-2 sm:tw-space-y-0 sm:tw-space-x-3\">\n <button cideEleButton variant=\"primary\" size=\"md\" leftIcon=\"add\" \n (click)=\"createUserRole()\">\n Create User Role\n </button>\n </div>\n </div>\n\n <!-- Error Message -->\n @if (error()) {\n <div class=\"tw-mt-3 tw-p-3 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\n <div class=\"tw-flex tw-items-start\">\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400 tw-w-4 tw-h-4 tw-mt-0.5 tw-flex-shrink-0\"></cide-ele-icon>\n <div class=\"tw-ml-3\">\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800 tw-m-0\">Error</h3>\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1 tw-m-0\">{{ error() }}</p>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Main Content Area -->\n <div class=\"tw-table-row\">\n <div class=\"tw-table-cell tw-h-full tw-relative\">\n \n <!-- Data Grid Component -->\n <div class=\"tw-h-full tw-overflow-auto\">\n <cide-ele-data-grid \n [config]=\"gridConfig()\" \n [templateRenderers]=\"templateRenderers()\"\n (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n </div>\n\n </div>\n </div>\n\n</div>\n\n<!-- Template Renderers -->\n<ng-template #userRoleDetailsRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col tw-w-full\">\n <div class=\"tw-font-medium tw-text-gray-900\">{{ row.syusrol_role_name || 'N/A' }}</div>\n <div class=\"tw-text-sm tw-text-gray-500 tw-truncate\">{{ row.syusrol_role_description || 'No description' }}</div>\n </div>\n</ng-template>\n\n<ng-template #entityRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-flex-col tw-text-sm\">\n <span class=\"tw-text-gray-900\">{{ getEntityName(row.syusrol_role_entity_id_syen) }}</span>\n </div>\n</ng-template>\n\n<ng-template #statusRendererTemplate let-row=\"row\">\n <div class=\"tw-flex tw-items-center tw-justify-center\">\n <!-- Active/Inactive Status Badge -->\n <span class=\"tw-inline-flex tw-items-center tw-justify-center tw-px-2.5 tw-py-0.5 tw-rounded-full tw-text-xs tw-font-medium tw-text-center\"\n [ngClass]=\"getStatusBadgeClass(row)\">\n <cide-ele-icon size=\"2xs\" class=\"tw-mr-1\">\n {{ row.syusrol_isactive ? 'check_circle' : 'cancel' }}\n </cide-ele-icon>\n {{ getStatusText(row) }}\n </span>\n </div>\n</ng-template>\n\n<ng-template #actionsDropdownRendererTemplate let-row=\"row\">\n <cide-ele-dropdown\n [items]=\"getActionDropdownItems(row)\"\n [config]=\"{ triggerIcon: 'more_vert', triggerSize: 'sm' }\"\n (itemClick)=\"onDropdownItemClick($event, row)\">\n </cide-ele-dropdown>\n</ng-template>\n"],"names":[],"mappings":";;;;;;;;;;;;MAoCa,6BAA6B,CAAA;;AAEvB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,eAAe,GAAG,MAAM,CAAC,uBAAuB,CAAC;AACjD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACxC,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACjD,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;;AAGlE,IAAA,+BAA+B,GAAG,SAAS,CAAC,QAAQ,CAA+B,iCAAiC,CAAC;AACrH,IAAA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