feat(projects,sla): accept H:MM / fractional hours in Budget Hours and SLA times (PMS-340) #171

Merged
longjacksonle merged 1 commit from feat/PMS-340-duration-fields-hhmm into main 2026-06-16 00:19:34 +02:00

Implements PMS-340.

Problem

Follow-up to PMS-314 / PMS-319. The remaining duration-in-hours inputs were bare <input type="number"> with no step, so the browser blocked fractional entry like 1.5 (the PMS-233 root cause) and could never accept H:MM.

Changes

  • src/pages/projects.rs (Budget Hours, create + edit): switched from type="number" to free-text with placeholder + help; parses via parse_input_to_hours (blank clears it; unparseable value errors inline instead of being dropped); edit form pre-fills via fmt_input_hours. Budget Amount (USD) is unchanged (still validate_budget).
  • src/pages/sla.rs (first-response + resolution times, per priority): inputs switched to free-text; parse_hours now also accepts H:MM, reusing the shared minute parser for validation and converting to an exact rust_decimal::Decimal (a plain decimal still parses exactly), so SLA targets keep Decimal precision.

Verification

just pre-commit (pinned rust 1.94 = CI) passes: fmt, clippy -D warnings, cargo check --target wasm32-unknown-unknown, all 91 lib tests.

Acceptance criteria

  • Project Budget Hours (create + edit) accepts 1.5 and 1:30, persists, and rejects malformed input with an inline error.
  • SLA first-response and resolution times accept 1.5 and 1:30 and persist.
  • Non-duration numeric fields (rates, amounts, multipliers) left unchanged.
  • Fractional entry works in the browser for all of the above (the old type="number" blocked it).

🤖 Generated with Claude Code

Implements PMS-340. ## Problem Follow-up to PMS-314 / PMS-319. The remaining duration-in-hours inputs were bare `<input type="number">` with no `step`, so the browser blocked fractional entry like `1.5` (the PMS-233 root cause) and could never accept `H:MM`. ## Changes - `src/pages/projects.rs` (Budget Hours, create + edit): switched from `type="number"` to free-text with placeholder + help; parses via `parse_input_to_hours` (blank clears it; unparseable value errors inline instead of being dropped); edit form pre-fills via `fmt_input_hours`. Budget Amount (USD) is unchanged (still `validate_budget`). - `src/pages/sla.rs` (first-response + resolution times, per priority): inputs switched to free-text; `parse_hours` now also accepts `H:MM`, reusing the shared minute parser for validation and converting to an exact `rust_decimal::Decimal` (a plain decimal still parses exactly), so SLA targets keep Decimal precision. ## Verification `just pre-commit` (pinned rust 1.94 = CI) passes: fmt, clippy `-D warnings`, `cargo check --target wasm32-unknown-unknown`, all 91 lib tests. ## Acceptance criteria - [x] Project Budget Hours (create + edit) accepts `1.5` and `1:30`, persists, and rejects malformed input with an inline error. - [x] SLA first-response and resolution times accept `1.5` and `1:30` and persist. - [x] Non-duration numeric fields (rates, amounts, multipliers) left unchanged. - [x] Fractional entry works in the browser for all of the above (the old `type="number"` blocked it). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(projects,sla): accept H:MM / fractional hours in Budget Hours and SLA times (PMS-340)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 57s
Create release / Create release from merged PR (pull_request) Has been skipped
ff30f58124
Follow-up to PMS-314 / PMS-319. The remaining duration-in-hours inputs were bare <input type="number"> with no step, so the browser blocked fractional entry like 1.5 (the PMS-233 root cause) and could never accept H:MM. They now match the fixed fields.

projects.rs: the Budget Hours field (create + edit) switches from type="number" to free-text with a placeholder/help, parses via crate::utils::duration::parse_input_to_hours (blank clears it; an unparseable value errors inline instead of being dropped), and the edit form pre-fills via fmt_input_hours. Budget Amount (USD) keeps validate_budget; only the hours field changed.

sla.rs: the first-response and resolution time inputs (per priority) switch to free-text. parse_hours now also accepts H:MM, reusing the shared minute parser for validation and converting to an exact rust_decimal::Decimal (a plain decimal still parses exactly as before), so SLA targets keep Decimal precision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/PMS-340-duration-fields-hhmm 2026-06-16 00:19:34 +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!171
No description provided.