cloud-ide-core 2.0.170 → 2.0.172

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.
@@ -1,6 +1,6 @@
1
1
  import { authGuard, SharedObjectIdService, EDUCATION_BOARD_SERVICE_TOKEN, CideSharedOrgStructureComponent, ENTITY_SERVICE_TOKEN } from 'cloud-ide-shared';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, Component, inject, DestroyRef, viewChild, signal, computed, effect, input, output, ChangeDetectorRef, ViewChild } from '@angular/core';
3
+ import { Injectable, Component, signal, inject, DestroyRef, effect, viewChild, computed, input, output, ChangeDetectorRef, ViewChild } from '@angular/core';
4
4
  import * as i1$1 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
6
6
  import * as i1$2 from '@angular/forms';
@@ -63,7 +63,7 @@ const coreRoutes = [
63
63
  },
64
64
  {
65
65
  path: 'page-form',
66
- loadComponent: () => import('./cloud-ide-core-page-form.component-CO-opyS8.mjs').then(c => c.CideCorePageFormComponent),
66
+ loadComponent: () => import('./cloud-ide-core-page-form.component-BN-qZVPF.mjs').then(c => c.CideCorePageFormComponent),
67
67
  title: 'Page Form',
68
68
  canActivate: [authGuard],
69
69
  data: {
@@ -72,7 +72,7 @@ const coreRoutes = [
72
72
  },
73
73
  {
74
74
  path: 'page-form/:query',
75
- loadComponent: () => import('./cloud-ide-core-page-form.component-CO-opyS8.mjs').then(c => c.CideCorePageFormComponent),
75
+ loadComponent: () => import('./cloud-ide-core-page-form.component-BN-qZVPF.mjs').then(c => c.CideCorePageFormComponent),
76
76
  title: 'Page Form',
77
77
  canActivate: [authGuard],
78
78
  data: {
@@ -294,6 +294,8 @@ class MenuManagementService {
294
294
  apiUrl = `${coreRoutesUrl?.getSidebarMenues}`;
295
295
  menuListSubject = new BehaviorSubject([]);
296
296
  menuList$ = this.menuListSubject.asObservable();
297
+ /** Signal bumped on every create/update/delete/toggle so consumers can refresh. */
298
+ listInvalidated = signal(0, ...(ngDevMode ? [{ debugName: "listInvalidated" }] : []));
297
299
  constructor(http) {
298
300
  this.http = http;
299
301
  console.log('MenuManagementService initialized - using real API');
@@ -330,6 +332,7 @@ class MenuManagementService {
330
332
  .pipe(tap((response) => {
331
333
  if (response.success) {
332
334
  this.refreshMenuList();
335
+ this.listInvalidated.update(v => v + 1);
333
336
  }
334
337
  }), catchError(this.handleError));
335
338
  }
@@ -344,6 +347,7 @@ class MenuManagementService {
344
347
  .pipe(tap((response) => {
345
348
  if (response.success) {
346
349
  this.refreshMenuList();
350
+ this.listInvalidated.update(v => v + 1);
347
351
  }
348
352
  }), catchError(this.handleError));
349
353
  }
@@ -373,6 +377,7 @@ class MenuManagementService {
373
377
  .pipe(tap((response) => {
374
378
  if (response.success) {
375
379
  this.refreshMenuList();
380
+ this.listInvalidated.update(v => v + 1);
376
381
  }
377
382
  }), catchError(this.handleError));
378
383
  }
@@ -390,6 +395,7 @@ class MenuManagementService {
390
395
  .pipe(tap((response) => {
391
396
  if (response.success) {
392
397
  this.refreshMenuList();
398
+ this.listInvalidated.update(v => v + 1);
393
399
  }
394
400
  }), catchError(this.handleError));
395
401
  }
@@ -405,6 +411,7 @@ class MenuManagementService {
405
411
  .pipe(tap((response) => {
406
412
  if (response.success) {
407
413
  this.refreshMenuList();
414
+ this.listInvalidated.update(v => v + 1);
408
415
  }
409
416
  }), catchError(this.handleError));
410
417
  }
@@ -419,6 +426,7 @@ class MenuManagementService {
419
426
  .pipe(tap((response) => {
420
427
  if (response.success) {
421
428
  this.refreshMenuList();
429
+ this.listInvalidated.update(v => v + 1);
422
430
  }
423
431
  }), catchError(this.handleError));
424
432
  }
@@ -512,6 +520,8 @@ class CideCoreGeneralMasterService {
512
520
  http = inject(HttpClient);
513
521
  generalMasterListSubject = new BehaviorSubject([]);
514
522
  generalMasterList$ = this.generalMasterListSubject.asObservable();
523
+ /** Signal bumped on every create/update/delete/toggle so consumers can refresh. */
524
+ listInvalidated = signal(0, ...(ngDevMode ? [{ debugName: "listInvalidated" }] : []));
515
525
  constructor() {
516
526
  console.log('CideCoreGeneralMasterService initialized - using real API');
517
527
  }
@@ -560,6 +570,7 @@ class CideCoreGeneralMasterService {
560
570
  .pipe(tap((response) => {
561
571
  if (response.success) {
562
572
  this.refreshMasterList();
573
+ this.listInvalidated.update(v => v + 1);
563
574
  }
564
575
  }), catchError(this.handleError));
565
576
  }
@@ -599,6 +610,7 @@ class CideCoreGeneralMasterService {
599
610
  .pipe(tap((response) => {
600
611
  if (response.success) {
601
612
  this.refreshMasterList();
613
+ this.listInvalidated.update(v => v + 1);
602
614
  }
603
615
  }), catchError(this.handleError));
604
616
  }
@@ -614,6 +626,7 @@ class CideCoreGeneralMasterService {
614
626
  .pipe(tap((response) => {
615
627
  if (response.success) {
616
628
  this.refreshMasterList();
629
+ this.listInvalidated.update(v => v + 1);
617
630
  }
618
631
  }), catchError(this.handleError));
619
632
  }
@@ -686,6 +699,8 @@ class CideCoreGeneralMasterTypeService {
686
699
  http = inject(HttpClient);
687
700
  generalMasterTypeListSubject = new BehaviorSubject([]);
688
701
  generalMasterTypeList$ = this.generalMasterTypeListSubject.asObservable();
702
+ /** Signal bumped on every create/update/delete/toggle so consumers can refresh. */
703
+ listInvalidated = signal(0, ...(ngDevMode ? [{ debugName: "listInvalidated" }] : []));
689
704
  constructor() {
690
705
  console.log('CideCoreGeneralMasterTypeService initialized - using real API');
691
706
  }
@@ -733,6 +748,7 @@ class CideCoreGeneralMasterTypeService {
733
748
  .pipe(tap((response) => {
734
749
  if (response.success) {
735
750
  this.refreshTypeList();
751
+ this.listInvalidated.update(v => v + 1);
736
752
  }
737
753
  }), catchError(this.handleError));
738
754
  }
@@ -760,6 +776,7 @@ class CideCoreGeneralMasterTypeService {
760
776
  .pipe(tap((response) => {
761
777
  if (response.success) {
762
778
  this.refreshTypeList();
779
+ this.listInvalidated.update(v => v + 1);
763
780
  }
764
781
  }), catchError(this.handleError));
765
782
  }
@@ -775,6 +792,7 @@ class CideCoreGeneralMasterTypeService {
775
792
  .pipe(tap((response) => {
776
793
  if (response.success) {
777
794
  this.refreshTypeList();
795
+ this.listInvalidated.update(v => v + 1);
778
796
  }
779
797
  }), catchError(this.handleError));
780
798
  }
@@ -788,6 +806,7 @@ class CideCoreGeneralMasterTypeService {
788
806
  .pipe(tap((response) => {
789
807
  if (response.success) {
790
808
  this.refreshTypeList();
809
+ this.listInvalidated.update(v => v + 1);
791
810
  }
792
811
  }), catchError(this.handleError));
793
812
  }
@@ -983,6 +1002,18 @@ class MenuListComponent {
983
1002
  fb = inject(NonNullableFormBuilder);
984
1003
  router = inject(Router);
985
1004
  rightsService = inject(RightsService);
1005
+ /** Refetch permissions when general master list is invalidated elsewhere. */
1006
+ generalMasterInvalidationEffect = effect(() => {
1007
+ const count = this.generalMasterService.listInvalidated();
1008
+ if (count > 0 && this.userRightsTypeId()) {
1009
+ this.loadPermissions();
1010
+ }
1011
+ }, ...(ngDevMode ? [{ debugName: "generalMasterInvalidationEffect" }] : []));
1012
+ /** Refetch menu list when menu list is invalidated elsewhere (e.g. save/delete in another tab). */
1013
+ menuListInvalidationEffect = effect(() => {
1014
+ if (this.menuService.listInvalidated() > 0)
1015
+ this.loadMenuItems();
1016
+ }, ...(ngDevMode ? [{ debugName: "menuListInvalidationEffect" }] : []));
986
1017
  // Shared wrapper setup
987
1018
  shared_wrapper_setup_param = { sypg_page_code: 'core_menu_list' };
988
1019
  // Modern ViewChild signals for template renderers (Angular 20 approach)
@@ -2383,6 +2414,8 @@ class CideCoreDepartmentManagementService {
2383
2414
  http;
2384
2415
  departmentListSubject = new BehaviorSubject([]);
2385
2416
  departmentList$ = this.departmentListSubject.asObservable();
2417
+ /** Signal bumped on every create/update/delete/toggle so consumers can refresh. */
2418
+ listInvalidated = signal(0, ...(ngDevMode ? [{ debugName: "listInvalidated" }] : []));
2386
2419
  constructor(http) {
2387
2420
  this.http = http;
2388
2421
  console.log('CideCoreDepartmentManagementService initialized - using real API');
@@ -2419,6 +2452,7 @@ class CideCoreDepartmentManagementService {
2419
2452
  .pipe(tap((response) => {
2420
2453
  if (response.success) {
2421
2454
  this.refreshDepartmentList();
2455
+ this.listInvalidated.update(v => v + 1);
2422
2456
  }
2423
2457
  }), catchError(this.handleError));
2424
2458
  }
@@ -2433,6 +2467,7 @@ class CideCoreDepartmentManagementService {
2433
2467
  .pipe(tap((response) => {
2434
2468
  if (response.success) {
2435
2469
  this.refreshDepartmentList();
2470
+ this.listInvalidated.update(v => v + 1);
2436
2471
  }
2437
2472
  }), catchError(this.handleError));
2438
2473
  }
@@ -2460,6 +2495,7 @@ class CideCoreDepartmentManagementService {
2460
2495
  .pipe(tap((response) => {
2461
2496
  if (response.success) {
2462
2497
  this.refreshDepartmentList();
2498
+ this.listInvalidated.update(v => v + 1);
2463
2499
  }
2464
2500
  }), catchError(this.handleError));
2465
2501
  }
@@ -2475,6 +2511,7 @@ class CideCoreDepartmentManagementService {
2475
2511
  .pipe(tap((response) => {
2476
2512
  if (response.success) {
2477
2513
  this.refreshDepartmentList();
2514
+ this.listInvalidated.update(v => v + 1);
2478
2515
  }
2479
2516
  }), catchError(this.handleError));
2480
2517
  }
@@ -2488,6 +2525,7 @@ class CideCoreDepartmentManagementService {
2488
2525
  .pipe(tap((response) => {
2489
2526
  if (response.success) {
2490
2527
  this.refreshDepartmentList();
2528
+ this.listInvalidated.update(v => v + 1);
2491
2529
  }
2492
2530
  }), catchError(this.handleError));
2493
2531
  }
@@ -2571,6 +2609,10 @@ class CideCoreDepartmentListComponent {
2571
2609
  confirmationService = inject(ConfirmationService);
2572
2610
  notificationService = inject(NotificationService);
2573
2611
  rightsService = inject(RightsService);
2612
+ departmentListInvalidationEffect = effect(() => {
2613
+ if (this.departmentService.listInvalidated() > 0)
2614
+ this.loadDepartments();
2615
+ }, ...(ngDevMode ? [{ debugName: "departmentListInvalidationEffect" }] : []));
2574
2616
  // Modern ViewChild signals for template renderers (Angular 20 approach)
2575
2617
  departmentDetailsRendererTemplate = viewChild.required('departmentDetailsRendererTemplate');
2576
2618
  departmentStatusRendererTemplate = viewChild.required('departmentStatusRendererTemplate');
@@ -3355,6 +3397,8 @@ class CideCoreDesignationManagementService {
3355
3397
  apiUrl = `${coreRoutesUrl?.designation}`;
3356
3398
  designationListSubject = new BehaviorSubject([]);
3357
3399
  designationList$ = this.designationListSubject.asObservable();
3400
+ /** Signal bumped on every create/update/delete/toggle so consumers can refresh. */
3401
+ listInvalidated = signal(0, ...(ngDevMode ? [{ debugName: "listInvalidated" }] : []));
3358
3402
  constructor(http) {
3359
3403
  this.http = http;
3360
3404
  console.log('CideCoreDesignationManagementService initialized - using real API');
@@ -3393,6 +3437,7 @@ class CideCoreDesignationManagementService {
3393
3437
  .pipe(tap((response) => {
3394
3438
  if (response.success) {
3395
3439
  this.refreshDesignationList();
3440
+ this.listInvalidated.update(v => v + 1);
3396
3441
  }
3397
3442
  }), catchError(this.handleError));
3398
3443
  }
@@ -3409,6 +3454,7 @@ class CideCoreDesignationManagementService {
3409
3454
  .pipe(tap((response) => {
3410
3455
  if (response.success) {
3411
3456
  this.refreshDesignationList();
3457
+ this.listInvalidated.update(v => v + 1);
3412
3458
  }
3413
3459
  }), catchError(this.handleError));
3414
3460
  }
@@ -3436,6 +3482,7 @@ class CideCoreDesignationManagementService {
3436
3482
  .pipe(tap((response) => {
3437
3483
  if (response.success) {
3438
3484
  this.refreshDesignationList();
3485
+ this.listInvalidated.update(v => v + 1);
3439
3486
  }
3440
3487
  }), catchError(this.handleError));
3441
3488
  }
@@ -3451,6 +3498,7 @@ class CideCoreDesignationManagementService {
3451
3498
  .pipe(tap((response) => {
3452
3499
  if (response.success) {
3453
3500
  this.refreshDesignationList();
3501
+ this.listInvalidated.update(v => v + 1);
3454
3502
  }
3455
3503
  }), catchError(this.handleError));
3456
3504
  }
@@ -3466,6 +3514,7 @@ class CideCoreDesignationManagementService {
3466
3514
  .pipe(tap((response) => {
3467
3515
  if (response.success) {
3468
3516
  this.refreshDesignationList();
3517
+ this.listInvalidated.update(v => v + 1);
3469
3518
  }
3470
3519
  }), catchError(this.handleError));
3471
3520
  }
@@ -3544,6 +3593,8 @@ class CideCoreGradeLevelManagementService {
3544
3593
  apiUrl = `${coreRoutesUrl?.gradeLevel}`;
3545
3594
  gradeLevelListSubject = new BehaviorSubject([]);
3546
3595
  gradeLevelList$ = this.gradeLevelListSubject.asObservable();
3596
+ /** Signal bumped on every create/update/delete/toggle so consumers can refresh. */
3597
+ listInvalidated = signal(0, ...(ngDevMode ? [{ debugName: "listInvalidated" }] : []));
3547
3598
  constructor(http) {
3548
3599
  this.http = http;
3549
3600
  console.log('CideCoreGradeLevelManagementService initialized - using real API');
@@ -3580,6 +3631,7 @@ class CideCoreGradeLevelManagementService {
3580
3631
  .pipe(tap((response) => {
3581
3632
  if (response.success) {
3582
3633
  this.refreshGradeLevelList();
3634
+ this.listInvalidated.update(v => v + 1);
3583
3635
  }
3584
3636
  }), catchError(this.handleError));
3585
3637
  }
@@ -3594,6 +3646,7 @@ class CideCoreGradeLevelManagementService {
3594
3646
  .pipe(tap((response) => {
3595
3647
  if (response.success) {
3596
3648
  this.refreshGradeLevelList();
3649
+ this.listInvalidated.update(v => v + 1);
3597
3650
  }
3598
3651
  }), catchError(this.handleError));
3599
3652
  }
@@ -3619,6 +3672,7 @@ class CideCoreGradeLevelManagementService {
3619
3672
  .pipe(tap((response) => {
3620
3673
  if (response.success) {
3621
3674
  this.refreshGradeLevelList();
3675
+ this.listInvalidated.update(v => v + 1);
3622
3676
  }
3623
3677
  }), catchError(this.handleError));
3624
3678
  }
@@ -3634,6 +3688,7 @@ class CideCoreGradeLevelManagementService {
3634
3688
  .pipe(tap((response) => {
3635
3689
  if (response.success) {
3636
3690
  this.refreshGradeLevelList();
3691
+ this.listInvalidated.update(v => v + 1);
3637
3692
  }
3638
3693
  }), catchError(this.handleError));
3639
3694
  }
@@ -3649,6 +3704,7 @@ class CideCoreGradeLevelManagementService {
3649
3704
  .pipe(tap((response) => {
3650
3705
  if (response.success) {
3651
3706
  this.refreshGradeLevelList();
3707
+ this.listInvalidated.update(v => v + 1);
3652
3708
  }
3653
3709
  }), catchError(this.handleError));
3654
3710
  }
@@ -3663,6 +3719,7 @@ class CideCoreGradeLevelManagementService {
3663
3719
  .pipe(tap((response) => {
3664
3720
  if (response.success) {
3665
3721
  this.refreshGradeLevelList();
3722
+ this.listInvalidated.update(v => v + 1);
3666
3723
  }
3667
3724
  }), catchError(this.handleError));
3668
3725
  }
@@ -3730,6 +3787,18 @@ class CideCoreDesignationListComponent {
3730
3787
  notificationService = inject(NotificationService);
3731
3788
  confirmationService = inject(ConfirmationService);
3732
3789
  rightsService = inject(RightsService);
3790
+ designationListInvalidationEffect = effect(() => {
3791
+ if (this.designationService.listInvalidated() > 0)
3792
+ this.loadDesignations();
3793
+ }, ...(ngDevMode ? [{ debugName: "designationListInvalidationEffect" }] : []));
3794
+ departmentListInvalidationEffect = effect(() => {
3795
+ if (this.departmentService.listInvalidated() > 0)
3796
+ this.loadDepartments();
3797
+ }, ...(ngDevMode ? [{ debugName: "departmentListInvalidationEffect" }] : []));
3798
+ gradeLevelListInvalidationEffect = effect(() => {
3799
+ if (this.gradeLevelService.listInvalidated() > 0)
3800
+ this.loadGradeLevels();
3801
+ }, ...(ngDevMode ? [{ debugName: "gradeLevelListInvalidationEffect" }] : []));
3733
3802
  // Modern ViewChild signals for template renderers (Angular 20 approach)
3734
3803
  designationDetailsRendererTemplate = viewChild.required('designationDetailsRendererTemplate');
3735
3804
  designationStatusRendererTemplate = viewChild.required('designationStatusRendererTemplate');
@@ -5150,6 +5219,10 @@ class CideCoreGradeLevelListComponent {
5150
5219
  notificationService = inject(NotificationService);
5151
5220
  confirmationService = inject(ConfirmationService);
5152
5221
  rightsService = inject(RightsService);
5222
+ gradeLevelListInvalidationEffect = effect(() => {
5223
+ if (this.gradeLevelService.listInvalidated() > 0)
5224
+ this.loadGradeLevels();
5225
+ }, ...(ngDevMode ? [{ debugName: "gradeLevelListInvalidationEffect" }] : []));
5153
5226
  // Modern ViewChild signals for template renderers (Angular 20 approach)
5154
5227
  dragHandleRendererTemplate = viewChild.required('dragHandleRendererTemplate');
5155
5228
  gradeLevelDetailsRendererTemplate = viewChild.required('gradeLevelDetailsRendererTemplate');
@@ -9029,6 +9102,14 @@ class CideCoreGeneralMasterComponent {
9029
9102
  rightsService = inject(RightsService);
9030
9103
  notificationService = inject(NotificationService);
9031
9104
  requestService = inject(CideLytRequestService); // Injected as any to avoid build errors if type is missing
9105
+ /** Refetch masters when list is invalidated elsewhere (e.g. another tab or component). */
9106
+ listInvalidationEffect = effect(() => {
9107
+ const count = this.masterService.listInvalidated();
9108
+ if (count > 0 && this.typeId()) {
9109
+ this.loadMasters();
9110
+ this.loadParentMasterOptions();
9111
+ }
9112
+ }, ...(ngDevMode ? [{ debugName: "listInvalidationEffect" }] : []));
9032
9113
  // Modern ViewChild signals for template renderers (Angular 20 approach)
9033
9114
  masterDetailsRendererTemplate = viewChild.required('masterDetailsRendererTemplate');
9034
9115
  masterStatusRendererTemplate = viewChild.required('masterStatusRendererTemplate');
@@ -10174,6 +10255,15 @@ class CideCoreEntityCreateComponent {
10174
10255
  rightsService = inject(RightsService);
10175
10256
  requestService = inject(CideLytRequestService);
10176
10257
  educationBoardService = inject(EDUCATION_BOARD_SERVICE_TOKEN);
10258
+ /** Refetch general-master dropdowns when general master list is invalidated elsewhere. */
10259
+ generalMasterInvalidationEffect = effect(() => {
10260
+ const count = this.CideCoreGeneralMasterService.listInvalidated();
10261
+ if (count > 0) {
10262
+ this.loadDropdowns();
10263
+ this.loadBoardAffiliationStatuses();
10264
+ this.loadBoardAffiliationLevels();
10265
+ }
10266
+ }, ...(ngDevMode ? [{ debugName: "generalMasterInvalidationEffect" }] : []));
10177
10267
  destroy$ = new Subject();
10178
10268
  // Board Mapping
10179
10269
  boardAffiliations = signal([], ...(ngDevMode ? [{ debugName: "boardAffiliations" }] : []));
@@ -11598,6 +11688,13 @@ class CideCoreEntityListComponent {
11598
11688
  appState = inject(AppStateHelperService);
11599
11689
  rightsService = inject(RightsService);
11600
11690
  destroyRef = inject(DestroyRef);
11691
+ /** Refetch entity types when general master list is invalidated elsewhere (e.g. after add/update/delete). */
11692
+ generalMasterInvalidationEffect = effect(() => {
11693
+ const count = this.generalMasterService.listInvalidated();
11694
+ if (count > 0) {
11695
+ this.loadEntityTypes();
11696
+ }
11697
+ }, ...(ngDevMode ? [{ debugName: "generalMasterInvalidationEffect" }] : []));
11601
11698
  // ViewChild reference to the grid component using modern signal approach
11602
11699
  gridComponent = viewChild(CideEleDataGridComponent, ...(ngDevMode ? [{ debugName: "gridComponent" }] : []));
11603
11700
  // Template references using modern viewChild signal approach with proper typing
@@ -11710,7 +11807,8 @@ class CideCoreEntityListComponent {
11710
11807
  childrenKey: 'children',
11711
11808
  levelKey: 'level',
11712
11809
  expandedKey: 'isExpanded',
11713
- hasChildrenKey: 'hasChildren'
11810
+ hasChildrenKey: 'hasChildren',
11811
+ defaultExpandAll: true
11714
11812
  }
11715
11813
  }, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
11716
11814
  // Template renderers for complex columns using computed signal
@@ -11956,8 +12054,9 @@ class CideCoreEntityListComponent {
11956
12054
  }
11957
12055
  onEntitySearch(query) {
11958
12056
  console.log('Search entities:', query);
11959
- this.searchQuery.set(query);
11960
- // The grid handles the actual filtering
12057
+ this.searchQuery.set(query ?? '');
12058
+ this.currentPage.set(1);
12059
+ this.loadEntities(false);
11961
12060
  }
11962
12061
  onEntityPageChange(pageOrPayload) {
11963
12062
  const payload = pageOrPayload;
@@ -11971,7 +12070,6 @@ class CideCoreEntityListComponent {
11971
12070
  const page = typeof pageOrPayload === 'number' ? pageOrPayload : (payload?.page ?? 1);
11972
12071
  console.log('Page changed to:', page);
11973
12072
  this.currentPage.set(page);
11974
- // Reload data for the new page
11975
12073
  this.loadEntities(false);
11976
12074
  }
11977
12075
  onDeleteEntityConfirmed(entityId) {
@@ -12019,26 +12117,27 @@ class CideCoreEntityListComponent {
12019
12117
  }
12020
12118
  this.error.set(null);
12021
12119
  this.loadStartTime = Date.now();
12022
- this.entityService.getEntityList({}).subscribe({
12120
+ const payload = {
12121
+ pageIndex: this.currentPage(),
12122
+ pageSize: this.pageSize(),
12123
+ ...(this.searchQuery()?.trim() ? { query: this.searchQuery().trim() } : {})
12124
+ };
12125
+ this.entityService.getEntityList(payload).subscribe({
12023
12126
  next: (response) => {
12024
12127
  console.log('✅ ENTITY LIST: API response received:', response);
12025
- // Process the response data
12026
- if (response?.data) {
12027
- // Handle both array and single object responses
12028
- const entitiesData = Array.isArray(response.data) ? response.data : [response.data];
12029
- console.log('📋 ENTITY LIST: Processed entities data:', entitiesData.length, 'entities');
12030
- if (entitiesData.length > 0) {
12031
- console.log('📊 ENTITY LIST: First entity sample:', entitiesData[0]);
12032
- this.updateGridData(entitiesData);
12033
- this.totalItems.set(entitiesData.length);
12034
- }
12035
- else {
12036
- console.log('📊 ENTITY LIST: No entities returned, showing test data');
12037
- }
12038
- }
12039
- else {
12040
- console.warn('⚠️ ENTITY LIST: No data in API response, loading test data');
12041
- }
12128
+ const entitiesData = response?.data
12129
+ ? (Array.isArray(response.data) ? response.data : [response.data])
12130
+ : [];
12131
+ // Parse total robustly: API may return number or string (e.g. "13"); avoid using data length so pagination is correct
12132
+ const rawTotal = response?.total;
12133
+ const total = typeof rawTotal === 'number' && Number.isFinite(rawTotal)
12134
+ ? rawTotal
12135
+ : typeof rawTotal === 'string'
12136
+ ? parseInt(rawTotal, 10)
12137
+ : Number(rawTotal);
12138
+ const totalResolved = Number.isFinite(total) ? total : entitiesData.length;
12139
+ this.totalItems.set(totalResolved);
12140
+ this.updateGridData(entitiesData);
12042
12141
  this.updatePaginationState();
12043
12142
  this.loading.set(false);
12044
12143
  // Clear page change loading state in the grid component
@@ -12248,7 +12347,7 @@ class CideCoreEntityListComponent {
12248
12347
  this.router.navigate(['/control-panel/org-structure']);
12249
12348
  }
12250
12349
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CideCoreEntityListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12251
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CideCoreEntityListComponent, isStandalone: true, selector: "cide-core-entity-list", viewQueries: [{ propertyName: "gridComponent", first: true, predicate: CideEleDataGridComponent, descendants: true, isSignal: true }, { propertyName: "entityDetailsRenderer", first: true, predicate: ["entityDetailsRenderer"], descendants: true, isSignal: true }, { propertyName: "entityTypeRenderer", first: true, predicate: ["entityTypeRenderer"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRenderer", first: true, predicate: ["actionsDropdownRenderer"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Entity List with Shared Wrapper -->\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'core_entity_list' }\">\n <!-- Breadcrumb Actions: Org Structure Button -->\n <div breadcrumb-actions class=\"tw-flex tw-justify-end tw-items-center tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"xs\" (click)=\"onOrgStructure()\" [adaptive]=\"true\"\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">account_tree</cide-ele-icon>\n Org Structure\n </button>\n\n <!-- Add Entity Button -->\n @if (canCreate()) {\n <button cideEleButton variant=\"primary\" size=\"xs\" (click)=\"router.navigate(['control-panel', 'entity-create'])\"\n [adaptive]=\"true\" class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">add</cide-ele-icon>\n Add Entity\n </button>\n }\n\n </div>\n\n <div class=\"entity-list-container tw-bg-white tw-shadow-lg tw-rounded-lg tw-overflow-hidden\">\n\n <!-- Data Grid Component -->\n <cide-ele-data-grid [config]=\"gridConfig()\" [templateRenderers]=\"templateRenderers()\"\n [actionHandlers]=\"actionHandlers\" (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n\n </div>\n\n <!-- Custom Renderer Templates -->\n\n <!-- Entity Details Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityDetailsRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div\n class=\"tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-full tw-flex tw-items-center tw-justify-center\">\n <span class=\"tw-text-blue-600 tw-font-semibold tw-text-sm\">\n {{ (entity.syen_entity_code || 'NA').substring(0, 2).toUpperCase() }}\n </span>\n </div>\n <div class=\"tw-flex-1 tw-min-w-0\">\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\"\n [title]=\"entity.syen_name || 'Unknown Entity'\">\n {{ entity.syen_name || 'Unknown Entity' }}\n </p>\n <p class=\"tw-text-sm tw-text-gray-500 tw-truncate\" [title]=\"entity.syen_entity_code || 'N/A'\">\n Code: {{ entity.syen_entity_code || 'N/A' }}\n </p>\n </div>\n </div>\n </ng-template>\n\n\n <!-- Entity Type Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityTypeRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-flex-col tw-items-center tw-space-y-1\">\n <span class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"getEntityTypeName(entity)\">\n {{ getEntityTypeName(entity) }}\n </span>\n </div>\n </ng-template>\n\n <!-- Actions Dropdown Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #actionsDropdownRenderer let-value=\"value\" let-entity=\"row\">\n <cide-ele-dropdown [items]=\"getDropdownItems(entity)\" [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, entity)\">\n </cide-ele-dropdown>\n </ng-template>\n</cide-lyt-shared-wrapper>", styles: ["", ":host{height:100%;display:flex;flex-direction:column}.entity-list-container{height:100%;display:flex;flex-direction:column;overflow:hidden}.tw-overflow-auto{flex:1;min-height:0}cide-ele-data-grid{flex:1;min-height:0;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip", "active", "name"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton], cide-ele-button", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated", "adaptive"], 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"] }, { kind: "component", type: CideLytSharedWrapperComponent, selector: "cide-lyt-shared-wrapper", inputs: ["shared_wrapper_setup_param", "breadcrumb_data"] }] });
12350
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CideCoreEntityListComponent, isStandalone: true, selector: "cide-core-entity-list", viewQueries: [{ propertyName: "gridComponent", first: true, predicate: CideEleDataGridComponent, descendants: true, isSignal: true }, { propertyName: "entityDetailsRenderer", first: true, predicate: ["entityDetailsRenderer"], descendants: true, isSignal: true }, { propertyName: "entityTypeRenderer", first: true, predicate: ["entityTypeRenderer"], descendants: true, isSignal: true }, { propertyName: "actionsDropdownRenderer", first: true, predicate: ["actionsDropdownRenderer"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Entity List with Shared Wrapper -->\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'core_entity_list' }\">\n <!-- Breadcrumb Actions: Org Structure Button -->\n <div breadcrumb-actions class=\"tw-flex tw-justify-end tw-items-center tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"xs\" (click)=\"onOrgStructure()\" [adaptive]=\"true\"\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">account_tree</cide-ele-icon>\n Org Structure\n </button>\n\n <!-- Add Entity Button -->\n @if (canCreate()) {\n <button cideEleButton variant=\"primary\" size=\"xs\" (click)=\"router.navigate(['control-panel', 'entity-create'])\"\n [adaptive]=\"true\" class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">add</cide-ele-icon>\n Add Entity\n </button>\n }\n\n </div>\n\n <div class=\"entity-list-container tw-bg-white tw-shadow-lg tw-rounded-lg tw-overflow-hidden\">\n\n <!-- Data Grid Component - API-side pagination: one request per page/size/search -->\n <cide-ele-data-grid [config]=\"gridConfig()\" [templateRenderers]=\"templateRenderers()\"\n [actionHandlers]=\"actionHandlers\" [serverSidePagination]=\"true\"\n [totalServerItems]=\"totalItems()\" [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n\n </div>\n\n <!-- Custom Renderer Templates -->\n\n <!-- Entity Details Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityDetailsRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div\n class=\"tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-full tw-flex tw-items-center tw-justify-center\">\n <span class=\"tw-text-blue-600 tw-font-semibold tw-text-sm\">\n {{ (entity.syen_entity_code || 'NA').substring(0, 2).toUpperCase() }}\n </span>\n </div>\n <div class=\"tw-flex-1 tw-min-w-0\">\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\"\n [title]=\"entity.syen_name || 'Unknown Entity'\">\n {{ entity.syen_name || 'Unknown Entity' }}\n </p>\n <p class=\"tw-text-sm tw-text-gray-500 tw-truncate\" [title]=\"entity.syen_entity_code || 'N/A'\">\n Code: {{ entity.syen_entity_code || 'N/A' }}\n </p>\n </div>\n </div>\n </ng-template>\n\n\n <!-- Entity Type Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityTypeRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-flex-col tw-items-center tw-space-y-1\">\n <span class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"getEntityTypeName(entity)\">\n {{ getEntityTypeName(entity) }}\n </span>\n </div>\n </ng-template>\n\n <!-- Actions Dropdown Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #actionsDropdownRenderer let-value=\"value\" let-entity=\"row\">\n <cide-ele-dropdown [items]=\"getDropdownItems(entity)\" [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, entity)\">\n </cide-ele-dropdown>\n </ng-template>\n</cide-lyt-shared-wrapper>", styles: ["", ":host{height:100%;display:flex;flex-direction:column}.entity-list-container{height:100%;display:flex;flex-direction:column;overflow:hidden}.tw-overflow-auto{flex:1;min-height:0}cide-ele-data-grid{flex:1;min-height:0;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip", "active", "name"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton], cide-ele-button", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated", "adaptive"], 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"] }, { kind: "component", type: CideLytSharedWrapperComponent, selector: "cide-lyt-shared-wrapper", inputs: ["shared_wrapper_setup_param", "breadcrumb_data"] }] });
12252
12351
  }
12253
12352
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CideCoreEntityListComponent, decorators: [{
12254
12353
  type: Component,
@@ -12260,7 +12359,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
12260
12359
  CideEleDataGridComponent,
12261
12360
  CideEleDropdownComponent,
12262
12361
  CideLytSharedWrapperComponent
12263
- ], template: "<!-- Entity List with Shared Wrapper -->\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'core_entity_list' }\">\n <!-- Breadcrumb Actions: Org Structure Button -->\n <div breadcrumb-actions class=\"tw-flex tw-justify-end tw-items-center tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"xs\" (click)=\"onOrgStructure()\" [adaptive]=\"true\"\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">account_tree</cide-ele-icon>\n Org Structure\n </button>\n\n <!-- Add Entity Button -->\n @if (canCreate()) {\n <button cideEleButton variant=\"primary\" size=\"xs\" (click)=\"router.navigate(['control-panel', 'entity-create'])\"\n [adaptive]=\"true\" class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">add</cide-ele-icon>\n Add Entity\n </button>\n }\n\n </div>\n\n <div class=\"entity-list-container tw-bg-white tw-shadow-lg tw-rounded-lg tw-overflow-hidden\">\n\n <!-- Data Grid Component -->\n <cide-ele-data-grid [config]=\"gridConfig()\" [templateRenderers]=\"templateRenderers()\"\n [actionHandlers]=\"actionHandlers\" (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n\n </div>\n\n <!-- Custom Renderer Templates -->\n\n <!-- Entity Details Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityDetailsRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div\n class=\"tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-full tw-flex tw-items-center tw-justify-center\">\n <span class=\"tw-text-blue-600 tw-font-semibold tw-text-sm\">\n {{ (entity.syen_entity_code || 'NA').substring(0, 2).toUpperCase() }}\n </span>\n </div>\n <div class=\"tw-flex-1 tw-min-w-0\">\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\"\n [title]=\"entity.syen_name || 'Unknown Entity'\">\n {{ entity.syen_name || 'Unknown Entity' }}\n </p>\n <p class=\"tw-text-sm tw-text-gray-500 tw-truncate\" [title]=\"entity.syen_entity_code || 'N/A'\">\n Code: {{ entity.syen_entity_code || 'N/A' }}\n </p>\n </div>\n </div>\n </ng-template>\n\n\n <!-- Entity Type Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityTypeRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-flex-col tw-items-center tw-space-y-1\">\n <span class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"getEntityTypeName(entity)\">\n {{ getEntityTypeName(entity) }}\n </span>\n </div>\n </ng-template>\n\n <!-- Actions Dropdown Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #actionsDropdownRenderer let-value=\"value\" let-entity=\"row\">\n <cide-ele-dropdown [items]=\"getDropdownItems(entity)\" [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, entity)\">\n </cide-ele-dropdown>\n </ng-template>\n</cide-lyt-shared-wrapper>", styles: [":host{height:100%;display:flex;flex-direction:column}.entity-list-container{height:100%;display:flex;flex-direction:column;overflow:hidden}.tw-overflow-auto{flex:1;min-height:0}cide-ele-data-grid{flex:1;min-height:0;display:flex;flex-direction:column}\n"] }]
12362
+ ], template: "<!-- Entity List with Shared Wrapper -->\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'core_entity_list' }\">\n <!-- Breadcrumb Actions: Org Structure Button -->\n <div breadcrumb-actions class=\"tw-flex tw-justify-end tw-items-center tw-gap-2\">\n <button cideEleButton variant=\"secondary\" size=\"xs\" (click)=\"onOrgStructure()\" [adaptive]=\"true\"\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">account_tree</cide-ele-icon>\n Org Structure\n </button>\n\n <!-- Add Entity Button -->\n @if (canCreate()) {\n <button cideEleButton variant=\"primary\" size=\"xs\" (click)=\"router.navigate(['control-panel', 'entity-create'])\"\n [adaptive]=\"true\" class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">add</cide-ele-icon>\n Add Entity\n </button>\n }\n\n </div>\n\n <div class=\"entity-list-container tw-bg-white tw-shadow-lg tw-rounded-lg tw-overflow-hidden\">\n\n <!-- Data Grid Component - API-side pagination: one request per page/size/search -->\n <cide-ele-data-grid [config]=\"gridConfig()\" [templateRenderers]=\"templateRenderers()\"\n [actionHandlers]=\"actionHandlers\" [serverSidePagination]=\"true\"\n [totalServerItems]=\"totalItems()\" [currentServerPage]=\"currentPage()\"\n [currentServerPageSize]=\"pageSize()\" (gridEvent)=\"onGridEvent($event)\">\n </cide-ele-data-grid>\n\n </div>\n\n <!-- Custom Renderer Templates -->\n\n <!-- Entity Details Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityDetailsRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\n <div\n class=\"tw-flex-shrink-0 tw-w-10 tw-h-10 tw-bg-blue-100 tw-rounded-full tw-flex tw-items-center tw-justify-center\">\n <span class=\"tw-text-blue-600 tw-font-semibold tw-text-sm\">\n {{ (entity.syen_entity_code || 'NA').substring(0, 2).toUpperCase() }}\n </span>\n </div>\n <div class=\"tw-flex-1 tw-min-w-0\">\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\"\n [title]=\"entity.syen_name || 'Unknown Entity'\">\n {{ entity.syen_name || 'Unknown Entity' }}\n </p>\n <p class=\"tw-text-sm tw-text-gray-500 tw-truncate\" [title]=\"entity.syen_entity_code || 'N/A'\">\n Code: {{ entity.syen_entity_code || 'N/A' }}\n </p>\n </div>\n </div>\n </ng-template>\n\n\n <!-- Entity Type Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #entityTypeRenderer let-value=\"value\" let-entity=\"row\">\n <div class=\"tw-flex tw-flex-col tw-items-center tw-space-y-1\">\n <span class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-truncate\" [title]=\"getEntityTypeName(entity)\">\n {{ getEntityTypeName(entity) }}\n </span>\n </div>\n </ng-template>\n\n <!-- Actions Dropdown Renderer Template -->\n <!-- Context: { $implicit: unknown, row: entityResponseData, value: unknown, column: GridColumn } -->\n <ng-template #actionsDropdownRenderer let-value=\"value\" let-entity=\"row\">\n <cide-ele-dropdown [items]=\"getDropdownItems(entity)\" [config]=\"getDropdownConfig()\"\n (itemClick)=\"onDropdownItemClick($event, entity)\">\n </cide-ele-dropdown>\n </ng-template>\n</cide-lyt-shared-wrapper>", styles: [":host{height:100%;display:flex;flex-direction:column}.entity-list-container{height:100%;display:flex;flex-direction:column;overflow:hidden}.tw-overflow-auto{flex:1;min-height:0}cide-ele-data-grid{flex:1;min-height:0;display:flex;flex-direction:column}\n"] }]
12264
12363
  }], propDecorators: { gridComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CideEleDataGridComponent), { isSignal: true }] }], entityDetailsRenderer: [{ type: i0.ViewChild, args: ['entityDetailsRenderer', { isSignal: true }] }], entityTypeRenderer: [{ type: i0.ViewChild, args: ['entityTypeRenderer', { isSignal: true }] }], actionsDropdownRenderer: [{ type: i0.ViewChild, args: ['actionsDropdownRenderer', { isSignal: true }] }] } });
12265
12364
 
12266
12365
  var entityList_component = /*#__PURE__*/Object.freeze({
@@ -12269,10 +12368,9 @@ var entityList_component = /*#__PURE__*/Object.freeze({
12269
12368
  });
12270
12369
 
12271
12370
  class CideCoreOrgStructureComponent {
12272
- // Input parameters for configuration
12273
- allowSwitching = input(true, ...(ngDevMode ? [{ debugName: "allowSwitching" }] : [])); // Allow entity switching (default: true)
12274
- showActions = input(true, ...(ngDevMode ? [{ debugName: "showActions" }] : [])); // Show action buttons (default: true)
12275
- mode = input('view', ...(ngDevMode ? [{ debugName: "mode" }] : [])); // Mode: selection or view-only
12371
+ allowSwitching = input(true, ...(ngDevMode ? [{ debugName: "allowSwitching" }] : []));
12372
+ showActions = input(true, ...(ngDevMode ? [{ debugName: "showActions" }] : []));
12373
+ mode = input('view', ...(ngDevMode ? [{ debugName: "mode" }] : []));
12276
12374
  // Output events
12277
12375
  entityClick = output(); // Emit when entity is clicked
12278
12376
  entitySelect = output(); // Emit when entity is selected for switching
@@ -12309,22 +12407,23 @@ class CideCoreOrgStructureComponent {
12309
12407
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CideCoreOrgStructureComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12310
12408
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: CideCoreOrgStructureComponent, isStandalone: true, selector: "cide-core-org-structure", inputs: { allowSwitching: { classPropertyName: "allowSwitching", publicName: "allowSwitching", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { entityClick: "entityClick", entitySelect: "entitySelect", entityView: "entityView" }, ngImport: i0, template: `
12311
12409
  <cide-lyt-shared-wrapper [shared_wrapper_setup_param]="{ sypg_page_code: 'org_structure' }">
12312
-
12313
- <!-- Back Button using standard content projection -->
12314
- <div breadcrumb-actions>
12315
- <button
12316
- cideEleButton
12317
- variant="outline"
12318
- size="xs"
12319
- (click)="onBack()"
12320
- class="tw-whitespace-nowrap tw-flex tw-items-center">
12410
+ <div breadcrumb-actions class="tw-flex tw-items-center tw-gap-2">
12411
+ <button cideEleButton variant="outline" size="xs" (click)="onBack()" class="tw-whitespace-nowrap tw-flex tw-items-center">
12321
12412
  <cide-ele-icon size="xs" class="tw-w-6 tw-h-5">arrow_back</cide-ele-icon>
12322
12413
  Back to Entities
12323
12414
  </button>
12415
+ <button cideEleButton variant="outline" size="xs" (click)="orgStructureRef.expandAll()" class="tw-whitespace-nowrap tw-flex tw-items-center">
12416
+ <cide-ele-icon size="xs" class="tw-w-6 tw-h-5">unfold_more</cide-ele-icon>
12417
+ Expand all
12418
+ </button>
12419
+ <button cideEleButton variant="outline" size="xs" (click)="orgStructureRef.collapseAll()" class="tw-whitespace-nowrap tw-flex tw-items-center">
12420
+ <cide-ele-icon size="xs" class="tw-w-6 tw-h-5">unfold_less</cide-ele-icon>
12421
+ Collapse all
12422
+ </button>
12324
12423
  </div>
12325
12424
 
12326
- <!-- Shared Org Structure Component -->
12327
12425
  <cide-shared-org-structure
12426
+ #orgStructureRef
12328
12427
  [allowSwitching]="allowSwitching()"
12329
12428
  [showActions]="showActions()"
12330
12429
  [mode]="mode()"
@@ -12345,22 +12444,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
12345
12444
  CideLytSharedWrapperComponent
12346
12445
  ], template: `
12347
12446
  <cide-lyt-shared-wrapper [shared_wrapper_setup_param]="{ sypg_page_code: 'org_structure' }">
12348
-
12349
- <!-- Back Button using standard content projection -->
12350
- <div breadcrumb-actions>
12351
- <button
12352
- cideEleButton
12353
- variant="outline"
12354
- size="xs"
12355
- (click)="onBack()"
12356
- class="tw-whitespace-nowrap tw-flex tw-items-center">
12447
+ <div breadcrumb-actions class="tw-flex tw-items-center tw-gap-2">
12448
+ <button cideEleButton variant="outline" size="xs" (click)="onBack()" class="tw-whitespace-nowrap tw-flex tw-items-center">
12357
12449
  <cide-ele-icon size="xs" class="tw-w-6 tw-h-5">arrow_back</cide-ele-icon>
12358
12450
  Back to Entities
12359
12451
  </button>
12452
+ <button cideEleButton variant="outline" size="xs" (click)="orgStructureRef.expandAll()" class="tw-whitespace-nowrap tw-flex tw-items-center">
12453
+ <cide-ele-icon size="xs" class="tw-w-6 tw-h-5">unfold_more</cide-ele-icon>
12454
+ Expand all
12455
+ </button>
12456
+ <button cideEleButton variant="outline" size="xs" (click)="orgStructureRef.collapseAll()" class="tw-whitespace-nowrap tw-flex tw-items-center">
12457
+ <cide-ele-icon size="xs" class="tw-w-6 tw-h-5">unfold_less</cide-ele-icon>
12458
+ Collapse all
12459
+ </button>
12360
12460
  </div>
12361
12461
 
12362
- <!-- Shared Org Structure Component -->
12363
12462
  <cide-shared-org-structure
12463
+ #orgStructureRef
12364
12464
  [allowSwitching]="allowSwitching()"
12365
12465
  [showActions]="showActions()"
12366
12466
  [mode]="mode()"
@@ -13244,6 +13344,52 @@ class CideCoreUserCreateComponent {
13244
13344
  console.log('🔐 Rights already initialized for page code:', currentPageCode);
13245
13345
  }
13246
13346
  });
13347
+ // Refetch GM-backed dropdowns when general master list is invalidated elsewhere
13348
+ effect(() => {
13349
+ if (this.CideCoreGeneralMasterService.listInvalidated() > 0)
13350
+ this.loadDropdownOptions();
13351
+ });
13352
+ // Refetch menu dropdown when menu list is invalidated elsewhere
13353
+ effect(() => {
13354
+ if (this.menuService.listInvalidated() > 0)
13355
+ this.loadMenuOptions();
13356
+ });
13357
+ // Refetch department dropdowns when department list is invalidated elsewhere
13358
+ effect(() => {
13359
+ if (this.departmentService.listInvalidated() > 0) {
13360
+ this.departmentOptions.set({});
13361
+ const arr = this.entityMappingsFormArray;
13362
+ for (let i = 0; i < arr.length; i++) {
13363
+ const mappingGroup = arr.at(i);
13364
+ const entityValue = mappingGroup.get('syenm_entity_id_syen')?.value;
13365
+ const entityId = entityValue == null ? '' : (typeof entityValue === 'string' ? entityValue : entityValue._id || '');
13366
+ if (entityId)
13367
+ this.loadDepartmentsForEntity(i, entityId);
13368
+ }
13369
+ }
13370
+ });
13371
+ // Refetch designation dropdowns when designation list is invalidated elsewhere
13372
+ effect(() => {
13373
+ if (this.designationService.listInvalidated() > 0) {
13374
+ this.designationOptions.set({});
13375
+ const arr = this.entityMappingsFormArray;
13376
+ for (let i = 0; i < arr.length; i++) {
13377
+ const mappingGroup = arr.at(i);
13378
+ const deptValue = mappingGroup.get('syenm_department_id_sydept')?.value;
13379
+ const departmentId = deptValue == null ? '' : (typeof deptValue === 'string' ? deptValue : deptValue._id || '');
13380
+ if (!departmentId)
13381
+ continue;
13382
+ this.designationService.getDesignationList({ sydsg_department_id_sydpt: departmentId }).subscribe({
13383
+ next: (response) => {
13384
+ if (response?.success) {
13385
+ this.designationOptions.update(map => ({ ...map, [departmentId]: response.data || [] }));
13386
+ }
13387
+ },
13388
+ error: (err) => console.error('Error loading designations on invalidation:', err)
13389
+ });
13390
+ }
13391
+ }
13392
+ });
13247
13393
  }
13248
13394
  // FormArray getter for entity mappings
13249
13395
  get entityMappingsFormArray() {
@@ -21505,6 +21651,13 @@ class CideCoreUserRoleFormComponent {
21505
21651
  generalMasterService = inject(CideCoreGeneralMasterService);
21506
21652
  generalMasterTypeService = inject(CideCoreGeneralMasterTypeService);
21507
21653
  floatingContainerService = inject(CideEleFloatingContainerService);
21654
+ /** Refetch permissions when general master list is invalidated elsewhere. */
21655
+ generalMasterInvalidationEffect = effect(() => {
21656
+ const count = this.generalMasterService.listInvalidated();
21657
+ if (count > 0 && this.userRightsTypeId()) {
21658
+ this.loadPermissions();
21659
+ }
21660
+ }, ...(ngDevMode ? [{ debugName: "generalMasterInvalidationEffect" }] : []));
21508
21661
  router = inject(Router);
21509
21662
  route = inject(ActivatedRoute);
21510
21663
  appState = inject(AppStateHelperService);