cloud-ide-layout 1.0.176 → 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.
- package/fesm2022/{cloud-ide-layout-cloud-ide-layout-CC-eJdik.mjs → cloud-ide-layout-cloud-ide-layout-Dmny5YH7.mjs} +108 -26
- package/fesm2022/cloud-ide-layout-cloud-ide-layout-Dmny5YH7.mjs.map +1 -0
- package/fesm2022/{cloud-ide-layout-dashboard-manager.component-asEb-RqK.mjs → cloud-ide-layout-dashboard-manager.component-VUHtS7Oq.mjs} +2 -2
- package/fesm2022/{cloud-ide-layout-dashboard-manager.component-asEb-RqK.mjs.map → cloud-ide-layout-dashboard-manager.component-VUHtS7Oq.mjs.map} +1 -1
- package/fesm2022/{cloud-ide-layout-drawer-theme.component-hlIFgjX_.mjs → cloud-ide-layout-drawer-theme.component-B08bRsuV.mjs} +2 -2
- package/fesm2022/{cloud-ide-layout-drawer-theme.component-hlIFgjX_.mjs.map → cloud-ide-layout-drawer-theme.component-B08bRsuV.mjs.map} +1 -1
- package/fesm2022/{cloud-ide-layout-home-wrapper.component-TsEnFYa4.mjs → cloud-ide-layout-home-wrapper.component-Cmq9HGPt.mjs} +2 -2
- package/fesm2022/{cloud-ide-layout-home-wrapper.component-TsEnFYa4.mjs.map → cloud-ide-layout-home-wrapper.component-Cmq9HGPt.mjs.map} +1 -1
- package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-ByfmdVwA.mjs → cloud-ide-layout-sidedrawer-notes.component-c7SI5coP.mjs} +2 -2
- package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-ByfmdVwA.mjs.map → cloud-ide-layout-sidedrawer-notes.component-c7SI5coP.mjs.map} +1 -1
- package/fesm2022/cloud-ide-layout.mjs +1 -1
- package/index.d.ts +25 -1
- package/package.json +1 -1
- package/fesm2022/cloud-ide-layout-cloud-ide-layout-CC-eJdik.mjs.map +0 -1
|
@@ -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
|
*/
|
|
@@ -2538,6 +2600,8 @@ class CideLytHeaderWrapperComponent {
|
|
|
2538
2600
|
this.currentAcademicYear.set(null);
|
|
2539
2601
|
this.currentFinancialYearName.set('FY');
|
|
2540
2602
|
this.currentAcademicYearName.set('AY');
|
|
2603
|
+
// Clear active academic year in AppStateService when entity is cleared
|
|
2604
|
+
this.appStateService.setActiveAcademicYear(null);
|
|
2541
2605
|
}
|
|
2542
2606
|
});
|
|
2543
2607
|
});
|
|
@@ -3418,8 +3482,41 @@ class CideLytHeaderWrapperComponent {
|
|
|
3418
3482
|
iconColor: 'tw-text-green-500'
|
|
3419
3483
|
};
|
|
3420
3484
|
}));
|
|
3421
|
-
//
|
|
3422
|
-
|
|
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
|
+
}
|
|
3423
3520
|
if (currentAY) {
|
|
3424
3521
|
this.currentAcademicYear.set(currentAY);
|
|
3425
3522
|
// Set display name with proper fallback
|
|
@@ -3436,23 +3533,6 @@ class CideLytHeaderWrapperComponent {
|
|
|
3436
3533
|
this.currentAcademicYearName.set('AY');
|
|
3437
3534
|
}
|
|
3438
3535
|
}
|
|
3439
|
-
else if (years.length > 0) {
|
|
3440
|
-
// If no active year, set the first one
|
|
3441
|
-
const firstYear = years[0];
|
|
3442
|
-
this.currentAcademicYear.set(firstYear);
|
|
3443
|
-
const name = firstYear.acayr_name;
|
|
3444
|
-
const fromDate = firstYear.acayr_from_date;
|
|
3445
|
-
const toDate = firstYear.acayr_to_date;
|
|
3446
|
-
if (name) {
|
|
3447
|
-
this.currentAcademicYearName.set(name);
|
|
3448
|
-
}
|
|
3449
|
-
else if (fromDate && toDate) {
|
|
3450
|
-
this.currentAcademicYearName.set(`${fromDate} - ${toDate}`);
|
|
3451
|
-
}
|
|
3452
|
-
else {
|
|
3453
|
-
this.currentAcademicYearName.set('AY');
|
|
3454
|
-
}
|
|
3455
|
-
}
|
|
3456
3536
|
}
|
|
3457
3537
|
/**
|
|
3458
3538
|
* Handle financial year dropdown item clicks
|
|
@@ -3485,6 +3565,9 @@ class CideLytHeaderWrapperComponent {
|
|
|
3485
3565
|
onAcademicYearClick(item) {
|
|
3486
3566
|
const selectedYear = this.academicYears().find(year => year._id === item.id);
|
|
3487
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);
|
|
3488
3571
|
this.currentAcademicYear.set(selectedYear);
|
|
3489
3572
|
// Set display name with proper fallback
|
|
3490
3573
|
const name = selectedYear.acayr_name;
|
|
@@ -3499,7 +3582,6 @@ class CideLytHeaderWrapperComponent {
|
|
|
3499
3582
|
else {
|
|
3500
3583
|
this.currentAcademicYearName.set('AY');
|
|
3501
3584
|
}
|
|
3502
|
-
// TODO: Update app state or notify other components about the change
|
|
3503
3585
|
}
|
|
3504
3586
|
}
|
|
3505
3587
|
/**
|
|
@@ -5282,8 +5364,8 @@ class CideLytSidedrawerWrapperComponent {
|
|
|
5282
5364
|
}
|
|
5283
5365
|
ngOnInit() {
|
|
5284
5366
|
// Initialize the component map (You'd likely populate this from a config or service)
|
|
5285
|
-
this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-
|
|
5286
|
-
this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-
|
|
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);
|
|
5287
5369
|
}
|
|
5288
5370
|
async loadComponent(configFor) {
|
|
5289
5371
|
console.log('🔍 SIDEDRAWER - Loading component:', configFor, 'Current tab:', this.currentTabId);
|
|
@@ -6975,7 +7057,7 @@ const layoutControlPannelChildRoutes = [{
|
|
|
6975
7057
|
},
|
|
6976
7058
|
{
|
|
6977
7059
|
path: "home",
|
|
6978
|
-
loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-
|
|
7060
|
+
loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-Cmq9HGPt.mjs').then(c => c.CideLytHomeWrapperComponent),
|
|
6979
7061
|
canActivate: [authGuard],
|
|
6980
7062
|
data: {
|
|
6981
7063
|
sypg_page_code: "cide_lyt_home" // Used by RequestService to fetch tab properties
|
|
@@ -6983,7 +7065,7 @@ const layoutControlPannelChildRoutes = [{
|
|
|
6983
7065
|
},
|
|
6984
7066
|
{
|
|
6985
7067
|
path: "dashboard-manager",
|
|
6986
|
-
loadComponent: () => import('./cloud-ide-layout-dashboard-manager.component-
|
|
7068
|
+
loadComponent: () => import('./cloud-ide-layout-dashboard-manager.component-VUHtS7Oq.mjs').then(c => c.DashboardManagerComponent),
|
|
6987
7069
|
canActivate: [authGuard],
|
|
6988
7070
|
data: {
|
|
6989
7071
|
sypg_page_code: "cide_lyt_dashboard_manager"
|
|
@@ -8807,4 +8889,4 @@ var floatingEntitySelection_component = /*#__PURE__*/Object.freeze({
|
|
|
8807
8889
|
*/
|
|
8808
8890
|
|
|
8809
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 };
|
|
8810
|
-
//# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-
|
|
8892
|
+
//# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-Dmny5YH7.mjs.map
|