3.0 KiB
You are a Senior Frontend Engineer.
Project: Training Management System (TMS)
Current task: Move Import Employees from sidebar into Users/Employees page as an action button.
Requirement: Remove "นำเข้าพนักงาน" from sidebar navigation and add it as a button inside the Users/Employees page.
Important constraints:
- Do NOT delete /dashboard/import-employees route.
- Do NOT delete import employee API.
- Do NOT change database schema.
- Do NOT change permissions.
- Do NOT create nested sidebar menu.
- Keep Thai UI.
- Keep responsive behavior.
- Minimal-impact changes only.
Navigation change:
- Remove root-level sidebar menu:
- นำเข้าพนักงาน
-
Do NOT add it as sidebar submenu.
-
Keep sidebar structure:
ข้อมูลหลัก ├─ พนักงาน ├─ หลักสูตร ├─ นโยบาย └─ ประกาศ
Users/Employees page change:
- On Users/Employees page, add action button:
Label:
- นำเข้าพนักงาน
Icon:
- Upload or
- FileUp
Button behavior:
- Click redirects to: /dashboard/import-employees
- Place the button in page header action area.
Recommended layout:
Title:
- พนักงาน
Description:
- จัดการข้อมูลพนักงานและสิทธิ์การใช้งานระบบ
Actions:
- นำเข้าพนักงาน
- เพิ่มพนักงาน
If Add User already exists:
- Keep Add User button.
- Add Import Employees button beside it.
If space is limited on mobile:
- Stack buttons vertically or make full width.
- Permission:
Button visible only for HRD/Admin.
Employee users should not see this button.
- Direct route:
/dashboard/import-employees should remain protected as HRD/Admin only.
- Responsive:
Desktop:
- Buttons align right in page header.
Mobile:
- Buttons stack full width.
- No overflow.
Files likely involved:
- src/config/nav-config.ts
- src/app/dashboard/users/page.tsx
- src/features/users/components/*
- src/components/ui/heading.tsx or page header component if used
- src/app/dashboard/import-employees/page.tsx only if redirect/back button needed
Output Review File:
Create: docs/management-change-import-button-in-users-review.md
Include:
- Summary
- Files Changed
- Sidebar Changes
- Users Page Changes
- Permission Rules
- Responsive Notes
- Manual Test Checklist
- Known Limitations
Manual Test Checklist:
- Sidebar no longer shows "นำเข้าพนักงาน".
- Sidebar still shows "พนักงาน".
- Users page shows "นำเข้าพนักงาน" button for HRD/Admin.
- Button links to /dashboard/import-employees.
- Add User button still works if present.
- Employee user does not see import button.
- Direct /dashboard/import-employees remains HRD/Admin only.
- Mobile layout does not overflow.
Return:
- Complete code changes with file paths.
- Content of docs/management-change-import-button-in-users-review.md.