From 7f3527b51c9204b61f3a5c671a4ca24c3db29e23 Mon Sep 17 00:00:00 2001 From: Talal Sharabi Date: Wed, 11 Feb 2026 23:15:04 +0400 Subject: [PATCH] Fix HR module and text visibility issues - Added missing HR endpoints: /hr/departments and /hr/positions - Fixed text color visibility (removed dark mode causing white text) - Ensured all input fields have proper dark text color - Added proper placeholder styling for forms Co-authored-by: Cursor --- backend/src/modules/hr/hr.controller.ts | 22 ++++++++++++++ backend/src/modules/hr/hr.routes.ts | 8 +++++ backend/src/modules/hr/hr.service.ts | 29 ++++++++++++++++++ frontend/src/app/globals.css | 39 ++++++++++++++----------- 4 files changed, 81 insertions(+), 17 deletions(-) diff --git a/backend/src/modules/hr/hr.controller.ts b/backend/src/modules/hr/hr.controller.ts index ffa9d46..1ac81c3 100644 --- a/backend/src/modules/hr/hr.controller.ts +++ b/backend/src/modules/hr/hr.controller.ts @@ -123,6 +123,28 @@ export class HRController { next(error); } } + + // ========== DEPARTMENTS ========== + + async findAllDepartments(req: AuthRequest, res: Response, next: NextFunction) { + try { + const departments = await hrService.findAllDepartments(); + res.json(ResponseFormatter.success(departments)); + } catch (error) { + next(error); + } + } + + // ========== POSITIONS ========== + + async findAllPositions(req: AuthRequest, res: Response, next: NextFunction) { + try { + const positions = await hrService.findAllPositions(); + res.json(ResponseFormatter.success(positions)); + } catch (error) { + next(error); + } + } } export const hrController = new HRController(); diff --git a/backend/src/modules/hr/hr.routes.ts b/backend/src/modules/hr/hr.routes.ts index e627c83..cbaa267 100644 --- a/backend/src/modules/hr/hr.routes.ts +++ b/backend/src/modules/hr/hr.routes.ts @@ -29,5 +29,13 @@ router.post('/leaves/:id/approve', authorize('hr', 'leaves', 'approve'), hrContr router.post('/salaries/process', authorize('hr', 'salaries', 'process'), hrController.processSalary); +// ========== DEPARTMENTS ========== + +router.get('/departments', authorize('hr', 'all', 'read'), hrController.findAllDepartments); + +// ========== POSITIONS ========== + +router.get('/positions', authorize('hr', 'all', 'read'), hrController.findAllPositions); + export default router; diff --git a/backend/src/modules/hr/hr.service.ts b/backend/src/modules/hr/hr.service.ts index ef0cefd..d09567e 100644 --- a/backend/src/modules/hr/hr.service.ts +++ b/backend/src/modules/hr/hr.service.ts @@ -377,6 +377,35 @@ class HRService { const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); return diffDays + 1; } + + // ========== DEPARTMENTS ========== + + async findAllDepartments() { + const departments = await prisma.department.findMany({ + where: { isActive: true }, + orderBy: { name: 'asc' } + }); + return departments; + } + + // ========== POSITIONS ========== + + async findAllPositions() { + const positions = await prisma.position.findMany({ + where: { isActive: true }, + include: { + department: { + select: { + id: true, + name: true, + nameAr: true + } + } + }, + orderBy: { title: 'asc' } + }); + return positions; + } } export const hrService = new HRService(); diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index 5d608c4..32fb093 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -3,27 +3,32 @@ @tailwind utilities; :root { - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } + --foreground-rgb: 17, 24, 39; + --background-rgb: 255, 255, 255; } body { color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); + background: rgb(var(--background-rgb)); + min-height: 100vh; +} + +/* Force dark text for all text elements */ +* { + color: inherit; +} + +input, +textarea, +select { + color: rgb(17, 24, 39) !important; +} + +/* Ensure placeholder text is visible */ +input::placeholder, +textarea::placeholder { + color: rgb(156, 163, 175) !important; + opacity: 1; } /* Font Families */