cloud-ide-academics 0.0.57 → 0.0.63

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 (18) hide show
  1. package/fesm2022/{cloud-ide-academics-bonafide-request-form.component-CM35A1Ex.mjs → cloud-ide-academics-bonafide-request-form.component-DIBzUNbF.mjs} +2 -2
  2. package/fesm2022/{cloud-ide-academics-bonafide-request-form.component-CM35A1Ex.mjs.map → cloud-ide-academics-bonafide-request-form.component-DIBzUNbF.mjs.map} +1 -1
  3. package/fesm2022/{cloud-ide-academics-class-program-term-create.component-Bw-I_FfZ.mjs → cloud-ide-academics-class-program-term-create.component-A5Ed_CAc.mjs} +2 -2
  4. package/fesm2022/{cloud-ide-academics-class-program-term-create.component-Bw-I_FfZ.mjs.map → cloud-ide-academics-class-program-term-create.component-A5Ed_CAc.mjs.map} +1 -1
  5. package/fesm2022/{cloud-ide-academics-class-program-term-list.component-DMUqLvyZ.mjs → cloud-ide-academics-class-program-term-list.component-BWQ4BI9Z.mjs} +2 -2
  6. package/fesm2022/{cloud-ide-academics-class-program-term-list.component-DMUqLvyZ.mjs.map → cloud-ide-academics-class-program-term-list.component-BWQ4BI9Z.mjs.map} +1 -1
  7. package/fesm2022/{cloud-ide-academics-cloud-ide-academics-C1qeVY8_.mjs → cloud-ide-academics-cloud-ide-academics-BRQerudY.mjs} +191 -33
  8. package/fesm2022/cloud-ide-academics-cloud-ide-academics-BRQerudY.mjs.map +1 -0
  9. package/fesm2022/{cloud-ide-academics-program-class-create.component-C2VZz6x-.mjs → cloud-ide-academics-program-class-create.component-Bd6yGQ3X.mjs} +13 -9
  10. package/fesm2022/cloud-ide-academics-program-class-create.component-Bd6yGQ3X.mjs.map +1 -0
  11. package/fesm2022/{cloud-ide-academics-program-class-list.component-C333Jax-.mjs → cloud-ide-academics-program-class-list.component-D591YMJ3.mjs} +3 -147
  12. package/fesm2022/cloud-ide-academics-program-class-list.component-D591YMJ3.mjs.map +1 -0
  13. package/fesm2022/cloud-ide-academics.mjs +1 -1
  14. package/index.d.ts +21 -11
  15. package/package.json +1 -1
  16. package/fesm2022/cloud-ide-academics-cloud-ide-academics-C1qeVY8_.mjs.map +0 -1
  17. package/fesm2022/cloud-ide-academics-program-class-create.component-C2VZz6x-.mjs.map +0 -1
  18. package/fesm2022/cloud-ide-academics-program-class-list.component-C333Jax-.mjs.map +0 -1
@@ -7,7 +7,7 @@ import * as i1 from '@angular/forms';
7
7
  import { FormBuilder, ReactiveFormsModule, FormsModule, Validators } from '@angular/forms';
8
8
  import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
9
9
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
- import { of, forkJoin, filter as filter$1 } from 'rxjs';
10
+ import { of, forkJoin, map as map$1, catchError as catchError$1, filter as filter$1 } from 'rxjs';
11
11
  import { switchMap, catchError, map, filter } from 'rxjs/operators';
12
12
  import { NotificationService, CideInputComponent, CideTextareaComponent, CideEleButtonComponent, CideEleTabComponent, CideIconComponent, CideSelectComponent, CideFormFieldErrorComponent, ConfirmationService, CideEleDataGridComponent, CideEleDropdownComponent } from 'cloud-ide-element';
13
13
  import { HttpClient } from '@angular/common/http';
@@ -55,7 +55,7 @@ const academicsRoutes = [
55
55
  },
