cloud-ide-layout 1.0.175 → 1.0.178

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.
Files changed (14) hide show
  1. package/fesm2022/{cloud-ide-layout-cloud-ide-layout-D3YcbGu3.mjs → cloud-ide-layout-cloud-ide-layout-Dmny5YH7.mjs} +140 -55
  2. package/fesm2022/cloud-ide-layout-cloud-ide-layout-Dmny5YH7.mjs.map +1 -0
  3. package/fesm2022/{cloud-ide-layout-dashboard-manager.component-DFXCIHTu.mjs → cloud-ide-layout-dashboard-manager.component-VUHtS7Oq.mjs} +2 -2
  4. package/fesm2022/{cloud-ide-layout-dashboard-manager.component-DFXCIHTu.mjs.map → cloud-ide-layout-dashboard-manager.component-VUHtS7Oq.mjs.map} +1 -1
  5. package/fesm2022/{cloud-ide-layout-drawer-theme.component-DbTeiI4z.mjs → cloud-ide-layout-drawer-theme.component-B08bRsuV.mjs} +2 -2
  6. package/fesm2022/{cloud-ide-layout-drawer-theme.component-DbTeiI4z.mjs.map → cloud-ide-layout-drawer-theme.component-B08bRsuV.mjs.map} +1 -1
  7. package/fesm2022/{cloud-ide-layout-home-wrapper.component-BOua4yeS.mjs → cloud-ide-layout-home-wrapper.component-Cmq9HGPt.mjs} +2 -2
  8. package/fesm2022/{cloud-ide-layout-home-wrapper.component-BOua4yeS.mjs.map → cloud-ide-layout-home-wrapper.component-Cmq9HGPt.mjs.map} +1 -1
  9. package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-DehzWBL4.mjs → cloud-ide-layout-sidedrawer-notes.component-c7SI5coP.mjs} +2 -2
  10. package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-DehzWBL4.mjs.map → cloud-ide-layout-sidedrawer-notes.component-c7SI5coP.mjs.map} +1 -1
  11. package/fesm2022/cloud-ide-layout.mjs +1 -1
  12. package/index.d.ts +25 -1
  13. package/package.json +1 -1
  14. package/fesm2022/cloud-ide-layout-cloud-ide-layout-D3YcbGu3.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, signal, computed, effect, DestroyRef, Component, ViewChild, ElementRef, HostListener, ChangeDetectionStrategy, ComponentRef, ViewContainerRef, ViewChildren, viewChild, input, InjectionToken, PLATFORM_ID, output } from '@angular/core';
2
+ import { Injectable, inject, signal, computed, effect, DestroyRef, Component, Injector, runInInjectionContext, ViewChild, ElementRef, HostListener, ChangeDetectionStrategy, ComponentRef, ViewContainerRef, ViewChildren, viewChild, input, InjectionToken, PLATFORM_ID, output } from '@angular/core';
3
3
  import { HttpClient } from '@angular/common/http';
4
4
  import { cidePath, hostManagerRoutesUrl, coreRoutesUrl, commonRoutesUrl, designConfigRoutesUrl, generateStringFromObject } from 'cloud-ide-lms-model';
5
5
  import { BehaviorSubject, Observable, throwError, of, interval, take as take$1, firstValueFrom } from 'rxjs';
