-
- Profile image upload is not available for Trainee/Fellow category
+
+ Profile image upload is not available for {{ getCategoryDisplayName(selectedProfessor.category) }}
+ category
@@ -763,7 +792,8 @@
diff --git a/support-portal-frontend/src/app/component/professor/professor.component.ts b/support-portal-frontend/src/app/component/professor/professor.component.ts
index 56a0af4..ea7e1f3 100644
--- a/support-portal-frontend/src/app/component/professor/professor.component.ts
+++ b/support-portal-frontend/src/app/component/professor/professor.component.ts
@@ -42,7 +42,7 @@ export class ProfessorComponent implements OnInit, OnDestroy {
public loggedInProfessor: Professor;
public refreshing: boolean;
private subs = new SubSink();
-
+
selectedProfessor: Professor = {
professorId: '',
firstName: '',
@@ -79,16 +79,16 @@ export class ProfessorComponent implements OnInit, OnDestroy {
public selectedProfessorAwards: Award[] = [];
private closeModal(modalId: string): void {
- const modalElement = document.getElementById(modalId);
- if (!modalElement) return;
+ const modalElement = document.getElementById(modalId);
+ if (!modalElement) return;
- const modalInstance = Modal.getInstance(modalElement) || new Modal(modalElement);
- modalInstance.hide();
+ const modalInstance = Modal.getInstance(modalElement) || new Modal(modalElement);
+ modalInstance.hide();
- // Force-remove leftover background overlays if any remain
- document.body.classList.remove('modal-open');
- document.querySelectorAll('.modal-backdrop').forEach(b => b.remove());
-}
+ // Force-remove leftover background overlays if any remain
+ document.body.classList.remove('modal-open');
+ document.querySelectorAll('.modal-backdrop').forEach(b => b.remove());
+ }
constructor(
@@ -96,7 +96,7 @@ export class ProfessorComponent implements OnInit, OnDestroy {
private notificationService: NotificationService,
private router: Router,
private authenticationService: AuthenticationService,
- ) {}
+ ) { }
ngOnInit(): void {
this.getProfessors(true);
@@ -233,12 +233,12 @@ export class ProfessorComponent implements OnInit, OnDestroy {
public onSelectProfessor(selectedProfessor: Professor): void {
// Create a deep copy to avoid reference issues
this.selectedProfessor = JSON.parse(JSON.stringify(selectedProfessor));
-
+
// Create a separate copy for awards to display
- this.selectedProfessorAwards = selectedProfessor.awards
+ this.selectedProfessorAwards = selectedProfessor.awards
? JSON.parse(JSON.stringify(selectedProfessor.awards))
: [];
-
+
// Set up work days for viewing
this.selectedWorkDays = {};
if (selectedProfessor.workDays && Array.isArray(selectedProfessor.workDays)) {
@@ -248,7 +248,7 @@ export class ProfessorComponent implements OnInit, OnDestroy {
}
});
}
-
+
this.clickButton('openProfessorInfo');
}
@@ -260,8 +260,8 @@ export class ProfessorComponent implements OnInit, OnDestroy {
}
public onCategoryChange(category: string): void {
- // Clear profile image if Trainee/Fellow is selected
- if (category === 'TRAINEE_FELLOW') {
+ // Clear profile image if Trainee/Fellow or Support Team is selected
+ if (category === 'TRAINEE_FELLOW' || category === 'SUPPORT_TEAM') {
this.profileImage = null;
this.profileImageFileName = null;
// Reset file input
@@ -335,7 +335,7 @@ export class ProfessorComponent implements OnInit, OnDestroy {
public onEditProfessor(professor: Professor): void {
// Create a deep copy to avoid reference issues
this.selectedProfessor = JSON.parse(JSON.stringify(professor));
-
+
// Set up work days for editing with validation
this.selectedWorkDays = {};
if (professor.workDays && Array.isArray(professor.workDays)) {
@@ -347,10 +347,10 @@ export class ProfessorComponent implements OnInit, OnDestroy {
}
// Set up awards for editing - create a deep copy
- this.selectedProfessorAwards = professor.awards
+ this.selectedProfessorAwards = professor.awards
? JSON.parse(JSON.stringify(professor.awards))
: [];
-
+
this.clickButton('openProfessorEdit');
}
@@ -400,7 +400,13 @@ export class ProfessorComponent implements OnInit, OnDestroy {
formData.append('designation', professor.designation || professor.position || '');
formData.append('description', professor.description || '');
formData.append('certification', professor.certification || '');
- formData.append('training', professor.training || '');
+
+ // Only include training if NOT retired
+ if (professor.status !== WorkingStatus.RETIRED) {
+ formData.append('training', professor.training || '');
+ } else {
+ formData.append('training', ''); // Clear training for retired faculty
+ }
// Work days - collect from selectedWorkDays object
const workDays = Object.keys(this.selectedWorkDays).filter(day => this.selectedWorkDays[day]);
@@ -414,10 +420,10 @@ export class ProfessorComponent implements OnInit, OnDestroy {
const awardsToSubmit = professor.professorId ? this.selectedProfessorAwards : this.newProfessorAwards;
if (awardsToSubmit && awardsToSubmit.length > 0) {
// Filter out empty awards and only include those with at least title and year
- const validAwards = awardsToSubmit.filter(award =>
+ const validAwards = awardsToSubmit.filter(award =>
award.title && award.title.trim() && award.year && award.year.trim()
);
-
+
validAwards.forEach((award, index) => {
formData.append(`awards[${index}].title`, award.title.trim());
formData.append(`awards[${index}].year`, award.year.trim());
@@ -426,8 +432,8 @@ export class ProfessorComponent implements OnInit, OnDestroy {
});
}
- // Profile image - only add if not Trainee/Fellow category
- if (profileImage && professor.category !== 'TRAINEE_FELLOW') {
+ // Profile image - only add if not Trainee/Fellow or Support Team category
+ if (profileImage && professor.category !== 'TRAINEE_FELLOW' && professor.category !== 'SUPPORT_TEAM') {
formData.append('profileImage', profileImage);
}
@@ -486,7 +492,7 @@ export class ProfessorComponent implements OnInit, OnDestroy {
case HttpEventType.UploadProgress:
this.fileUploadStatus.percentage = Math.round(100 * event.loaded / event.total!);
this.fileUploadStatus.status = 'progress';
- break;
+ break;
case HttpEventType.Response:
if (event.status === 200) {
if (this.loggedInProfessor) {
diff --git a/support-portal-frontend/src/app/component/service-tile/service-tile.component.html b/support-portal-frontend/src/app/component/service-tile/service-tile.component.html
index cb3e4e7..e91db12 100644
--- a/support-portal-frontend/src/app/component/service-tile/service-tile.component.html
+++ b/support-portal-frontend/src/app/component/service-tile/service-tile.component.html
@@ -10,9 +10,8 @@