251210:1709 Frontend: reeactor organization and run build
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-10 17:09:11 +07:00
parent aa96cd90e3
commit c8a0f281ef
140 changed files with 3780 additions and 1473 deletions

View File

@@ -0,0 +1,43 @@
# Work Summary - 2025-12-10
## ✅ Organizations Page Refactoring (Admin Console)
Refactored the Organizations management page in the Admin Console following established patterns.
### New Files Created
| File | Description |
| ------------------------------------------ | ------------------------------------------------------------ |
| `components/admin/organization-dialog.tsx` | Extracted dialog component with form validation (~212 lines) |
| `types/dto/organization.dto.ts` | Typed DTOs matching backend (`Create`, `Update`, `Search`) |
### Modified Files
| File | Changes |
| ------------------------------------------ | ------------------------------------------------- |
| `app/(admin)/admin/organizations/page.tsx` | Reduced from 300 → 153 lines by extracting dialog |
| `hooks/use-master-data.ts` | Replaced `any` with proper DTO types |
| `lib/services/master-data.service.ts` | Added typed organization methods |
### Pattern Improvements
- **Component Extraction**: Followed `UserDialog` pattern for consistency
- **Type Safety**: Removed `any` types from organization hooks and service
- **Code Reduction**: Page reduced by ~50% (300 → 153 lines)
### Bug Fixes (Discovered)
- Fixed Zod v4 compatibility issue in `organization-dialog.tsx`
- Fixed Zod v4 compatibility issue in `projects/page.tsx`
> **Note**: Pre-existing TypeScript errors in `disciplines/page.tsx`, `rfa-types/page.tsx`, and `user-dialog.tsx` still require Zod v4 fixes.
## 🧪 Verification
- ✅ Organizations files compile without TypeScript errors
- ⚠️ Full build blocked by pre-existing issues in other admin pages
## 📋 Next Steps
1. Fix remaining Zod v4 compatibility issues in other admin pages
2. Manual testing of Organizations CRUD operations