@@ -286,6 +286,8 @@ class AppStateService {
286
286
  activeModuleSignal = signal(null, ...(ngDevMode ? [{ debugName: "activeModuleSignal" }] : []));
287
287
  // Private signal for active entity
288
288
  activeEntitySignal = signal(null, ...(ngDevMode ? [{ debugName: "activeEntitySignal" }] : []));
289
+ // Private signal for active academic year
290
+ activeAcademicYearSignal = signal(null, ...(ngDevMode ? [{ debugName: "activeAcademicYearSignal" }] : []));
289
291
  // Track if entity change handler is initialized (to prevent triggering on initial load)
290
292
  entityChangeHandlerInitialized = false;
291
293
  // Callback registration for entity change handlers (to avoid circular dependencies)
@@ -296,6 +298,8 @@ class AppStateService {
296
298
  activeModule = computed(() => this.activeModuleSignal(), ...(ngDevMode ? [{ debugName: "activeModule" }] : []));
297
299
  // Public computed signal for active entity
298
300
  activeEntity = computed(() => this.activeEntitySignal(), ...(ngDevMode ? [{ debugName: "activeEntity" }] : []));
301
+ // Public computed signal for active academic year
302
+ activeAcademicYear = computed(() => this.activeAcademicYearSignal(), ...(ngDevMode ? [{ debugName: "activeAcademicYear" }] : []));
299
303
  // Computed signals for derived state
300
304
  isAuthenticated = computed(() => !!this.currentUserSignal(), ...(ngDevMode ? [{ debugName: "isAuthenticated" }] : []));
301
305
  userInfo = computed(() => {
@@ -333,10 +337,12 @@ class AppStateService {
333
337
  const currentUser = this.currentUserSignal();
334
338
  const activeModule = this.activeModuleSignal();
335
339
  const activeEntity = this.activeEntitySignal();
340
+ const activeAcademicYear = this.activeAcademicYearSignal();
336
341
  this.saveToLocalStorage({
337
342
  user: currentUser,
338
343
  activeModule: activeModule,
339
- activeEntity: activeEntity
344
+ activeEntity: activeEntity,
345
+ activeAcademicYear: activeAcademicYear
340
346
  });
341
347
  });
342
348
  // Automatically update file manager user ID whenever user changes
@@ -451,6 +457,18 @@ class AppStateService {
451
457
  getActiveEntityValue() {
452
458
  return this.activeEntitySignal();
453
459
  }
460
+ /**
461
+ * Set the active academic year
462
+ */
463
+ setActiveAcademicYear(academicYear) {
464
+ this.activeAcademicYearSignal.set(academicYear);
465
+ }
466
+ /**
467
+ * Get active academic year value (non-reactive)
468
+ */
469
+ getActiveAcademicYearValue() {
470
+ return this.activeAcademicYearSignal();
471
+ }
454
472
  /**
455
473
  * Register a callback to be called when entity changes
456
474
  * This allows other services to react to entity changes without creating circular dependencies
@@ -522,6 +540,14 @@ class AppStateService {
522
540
  localStorage.removeItem('cide_active_entity');
523
541
  }
524
542
  }
543
+ if (data.activeAcademicYear !== undefined) {
544
+ if (data.activeAcademicYear) {
545
+ localStorage.setItem('cide_active_academic_year', JSON.stringify(data.activeAcademicYear));
546
+ }
547
+ else {
548
+ localStorage.removeItem('cide_active_academic_year');
549
+ }
550
+ }
525
551
  }
526
552
  catch (error) {
527
553
  console.error('Error saving to localStorage:', error);
@@ -550,6 +576,11 @@ class AppStateService {
550
576
  const entity = JSON.parse(entityData);
551
577
  this.activeEntitySignal.set(entity);
552
578
  }
579
+ const academicYearData = localStorage.getItem('cide_active_academic_year');
580
+ if (academicYearData) {
581
+ const academicYear = JSON.parse(academicYearData);
582
+ this.activeAcademicYearSignal.set(academicYear);
583
+ }
553
584
  }
554
585
  catch (error) {
555
586
  console.error('Error loading from localStorage:', error);
@@ -558,6 +589,7 @@ class AppStateService {
558
589
  localStorage.removeItem('cide_auth_user');
559
590
  localStorage.removeItem('cide_active_module');
560
591
  localStorage.removeItem('cide_active_entity');
592
+ localStorage.removeItem('cide_active_academic_year');
561
593
  }
562
594
  }
563
595
  }
@@ -603,6 +635,16 @@ class AppStateService {
603
635
  this.activeEntitySignal.set(null);
604
636
  }
605
637
  }
638
+ // Handle active academic year changes
639
+ if (event.key === 'cide_active_academic_year') {
640
+ if (event.newValue) {
641
+ const academicYear = JSON.parse(event.newValue);
642
+ this.activeAcademicYearSignal.set(academicYear);
643
+ }
644
+ else {
645
+ this.activeAcademicYearSignal.set(null);
646
+ }
647
+ }
606
648
  }
607
649
  catch (error) {
608
650
  console.error('Error parsing localStorage update:', error);
@@ -629,6 +671,7 @@ class AppStateHelperService {
629
671
  activeModule = this.appStateService.activeModule;
630
672
  activeModuleInfo = this.appStateService.activeModuleInfo;
631
673
  activeEntity = this.appStateService.activeEntity;
674
+ activeAcademicYear = this.appStateService.activeAcademicYear;
632
675
  /**
633
676
  * Get current user value (non-reactive)
634
677
  */
@@ -824,6 +867,25 @@ class AppStateHelperService {
824
867
  const entity = this.getActiveEntity();
825
868
  return entity?.syen_entity_code || null;
826
869
  }
870
+ /**
871
+ * Set the active academic year
872
+ */
873
+ setActiveAcademicYear(academicYear) {
874
+ this.appStateService.setActiveAcademicYear(academicYear);
875
+ }
876
+ /**
877
+ * Get active academic year value (non-reactive)
878
+ */
879
+ getActiveAcademicYear() {
880
+ return this.appStateService.getActiveAcademicYearValue();
881
+ }
882
+ /**
883
+ * Get active academic year ID
884
+ */
885
+ getActiveAcademicYearId() {
886
+ const academicYear = this.getActiveAcademicYear();
887
+ return academicYear?._id || null;
888
+ }
827
889
  /**
828
890
  * Manually refresh state from localStorage
829
891
  */
@@ -2299,6 +2361,7 @@ class CideLytHeaderWrapperComponent {
2299
2361
  financialYearService = inject(FINANCIAL_YEAR_SERVICE_TOKEN);
2300
2362
  academicYearService = inject(ACADEMIC_YEAR_SERVICE_TOKEN);
2301
2363
  destroyRef = inject(DestroyRef);
2364
+ injector = inject(Injector);
2302
2365
  // Inject theme service for independent theme management
2303
2366
  themeService = inject(CideThemeService);
2304
2367
  // Signals for year data
@@ -2509,34 +2572,38 @@ class CideLytHeaderWrapperComponent {
2509
2572
  // Then try to load notifications
2510
2573
  this.initializeNotifications();
2511
2574
  // React to active entity changes - reload financial and academic years when entity changes
2512
- effect(() => {
2513
- const activeEntity = this.appStateService.activeEntity();
2514
- const currentEntityId = activeEntity?._id || null;
2515
- // Skip on initial load (when previousEntityId is null)
2516
- if (this.previousEntityId === null) {
2517
- this.previousEntityId = currentEntityId;
2518
- console.log('🏢 HEADER: Entity change handler initialized with initial entity:', currentEntityId);
2519
- return;
2520
- }
2521
- // Only reload if entity actually changed
2522
- if (this.previousEntityId !== currentEntityId && currentEntityId !== null) {
2523
- console.log('🏢 HEADER: Entity changed from', this.previousEntityId, 'to', currentEntityId, '- reloading financial and academic years');
2524
- this.previousEntityId = currentEntityId;
2525
- // Reload financial years and academic years for the new entity
2526
- this.loadFinancialYears();
2527
- this.loadAcademicYears();
2528
- }
2529
- else if (this.previousEntityId !== null && currentEntityId === null) {
2530
- // Entity was cleared
2531
- console.log('🏢 HEADER: Entity cleared');
2532
- this.previousEntityId = null;
2533
- this.financialYears.set([]);
2534
- this.academicYears.set([]);
2535
- this.currentFinancialYear.set(null);
2536
- this.currentAcademicYear.set(null);
2537
- this.currentFinancialYearName.set('FY');
2538
- this.currentAcademicYearName.set('AY');
2539
- }
2575
+ runInInjectionContext(this.injector, () => {
2576
+ effect(() => {
2577
+ const activeEntity = this.appStateService.activeEntity();
2578
+ const currentEntityId = activeEntity?._id || null;
2579
+ // Skip on initial load (when previousEntityId is null)
2580
+ if (this.previousEntityId === null) {
2581
+ this.previousEntityId = currentEntityId;
2582
+ console.log('🏢 HEADER: Entity change handler initialized with initial entity:', currentEntityId);
2583
+ return;
2584
+ }
2585
+ // Only reload if entity actually changed
2586
+ if (this.previousEntityId !== currentEntityId && currentEntityId !== null) {
2587
+ console.log('🏢 HEADER: Entity changed from', this.previousEntityId, 'to', currentEntityId, '- reloading financial and academic years');
2588
+ this.previousEntityId = currentEntityId;
2589
+ // Reload financial years and academic years for the new entity
2590
+ this.loadFinancialYears();
2591
+ this.loadAcademicYears();
2592
+ }
2593
+ else if (this.previousEntityId !== null && currentEntityId === null) {
2594
+ // Entity was cleared
2595
+ console.log('🏢 HEADER: Entity cleared');
2596
+ this.previousEntityId = null;
2597
+ this.financialYears.set([]);
2598
+ this.academicYears.set([]);
2599
+ this.currentFinancialYear.set(null);
2600
+ this.currentAcademicYear.set(null);
2601
+ this.currentFinancialYearName.set('FY');
2602
+ this.currentAcademicYearName.set('AY');
2603
+ // Clear active academic year in AppStateService when entity is cleared
2604
+ this.appStateService.setActiveAcademicYear(null);
2605
+ }
2606
+ });
2540
2607
  });
2541
2608
  }
2542
2609
  /**
@@ -3415,8 +3482,41 @@ class CideLytHeaderWrapperComponent {
3415
3482
  iconColor: 'tw-text-green-500'
3416
3483
  };
3417
3484
  }));
3418
- // Set current academic year (first active one or first in list)
3419
- const currentAY = years.find(year => year.acayr_isactive) || years[0];
3485
+ // Get active academic year from AppStateService
3486
+ let currentAY = this.appStateService.getActiveAcademicYearValue();
3487
+ // If not found in AppStateService, find and set it
3488
+ if (!currentAY) {
3489
+ // Find the first active academic year (acayr_isactive: true)
3490
+ currentAY = years.find(year => year.acayr_isactive);
3491
+ // If no active year, find one with acayr_iscurrent: true
3492
+ if (!currentAY) {
3493
+ currentAY = years.find(year => year.acayr_iscurrent === true);
3494
+ }
3495
+ // If still not found, use the first one in the list
3496
+ if (!currentAY && years.length > 0) {
3497
+ currentAY = years[0];
3498
+ }
3499
+ // Set in AppStateService if found
3500
+ if (currentAY) {
3501
+ this.appStateService.setActiveAcademicYear(currentAY);
3502
+ console.log('✅ [HEADER] Set active academic year in AppStateService:', currentAY.acayr_name, currentAY._id);
3503
+ }
3504
+ }
3505
+ else {
3506
+ // Verify the academic year from AppStateService exists in the current list
3507
+ const yearExists = years.find(year => year._id === currentAY._id);
3508
+ if (!yearExists) {
3509
+ // If the stored academic year doesn't exist in the list, find a new one
3510
+ currentAY = years.find(year => year.acayr_isactive) || years.find(year => year.acayr_iscurrent === true) || years[0];
3511
+ if (currentAY) {
3512
+ this.appStateService.setActiveAcademicYear(currentAY);
3513
+ console.log('✅ [HEADER] Updated active academic year in AppStateService (previous one not found):', currentAY.acayr_name, currentAY._id);
3514
+ }
3515
+ }
3516
+ else {
3517
+ console.log('✅ [HEADER] Using active academic year from AppStateService:', currentAY.acayr_name, currentAY._id);
3518
+ }
3519
+ }
3420
3520
  if (currentAY) {
3421
3521
  this.currentAcademicYear.set(currentAY);
3422
3522
  // Set display name with proper fallback
@@ -3433,23 +3533,6 @@ class CideLytHeaderWrapperComponent {
3433
3533
  this.currentAcademicYearName.set('AY');
3434
3534
  }
3435
3535
  }
3436
- else if (years.length > 0) {
3437
- // If no active year, set the first one
3438
- const firstYear = years[0];
3439
- this.currentAcademicYear.set(firstYear);
3440
- const name = firstYear.acayr_name;
3441
- const fromDate = firstYear.acayr_from_date;
3442
- const toDate = firstYear.acayr_to_date;
3443
- if (name) {
3444
- this.currentAcademicYearName.set(name);
3445
- }
3446
- else if (fromDate && toDate) {
3447
- this.currentAcademicYearName.set(`${fromDate} - ${toDate}`);
3448
- }
3449
- else {
3450
- this.currentAcademicYearName.set('AY');
3451
- }
3452
- }
3453
3536
  }
3454
3537
  /**
3455
3538
  * Handle financial year dropdown item clicks
@@ -3482,6 +3565,9 @@ class CideLytHeaderWrapperComponent {
3482
3565
  onAcademicYearClick(item) {
3483
3566
  const selectedYear = this.academicYears().find(year => year._id === item.id);
3484
3567
  if (selectedYear) {
3568
+ // Update AppStateService with the selected academic year
3569
+ this.appStateService.setActiveAcademicYear(selectedYear);
3570
+ console.log('✅ [HEADER] User selected academic year, updated AppStateService:', selectedYear.acayr_name, selectedYear._id);
3485
3571
  this.currentAcademicYear.set(selectedYear);
3486
3572
  // Set display name with proper fallback
3487
3573
  const name = selectedYear.acayr_name;
@@ -3496,7 +3582,6 @@ class CideLytHeaderWrapperComponent {
3496
3582
  else {
3497
3583
  this.currentAcademicYearName.set('AY');
3498
3584
  }
3499
- // TODO: Update app state or notify other components about the change
3500
3585
  }
3501
3586
  }
3502
3587
  /**
@@ -5279,8 +5364,8 @@ class CideLytSidedrawerWrapperComponent {
5279
5364
  }
5280
5365
  ngOnInit() {
5281
5366
  // Initialize the component map (You'd likely populate this from a config or service)
5282
- this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-DehzWBL4.mjs').then(m => m.CideLytSidedrawerNotesComponent);
5283
- this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-DbTeiI4z.mjs').then(m => m.CideLytDrawerThemeComponent);
5367
+ this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-c7SI5coP.mjs').then(m => m.CideLytSidedrawerNotesComponent);
5368
+ this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-B08bRsuV.mjs').then(m => m.CideLytDrawerThemeComponent);
5284
5369
  }
5285
5370
  async loadComponent(configFor) {
5286
5371
  console.log('🔍 SIDEDRAWER - Loading component:', configFor, 'Current tab:', this.currentTabId);
@@ -6972,7 +7057,7 @@ const layoutControlPannelChildRoutes = [{
6972
7057
  },
6973
7058
  {
6974
7059
  path: "home",
6975
- loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-BOua4yeS.mjs').then(c => c.CideLytHomeWrapperComponent),
7060
+ loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-Cmq9HGPt.mjs').then(c => c.CideLytHomeWrapperComponent),
6976
7061
  canActivate: [authGuard],
6977
7062
  data: {
6978
7063
  sypg_page_code: "cide_lyt_home" // Used by RequestService to fetch tab properties
@@ -6980,7 +7065,7 @@ const layoutControlPannelChildRoutes = [{
6980
7065
  },
6981
7066
  {
6982
7067
  path: "dashboard-manager",
6983
- loadComponent: () => import('./cloud-ide-layout-dashboard-manager.component-DFXCIHTu.mjs').then(c => c.DashboardManagerComponent),
7068
+ loadComponent: () => import('./cloud-ide-layout-dashboard-manager.component-VUHtS7Oq.mjs').then(c => c.DashboardManagerComponent),
6984
7069
  canActivate: [authGuard],
6985
7070
  data: {
6986
7071
  sypg_page_code: "cide_lyt_dashboard_manager"
@@ -8804,4 +8889,4 @@ var floatingEntitySelection_component = /*#__PURE__*/Object.freeze({
8804
8889
  */
8805
8890
 
8806
8891
  export { AppStateHelperService as A, CideLytSharedWrapperComponent as C, ENVIRONMENT_CONFIG as E, NotificationSettingsService as N, RightsService as R, CideLytSidebarService as a, CideLytSidedrawerService as b, CideLytThemeService as c, CloudIdeLayoutService as d, CloudIdeLayoutComponent as e, CideLytSharedService as f, ComponentContextService as g, layoutControlPannelChildRoutes as h, CustomRouteReuseStrategy as i, AppStateService as j, CideLytUserStatusService as k, layoutRoutes as l, CacheManagerService as m, CideLytFileManagerService as n, CideLytFloatingEntityRightsSharingComponent as o, processThemeVariable as p, CideLytFloatingEntityRightsSharingService as q, CideLytFloatingEntitySelectionComponent as r, setCSSVariable as s, themeFactory as t, CideLytFloatingEntitySelectionService as u };
8807
- //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-D3YcbGu3.mjs.map
8892
+ //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-Dmny5YH7.mjs.map