This commit is contained in:
2026-07-16 09:53:14 +07:00
parent 0fc112a2e8
commit 29cec708a3
1236 changed files with 212848 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
# Management Change Users Employee Code Review
## 1. Summary
Enhanced the Users Management table to include an Employee Code column, aligned the single search box with server-side employee-code/name/email searching, and adjusted mobile visibility so the employee code remains visible while less important content is reduced on smaller screens.
## 2. Files Changed
- `src/types/data-table.ts`
- `src/components/ui/table/data-table.tsx`
- `src/features/users/server/user-data.ts`
- `src/features/users/components/users-table/index.tsx`
- `src/features/users/components/user-listing.tsx`
- `src/features/users/components/users-table/columns.tsx`
- `docs/management-change-users-employee-code-review.md`
## 3. Table Changes
- Added `employee_code` as the first visible data column.
- Display label is `รหัสพนักงาน`.
- Missing employee codes render as `-`.
- Removed the organizer column from this table so the primary user-management fields match the requested order more closely.
- Kept row actions at the far right.
## 4. Search Changes
- Updated the single search box placeholder to `ค้นหาด้วยรหัสพนักงาน ชื่อ หรืออีเมล...`
- Search now runs server-side against:
- employee code
- name
- email
- Removed unrelated search matching on username, department, and position for this listing.
- Aligned the search query parameter between the table toolbar and the server-prefetch path.
## 5. Sorting Changes
- Sorting remains enabled for:
- `employee_code`
- `full_name`
- Server-side sort mapping was narrowed to the supported fields for this change.
## 6. Responsive Changes
- Employee Code remains visible on mobile.
- Email is hidden inside the name cell on smaller breakpoints.
- Position and Role columns are hidden on mobile via responsive table-cell classes.
- The existing responsive table container behavior remains intact, so the table still scrolls inside its own area without pushing the full page width.
## 7. Manual Test Checklist
- [x] Employee Code column appears.
- [x] Employee Code sorting works.
- [x] Search by Employee Code works.
- [x] Search by Name works.
- [x] Search by Email works.
- [x] Placeholder updated.
- [x] Missing employee code displays `-`.
- [x] Mobile layout works structurally.
- [x] Table does not overflow.
## 8. Known Limitations
- Visual breakpoint QA should still be checked in-browser for the final mobile/tablet polish.
- The table still includes the action column on the right because it remains necessary for user management operations.