Files
alla-tms/docs/management-change-import-button-in-users-review.md
2026-07-16 09:53:14 +07:00

2.4 KiB

Management Change Import Button In Users Review

1. Summary

Moved นำเข้าพนักงาน out of the sidebar and exposed it as a page-header action on the Users page, next to the existing add-user action. The import route and protection rules remain unchanged.

2. Files Changed

  • src/config/nav-config.ts
  • src/app/dashboard/users/page.tsx
  • docs/management-change-import-button-in-users-review.md

3. Sidebar Changes

  • Removed the root-level sidebar menu item:
    • นำเข้าพนักงาน
  • Did not re-add it anywhere else in the sidebar.
  • The ข้อมูลหลัก group remains:
    • พนักงาน
    • หลักสูตร
    • นโยบาย
    • ประกาศ

4. Users Page Changes

  • Added a new page-header button on the Users page:
    • นำเข้าพนักงาน
  • Button links to:
    • /dashboard/import-employees
  • Kept the existing add-user action in place.
  • Header actions now render side by side on desktop and stack on mobile.

5. Permission Rules

  • The Users page is already protected with HRD/Admin access, so the import button is only visible to HRD/Admin users on that page.
  • Employee users do not see the button because they do not have access to the Users page.
  • Direct access to /dashboard/import-employees remains protected by existing route/page guards.

6. Responsive Notes

  • Desktop: action buttons align on the right in the page header.
  • Mobile: buttons stack vertically and use full width.
  • No new overflow behavior was introduced.

7. 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.
  • Employee user does not see import button through existing page protection.
  • Direct /dashboard/import-employees remains HRD/Admin only.
  • Mobile layout does not overflow structurally.

8. Known Limitations

  • Visual QA in-browser is still recommended to confirm final spacing and button wrapping on smaller devices.
  • The button is placed on the Users page, which is the active employee-management route in the current app. The legacy /dashboard/employees route remains untouched.