2.5 KiB
2.5 KiB
PLAN: Sync to Attendance Records Overhaul
Target Files:
resources/js/pages/hr/biometric-attendance/index.tsx(Dashboard UI update)app/Http/Controllers/BiometricAttendanceController.php(Verify bulk sync route & permission rules)
Goal
Overhaul the biometric sync UX by:
- Renaming the bulk action button to "Sync to Attendance Records".
- Adding a confirmation modal that appears before executing the bulk sync, allowing the user to confirm the sync and toggle the "Overwrite" option.
- Removing the individual row "Sync" action in the table, leaving only the "Details" action.
Tasks
Phase 1: Frontend Table Actions Cleanup
- Remove individual row Sync action:
- In
resources/js/pages/hr/biometric-attendance/index.tsx, locate theactionsarray. - Delete the
Syncaction object so only theDetailsaction remains. - Delete the unused
handleSyncfunction.
- In
Phase 2: Bulk Sync Confirmation Modal
- Implement Confirmation Dialog:
- Add state variables
isConfirmOpen(boolean) andoverwrite(boolean) insideBiometricAttendance. - Create a custom modal/dialog inside the index template that opens when clicking "Sync to Attendance Records".
- The dialog must display:
- Title: "Sync to Attendance Records"
- Warning message: "This will process all pending biometric logs and write them to the final attendance sheets."
- Checkbox option: "Overwrite existing attendance records (Biometrics as source of truth)"
- Buttons: "Cancel" (closes modal) and "Proceed Sync" (triggers POST request).
- Add state variables
- Update Button layout:
- Rename the primary button text from "Pull Data & Sync" to "Sync to Attendance Records".
- Remove the inline checkbox from the main header and place it strictly inside the confirmation modal.
Phase 3: Route & Request Payload Validation
- Test the Inertia submission:
- Verify that clicking "Proceed Sync" inside the modal correctly triggers the POST request to
route('hr.biometric-attendance.sync-all')with the{ overwrite }payload, then closes the modal on success.
- Verify that clicking "Proceed Sync" inside the modal correctly triggers the POST request to
Verification Checklist
- UI Audit: Verify the button is named "Sync to Attendance Records".
- Table Actions Audit: Check that the individual "Sync" button is gone from the table rows.
- Confirmation Dialog Verification: Click the button, confirm the modal pops up, toggle "Overwrite", and verify the sync completes successfully when clicking "Proceed".