feat(timesheets): submit-certification modal and withdraw action (PMS-183) #114

Merged
longjacksonle merged 1 commit from feat/mapps-183-timesheet-withdraw into main 2026-06-11 04:57:44 +02:00

What

SPA half of PMS-183: a submit-confirmation modal with a required certification checkbox, and a Withdraw action for a submitted-but-not-approved timesheet.

Depends on mokosh-server PR #157 (the draft state + withdraw endpoint).

Changes

  • Submit no longer fires immediately. It opens a confirmation modal explaining the submission and a required certification checkbox ("I certify that the timesheet I am submitting is correct"); the modal's Submit button is disabled until the box is ticked.
  • A submitted (pending) week shows a Withdraw button that calls POST /timesheets/{user_id}/{week_start}/withdraw to pull the week back to draft.
  • The status badge maps the new draft state to "Not submitted" and pending to "Pending approval".
  • Submit and Withdraw both restart the summary + entries resources, so the state transition shows without a manual refresh.

Acceptance criteria

  • Submitting opens a confirmation modal with a certification checkbox; Submit is disabled until it is checked.
  • A submitted, not-yet-approved timesheet can be cancelled / withdrawn back to draft.
  • Withdraw is restricted to the owner and rejected once the timesheet is approved (enforced server-side in #157).
  • State transitions are reflected in the UI without a manual refresh.

🤖 Generated with Claude Code

## What SPA half of PMS-183: a submit-confirmation modal with a required certification checkbox, and a Withdraw action for a submitted-but-not-approved timesheet. Depends on mokosh-server PR #157 (the `draft` state + withdraw endpoint). ## Changes - **Submit** no longer fires immediately. It opens a confirmation modal explaining the submission and a **required certification checkbox** ("I certify that the timesheet I am submitting is correct"); the modal's Submit button is **disabled until the box is ticked**. - A submitted (pending) week shows a **Withdraw** button that calls `POST /timesheets/{user_id}/{week_start}/withdraw` to pull the week back to draft. - The status badge maps the new `draft` state to **"Not submitted"** and `pending` to **"Pending approval"**. - Submit and Withdraw both restart the summary + entries resources, so the state transition shows without a manual refresh. ## Acceptance criteria - [x] Submitting opens a confirmation modal with a certification checkbox; Submit is disabled until it is checked. - [x] A submitted, not-yet-approved timesheet can be cancelled / withdrawn back to draft. - [x] Withdraw is restricted to the owner and rejected once the timesheet is approved (enforced server-side in #157). - [x] State transitions are reflected in the UI without a manual refresh. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(timesheets): submit-certification modal and withdraw action (PMS-183)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 50s
Create release / Create release from merged PR (pull_request) Has been skipped
d40e5cb398
Submitting a timesheet now opens a confirmation modal with a required certification checkbox ("I certify that the timesheet I am submitting is correct") that gates the Submit button. A submitted (pending) week shows a Withdraw button that POSTs the new withdraw endpoint to pull it back to draft; the badge maps the new draft state to "Not submitted" and pending to "Pending approval". Both actions restart the summary and entries resources so the state change shows without a manual refresh. Depends on mokosh-server #157.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/mapps-183-timesheet-withdraw 2026-06-11 04:57:44 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
psa-systems/mokosh-apps!114
No description provided.