56
56
  {
57
57
  path: 'program-class-management',
58
- loadComponent: () => import('./cloud-ide-academics-program-class-list.component-C333Jax-.mjs').then(c => c.ProgramClassListComponent),
58
+ loadComponent: () => import('./cloud-ide-academics-program-class-list.component-D591YMJ3.mjs').then(c => c.ProgramClassListComponent),
59
59
  title: 'Program Class Management',
60
60
  canActivate: [authGuard],
61
61
  data: {
@@ -64,7 +64,7 @@ const academicsRoutes = [
64
64
  },
65
65
  {
66
66
  path: 'program-class-management/create',
67
- loadComponent: () => import('./cloud-ide-academics-program-class-create.component-C2VZz6x-.mjs').then(c => c.ProgramClassCreateComponent),
67
+ loadComponent: () => import('./cloud-ide-academics-program-class-create.component-Bd6yGQ3X.mjs').then(c => c.ProgramClassCreateComponent),
68
68
  title: 'Create Program Class',
69
69
  canActivate: [authGuard],
70
70
  data: {
@@ -73,7 +73,7 @@ const academicsRoutes = [
73
73
  },
74
74
  {
75
75
  path: 'program-class-management/edit/:query',
76
- loadComponent: () => import('./cloud-ide-academics-program-class-create.component-C2VZz6x-.mjs').then(c => c.ProgramClassCreateComponent),
76
+ loadComponent: () => import('./cloud-ide-academics-program-class-create.component-Bd6yGQ3X.mjs').then(c => c.ProgramClassCreateComponent),
77
77
  title: 'Edit Program Class',
78
78
  canActivate: [authGuard],
79
79
  data: {
@@ -82,7 +82,7 @@ const academicsRoutes = [
82
82
  },
83
83
  {
84
84
  path: 'program-class-management/view/:query',
85
- loadComponent: () => import('./cloud-ide-academics-program-class-create.component-C2VZz6x-.mjs').then(c => c.ProgramClassCreateComponent),
85
+ loadComponent: () => import('./cloud-ide-academics-program-class-create.component-Bd6yGQ3X.mjs').then(c => c.ProgramClassCreateComponent),
86
86
  title: 'View Program Class',
87
87
  canActivate: [authGuard],
88
88
  data: {
@@ -91,7 +91,7 @@ const academicsRoutes = [
91
91
  },
92
92
  {
93
93
  path: 'program-term-management/create',
94
- loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-Bw-I_FfZ.mjs').then(c => c.ClassProgramTermCreateComponent),
94
+ loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-A5Ed_CAc.mjs').then(c => c.ClassProgramTermCreateComponent),
95
95
  title: 'Create Class Program Term',
96
96
  canActivate: [authGuard],
97
97
  data: {
@@ -100,7 +100,7 @@ const academicsRoutes = [
100
100
  },
101
101
  {
102
102
  path: 'program-term-management/create/:query',
103
- loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-Bw-I_FfZ.mjs').then(c => c.ClassProgramTermCreateComponent),
103
+ loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-A5Ed_CAc.mjs').then(c => c.ClassProgramTermCreateComponent),
104
104
  title: 'Create Class Program Term',
105
105
  canActivate: [authGuard],
106
106
  data: {
@@ -109,7 +109,7 @@ const academicsRoutes = [
109
109
  },
110
110
  {
111
111
  path: 'program-term-management/edit/:query',
112
- loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-Bw-I_FfZ.mjs').then(c => c.ClassProgramTermCreateComponent),
112
+ loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-A5Ed_CAc.mjs').then(c => c.ClassProgramTermCreateComponent),
113
113
  title: 'Edit Class Program Term',
114
114
  canActivate: [authGuard],
115
115
  data: {
@@ -118,7 +118,7 @@ const academicsRoutes = [
118
118
  },
119
119
  {
120
120
  path: 'program-term-management/view/:query',
121
- loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-Bw-I_FfZ.mjs').then(c => c.ClassProgramTermCreateComponent),
121
+ loadComponent: () => import('./cloud-ide-academics-class-program-term-create.component-A5Ed_CAc.mjs').then(c => c.ClassProgramTermCreateComponent),
122
122
  title: 'View Class Program Term',
123
123
  canActivate: [authGuard],
124
124
  data: {
@@ -127,7 +127,7 @@ const academicsRoutes = [
127
127
  },
128
128
  {
129
129
  path: 'program-term-management',
130
- loadComponent: () => import('./cloud-ide-academics-class-program-term-list.component-DMUqLvyZ.mjs').then(c => c.ClassProgramTermListComponent),
130
+ loadComponent: () => import('./cloud-ide-academics-class-program-term-list.component-BWQ4BI9Z.mjs').then(c => c.ClassProgramTermListComponent),
131
131
  title: 'Class Program Term Management',
132
132
  canActivate: [authGuard],
133
133
  data: {
@@ -136,7 +136,7 @@ const academicsRoutes = [
136
136
  },
137
137
  {
138
138
  path: 'program-term-management/:query',
139
- loadComponent: () => import('./cloud-ide-academics-class-program-term-list.component-DMUqLvyZ.mjs').then(c => c.ClassProgramTermListComponent),
139
+ loadComponent: () => import('./cloud-ide-academics-class-program-term-list.component-BWQ4BI9Z.mjs').then(c => c.ClassProgramTermListComponent),
140
140
  title: 'Class Program Term Management',
141
141
  canActivate: [authGuard],
142
142
  data: {
@@ -337,7 +337,7 @@ const academicsRoutes = [
337
337
  },
338
338
  {
339
339
  path: 'bonafide/create',
340
- loadComponent: () => import('./cloud-ide-academics-bonafide-request-form.component-CM35A1Ex.mjs').then(c => c.CideAcademicsBonafideRequestFormComponent),
340
+ loadComponent: () => import('./cloud-ide-academics-bonafide-request-form.component-DIBzUNbF.mjs').then(c => c.CideAcademicsBonafideRequestFormComponent),
341
341
  title: 'Create Bonafide Request',
342
342
  canActivate: [authGuard],
343
343
  data: {
@@ -3858,6 +3858,176 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
3858
3858
  }]
3859
3859
  }] });
3860
3860
 
3861
+ /**
3862
+ * Shared service for checking class program configuration features
3863
+ * Supports two modes:
3864
+ * 1. By ID: Makes API call to fetch program class, then checks configuration
3865
+ * 2. By Configuration: Directly checks provided configuration object
3866
+ */
3867
+ class ClassProgramConfigurationService {
3868
+ programClassService = inject(CideLytProgramClassService);
3869
+ /**
3870
+ * Parse configuration from general master
3871
+ * Handles both string (JSON) and object formats
3872
+ * @param generalMaster - General master object containing sygms_configuration
3873
+ * @returns Parsed configuration object or undefined
3874
+ */
3875
+ parseConfiguration(generalMaster) {
3876
+ if (!generalMaster || typeof generalMaster !== 'object') {
3877
+ return undefined;
3878
+ }
3879
+ if (!('sygms_configuration' in generalMaster)) {
3880
+ return undefined;
3881
+ }
3882
+ const configValue = generalMaster.sygms_configuration;
3883
+ if (!configValue) {
3884
+ return undefined;
3885
+ }
3886
+ if (typeof configValue === 'string') {
3887
+ try {
3888
+ return JSON.parse(configValue);
3889
+ }
3890
+ catch {
3891
+ return undefined;
3892
+ }
3893
+ }
3894
+ else if (typeof configValue === 'object' && configValue !== null) {
3895
+ return configValue;
3896
+ }
3897
+ return undefined;
3898
+ }
3899
+ /**
3900
+ * Check if branch functionality is enabled from configuration object
3901
+ * @param config - Configuration object
3902
+ * @returns true if branchType is true, false otherwise
3903
+ */
3904
+ hasBranchFunctionalityFromConfig(config) {
3905
+ return config?.branchType === true;
3906
+ }
3907
+ /**
3908
+ * Check if branch functionality is enabled from general master object
3909
+ * @param generalMaster - General master object containing sygms_configuration
3910
+ * @returns true if branchType is true, false otherwise
3911
+ */
3912
+ hasBranchFunctionalityFromGeneralMaster(generalMaster) {
3913
+ const config = this.parseConfiguration(generalMaster);
3914
+ return this.hasBranchFunctionalityFromConfig(config);
3915
+ }
3916
+ /**
3917
+ * Check if branch functionality is enabled from program class object
3918
+ * @param programClass - Program class object containing acacpm_class_program_id_sygms
3919
+ * @returns true if branchType is true, false otherwise
3920
+ */
3921
+ hasBranchFunctionalityFromProgramClass(programClass) {
3922
+ if (!programClass) {
3923
+ return false;
3924
+ }
3925
+ const generalMaster = programClass.acacpm_class_program_id_sygms;
3926
+ return this.hasBranchFunctionalityFromGeneralMaster(generalMaster);
3927
+ }
3928
+ /**
3929
+ * Check if branch functionality is enabled by fetching program class by ID
3930
+ * Makes an API call to get the program class, then checks the configuration
3931
+ * @param programClassId - ID of the program class
3932
+ * @returns Observable<boolean> - true if branchType is true, false otherwise
3933
+ */
3934
+ hasBranchFunctionalityById(programClassId) {
3935
+ if (!programClassId || programClassId.trim() === '') {
3936
+ return of(false);
3937
+ }
3938
+ const payload = {
3939
+ acacpm_id: programClassId
3940
+ };
3941
+ return this.programClassService.getProgramClassById(payload).pipe(map$1((response) => {
3942
+ if (!response?.success || !response.data) {
3943
+ return false;
3944
+ }
3945
+ const programClass = response.data;
3946
+ return this.hasBranchFunctionalityFromProgramClass(programClass);
3947
+ }), catchError$1(() => {
3948
+ return of(false);
3949
+ }));
3950
+ }
3951
+ /**
3952
+ * Get configuration from general master
3953
+ * @param generalMaster - General master object containing sygms_configuration
3954
+ * @returns Configuration object or undefined
3955
+ */
3956
+ getConfiguration(generalMaster) {
3957
+ return this.parseConfiguration(generalMaster);
3958
+ }
3959
+ /**
3960
+ * Get configuration from program class object
3961
+ * @param programClass - Program class object containing acacpm_class_program_id_sygms
3962
+ * @returns Configuration object or undefined
3963
+ */
3964
+ getConfigurationFromProgramClass(programClass) {
3965
+ if (!programClass) {
3966
+ return undefined;
3967
+ }
3968
+ const generalMaster = programClass.acacpm_class_program_id_sygms;
3969
+ return this.getConfiguration(generalMaster);
3970
+ }
3971
+ /**
3972
+ * Get configuration by fetching program class by ID
3973
+ * Makes an API call to get the program class, then extracts the configuration
3974
+ * @param programClassId - ID of the program class
3975
+ * @returns Observable<ClassProgramConfiguration | undefined> - Configuration object or undefined
3976
+ */
3977
+ getConfigurationById(programClassId) {
3978
+ if (!programClassId || programClassId.trim() === '') {
3979
+ return of(undefined);
3980
+ }
3981
+ const payload = {
3982
+ acacpm_id: programClassId
3983
+ };
3984
+ return this.programClassService.getProgramClassById(payload).pipe(map$1((response) => {
3985
+ if (!response?.success || !response.data) {
3986
+ return undefined;
3987
+ }
3988
+ const programClass = response.data;
3989
+ return this.getConfigurationFromProgramClass(programClass);
3990
+ }), catchError$1(() => {
3991
+ return of(undefined);
3992
+ }));
3993
+ }
3994
+ /**
3995
+ * Check if term dropdown should be shown based on configuration
3996
+ * Returns true if term dropdown should be visible, false otherwise
3997
+ *
3998
+ * Condition for hiding:
3999
+ * termType=true AND termProgramLevelOneConnected=true AND termLevelUpTo=1 AND branchType=false
4000
+ * This indicates a "one-to-one" hidden term scenario which is auto-selected
4001
+ *
4002
+ * @param config - Configuration object
4003
+ * @returns true if dropdown should be shown, false if hidden (auto-select scenario) or if termType is false
4004
+ */
4005
+ shouldShowTermDropdown(config) {
4006
+ // STRICT RULE: Only show if termType is explicitly true
4007
+ if (!config || typeof config !== 'object' || !('termType' in config) || config.termType !== true) {
4008
+ return false;
4009
+ }
4010
+ // Hide dropdown if:
4011
+ // termType=true AND termProgramLevelOneConnected=true AND termLevelUpTo=1 AND branchType=false
4012
+ if (config.termType === true &&
4013
+ config.termProgramLevelOneConnected === true &&
4014
+ config.termLevelUpTo !== undefined &&
4015
+ config.termLevelUpTo === 1 &&
4016
+ config.branchType === false) {
4017
+ return false;
4018
+ }
4019
+ return true;
4020
+ }
4021
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ClassProgramConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4022
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ClassProgramConfigurationService, providedIn: 'root' });
4023
+ }
4024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ClassProgramConfigurationService, decorators: [{
4025
+ type: Injectable,
4026
+ args: [{
4027
+ providedIn: 'root'
4028
+ }]
4029
+ }] });
4030
+
3861
4031
  class ProgramTermSectionCreateComponent {
3862
4032
  // Dependency injection
3863
4033
  destroyRef = inject(DestroyRef);
@@ -3873,6 +4043,7 @@ class ProgramTermSectionCreateComponent {
3873
4043
  programTermSectionService = inject(CideLytProgramTermSectionService);
3874
4044
  componentContextService = inject(ComponentContextService);
3875
4045
  rightsService = inject(RightsService);
4046
+ classProgramConfigService = inject(ClassProgramConfigurationService);
3876
4047
  programTermSectionForm;
3877
4048
  activeTab = signal('basic', ...(ngDevMode ? [{ debugName: "activeTab" }] : []));
3878
4049
  loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
@@ -3905,29 +4076,16 @@ class ProgramTermSectionCreateComponent {
3905
4076
  return config && typeof config === 'object' && 'branchType' in config && config?.branchType === true;
3906
4077
  }, ...(ngDevMode ? [{ debugName: "showBranchDropdown" }] : []));
3907
4078
  // Computed signal to check if term dropdown should be shown
3908
- // Always show in create mode, but hide in edit/view mode if termType=true, termProgramLevelOneConnected=true, termLevelUpTo=1, and branchType=false
3909
4079
  showTermDropdown = computed(() => {
3910
- // Always show in create mode
3911
- if (!this.isEditMode() && !this.isViewMode()) {
3912
- return true;
3913
- }
3914
- // In edit/view mode, check configuration
4080
+ // Check configuration from selected program class
3915
4081
  const selectedProgram = this.selectedProgramClass();
4082
+ // If no program selected yet, default to false (don't show until we know config)
4083
+ // Or true if you want to be permissive, but based on requirement "only show... when true"
3916
4084
  if (!selectedProgram)
3917
- return true; // Show by default if no program selected
3918
- const config = selectedProgram?.acacpm_class_program_id_sygms?.sygms_configuration;
3919
- if (!config || typeof config !== 'object')
3920
- return true;
3921
- // Hide dropdown in edit/view mode if:
3922
- // termType=true AND termProgramLevelOneConnected=true AND termLevelUpTo=1 AND branchType=false
3923
- if (config.termType === true &&
3924
- config.termProgramLevelOneConnected === true &&
3925
- config.termLevelUpTo !== undefined &&
3926
- config.termLevelUpTo === 1 &&
3927
- config.branchType === false) {
3928
4085
  return false;
3929
- }
3930
- return true; // Show dropdown by default
4086
+ const config = selectedProgram?.acacpm_class_program_id_sygms?.sygms_configuration;
4087
+ // Use shared service logic for consistency
4088
+ return this.classProgramConfigService.shouldShowTermDropdown(config);
3931
4089
  }, ...(ngDevMode ? [{ debugName: "showTermDropdown" }] : []));
3932
4090
  // Route parameter signals
3933
4091
  acacpmId = signal(null, ...(ngDevMode ? [{ debugName: "acacpmId" }] : []));
@@ -6643,5 +6801,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
6643
6801
  * Generated bundle index. Do not edit.
6644
6802
  */
6645
6803
 
6646
- export { AcademicYearCreateComponent as A, CideLytProgramClassService as C, ProgramTermSectionCreateComponent as P, CideLytAcademicYearService as a, CideLytClassProgramBranchService as b, CideLytClassProgramTermService as c, CideLytProgramSectionSelectorComponent as d, academicsRoutes as e, AcademicYearListComponent as f, CideLytAcademicYearMappingService as g, CideLytClassProgramBranchListComponent as h, CideLytClassProgramBranchFormComponent as i, ProgramTermSectionListComponent as j, CideLytProgramTermSectionService as k };
6647
- //# sourceMappingURL=cloud-ide-academics-cloud-ide-academics-C1qeVY8_.mjs.map
6804
+ export { AcademicYearCreateComponent as A, CideLytProgramClassService as C, ProgramTermSectionCreateComponent as P, ClassProgramConfigurationService as a, CideLytAcademicYearService as b, CideLytClassProgramBranchService as c, CideLytClassProgramTermService as d, CideLytProgramSectionSelectorComponent as e, academicsRoutes as f, AcademicYearListComponent as g, CideLytAcademicYearMappingService as h, CideLytClassProgramBranchListComponent as i, CideLytClassProgramBranchFormComponent as j, ProgramTermSectionListComponent as k, CideLytProgramTermSectionService as l };
6805
+ //# sourceMappingURL=cloud-ide-academics-cloud-ide-academics-BRQerudY.mjs.map