Fix web UI priority query param parsing - empty string causes Invalid priority error

t-146·WorkTask·
·
·
·Omni/Jr/Web.hs
Created3 months ago·Updated3 months ago

Description

Edit

Problem: HTML forms send empty string for 'All' option (value=""), causing FromHttpApiData to fail parsing.

Fix options: 1. Make FromHttpApiData instances return Left for empty strings (Servant treats Left as 'param not provided' for QueryParam Maybe) 2. Use JavaScript to remove empty params before form submit 3. Change form to use a sentinel value like 'all' instead of empty string

Recommended: Option 1 - simplest, no JS needed. Update parseQueryParam in Core.hs to check T.null and return Left with descriptive message.

Tests needed:

  • Unit test: parseQueryParam on empty string returns Left
  • Unit test: parseQueryParam on valid values (P0-P4, Open/InProgress/Done) returns Right
  • Integration: Web filter form with 'All' selected doesn't error

Timeline (0)

No activity yet.