diff --git a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/ProfessorCategory.java b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/ProfessorCategory.java index 582ae8c..a58a2c8 100644 --- a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/ProfessorCategory.java +++ b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/domain/ProfessorCategory.java @@ -3,5 +3,9 @@ package net.shyshkin.study.fullstack.supportportal.backend.domain; public enum ProfessorCategory { FACULTY, SUPPORT_TEAM, - TRAINEE_FELLOW + TRAINEE_FELLOW, + RESIGNED, + GUIDES, + FRIENDS, + PATRONS } \ No newline at end of file diff --git a/support-portal-frontend/src/app/component/professor/professor.component.css b/support-portal-frontend/src/app/component/professor/professor.component.css index 00ca9c4..3f90d00 100644 --- a/support-portal-frontend/src/app/component/professor/professor.component.css +++ b/support-portal-frontend/src/app/component/professor/professor.component.css @@ -301,6 +301,26 @@ color: #92400e; } +.badge-resigned { + background: #f3f4f6; + color: #374151; +} + +.badge-guides { + background: #dbeafe; + color: #1e3a8a; +} + +.badge-friends { + background: #dcfce7; + color: #14532d; +} + +.badge-patrons { + background: #fae8ff; + color: #6b21a8; +} + /* Status Badge */ .status-badge { display: inline-flex; diff --git a/support-portal-frontend/src/app/component/professor/professor.component.html b/support-portal-frontend/src/app/component/professor/professor.component.html index 2626b7d..75ab10e 100644 --- a/support-portal-frontend/src/app/component/professor/professor.component.html +++ b/support-portal-frontend/src/app/component/professor/professor.component.html @@ -67,7 +67,11 @@ + [class.badge-trainee]="professor?.category === 'TRAINEE_FELLOW'" + [class.badge-resigned]="professor?.category === 'RESIGNED'" + [class.badge-guides]="professor?.category === 'GUIDES'" + [class.badge-friends]="professor?.category === 'FRIENDS'" + [class.badge-patrons]="professor?.category === 'PATRONS'"> {{ getCategoryDisplayName(professor?.category) }} @@ -137,7 +141,11 @@
+ [class.badge-trainee]="selectedProfessor.category === 'TRAINEE_FELLOW'" + [class.badge-resigned]="selectedProfessor.category === 'RESIGNED'" + [class.badge-guides]="selectedProfessor.category === 'GUIDES'" + [class.badge-friends]="selectedProfessor.category === 'FRIENDS'" + [class.badge-patrons]="selectedProfessor.category === 'PATRONS'"> {{ getCategoryDisplayName(selectedProfessor.category) }} Faculty + + + +
@@ -488,18 +500,17 @@
+ [disabled]="isImageUploadDisabled(newProfessorForm.value.category)">
+ *ngIf="isImageUploadDisabled(newProfessorForm.value.category)"> Profile image upload is not available for {{ getCategoryDisplayName(newProfessorForm.value.category) }} category @@ -588,6 +599,10 @@ + + + + @@ -771,17 +786,16 @@
+ [disabled]="!isManager || isImageUploadDisabled(selectedProfessor.category)">
+ *ngIf="isImageUploadDisabled(selectedProfessor.category)"> Profile image upload is not available for {{ getCategoryDisplayName(selectedProfessor.category) }} category 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 dd17385..451cef3 100644 --- a/support-portal-frontend/src/app/component/professor/professor.component.ts +++ b/support-portal-frontend/src/app/component/professor/professor.component.ts @@ -210,13 +210,24 @@ export class ProfessorComponent implements OnInit, OnDestroy { public getCategoryDisplayName(category: string): string { switch (category) { - case 'FACULTY': return 'Faculty'; - case 'SUPPORT_TEAM': return 'Support Team'; + case 'FACULTY': return 'Faculty'; + case 'SUPPORT_TEAM': return 'Support Team'; case 'TRAINEE_FELLOW': return 'Trainee/Fellow'; - default: return 'Unknown'; + case 'RESIGNED': return 'Resigned'; + case 'GUIDES': return 'Guides'; + case 'FRIENDS': return 'Friends'; + case 'PATRONS': return 'Patrons'; + default: return category || 'Unknown'; } } + /** Categories that should NOT have a profile image upload */ + private readonly NO_IMAGE_CATEGORIES = ['TRAINEE_FELLOW', 'SUPPORT_TEAM', 'GUIDES', 'FRIENDS', 'PATRONS']; + + public isImageUploadDisabled(category: string): boolean { + return this.NO_IMAGE_CATEGORIES.includes(category); + } + handleTitleChange(title: string): void { this.titleSubject.next(title); } @@ -277,7 +288,7 @@ export class ProfessorComponent implements OnInit, OnDestroy { } public onCategoryChange(category: string): void { - if (category === 'TRAINEE_FELLOW' || category === 'SUPPORT_TEAM') { + if (this.isImageUploadDisabled(category)) { this.profileImage = null; this.profileImageFileName = null; const fileInput = document.getElementById('newProfessorProfileImage') as HTMLInputElement; @@ -449,7 +460,7 @@ export class ProfessorComponent implements OnInit, OnDestroy { } // ─── Profile image ─────────────────────────────────────────────────────── - if (profileImage && professor.category !== 'TRAINEE_FELLOW' && professor.category !== 'SUPPORT_TEAM') { + if (profileImage && !this.isImageUploadDisabled(professor.category)) { formData.append('profileImage', profileImage); } diff --git a/support-portal-frontend/src/app/enum/professor-category.enum.ts b/support-portal-frontend/src/app/enum/professor-category.enum.ts index 6db70e0..d3ff666 100644 --- a/support-portal-frontend/src/app/enum/professor-category.enum.ts +++ b/support-portal-frontend/src/app/enum/professor-category.enum.ts @@ -1,6 +1,10 @@ // src/app/enum/professor-category.enum.ts export enum ProfessorCategory { FACULTY = 'FACULTY', - SUPPORT_TEAM = 'SUPPORT_TEAM', - TRAINEE_FELLOW = 'TRAINEE_FELLOW' + SUPPORT_TEAM = 'SUPPORT_TEAM', + TRAINEE_FELLOW = 'TRAINEE_FELLOW', + RESIGNED = 'RESIGNED', + GUIDES = 'GUIDES', + FRIENDS = 'FRIENDS', + PATRONS = 'PATRONS' } \ No newline at end of file