DEV - validate filters form and load SR data on form submit
Overview
We need data to be loaded when users submit a query with search criteria rather than on page load, per Blank Map user flows.
More Info
On page load, we are loading the entire 2025 (or current year) dataset. This is an instance of overfetching, we have loaded more data into memory than we intend to use. The design team has provided us user flows on how to discourage overfetching by requiring users to select all search criteria before submitting their data fetch:
Click to see: π Helpful abbreviations
SR = service request NC = neighborhood council
Click to see: π All filter criteria
- ποΈ Neighborhood Council
- address search can select a neighborhood council IFF the searched address falls within an NC
- the neighborhood council dropdown will also result in the selection of a neighborhood council
- π Date Range
- user selects a start-date and end-date from these dropdowns
- π― Request Types
- user must select at least one option in this multi-select
- π Request Status
- user must select at least one option in this multi-select
What Not to Implement
Click to see: β Which features are NOT part of this ticket
This ticket will NOT implement:
- filtering HF or socrata data:
- https://github.com/hackforla/311-data/issues/2013
- https://github.com/hackforla/311-data/issues/1937
- updated date-selector
- https://github.com/hackforla/311-data/issues/1868
- address form bugs
- https://github.com/hackforla/311-data/issues/1931
- map zoom behavior changes
- https://github.com/hackforla/311-data/issues/1989
- new confirmation modals, error modals
- e.g. within "Finalized Handoff": https://github.com/hackforla/311-data/issues/1944#finalized-handoff
- new modals incoming
- https://github.com/hackforla/311-data/issues/2010
- https://github.com/hackforla/311-data/issues/2009
Action Items
Dev Todo Items
Modify Form Elements
- [x] Add a new button, "Display Data"
- [x] Modify export button to appear under "Display Data"
- [x] Request status selection now is a multi-select (rather than Open, Closed, All radio buttons)
Modify Form Controls
- [x] Display Data button triggers form validation error messages if any validation is un-met, only fetches data if there are no validation errors
- [x] export button becomes disabled until data is successfully fetched and loaded
Add Form Validations (see Developer Resources: Input Validation)
- [x] either address search or Neighborhood Council dropdown valid input required (e.g. one and only one NC must be selected)
- [x] a start date and end date must be selected
- [x] If both are missing β "Please select a date range"
- [x] If only start date is missing β "Please select a start date"
- [x] If only end date is missing β "Please select an end date"
- [x] at least one request type should be selected
- [x] at least one request status should be selected
Modify Data Flow
- [x] Remove data from being loaded in
- [x] Hook up the Display Data button's on-click to Redux so that it triggers data to be downloaded
createRequestsTable()andsetData()can be called when this Redux action is called
Ticket Bookkeeping
- [ ] https://github.com/hackforla/311-data/issues/1989
- [x] remove the dependency label
- [ ] move the ticket to New Issue Approval
- [x] add "ready for dev lead" label
Resources/Instructions
Developer Resources: Input Validation
Click to see details on: π¨ Form validation elements
Error Hexcode
#DE2800#DE2800Screenshot with designer notes on validation
![]()
Screenshot of validation errors, zoomed in
![]()
Related Tickets
- https://github.com/hackforla/311-data/issues/1868
Figma
- Figma Section: Hand-Off - Issue #1944
- Related Design Ticket: https://github.com/hackforla/311-data/issues/1944
Screenshots
Screenshot before proposed changes
Screenshot of Figma
Entire Flow (reference only)
Entire Flow (filtered for #2035 dev requirements)
Search and Filters Modal (annotated)
- section in yellow designates that we do not need to implement new date-picker styles (see What Not to Implement)
Screenshot of new feature from localhost
[insert screenshot here]
Wanted to confirm that the screenshot under Entire Flow (reference only) is the old flow, and I should base this new implementation on the figma screenshot in Entire Flow (filtered for #2035 dev requirements). Essentially going to get rid of those loading modals as well (on top of the defined action items)?
TLDR: the sections in red is work marked for future dev tickets (and some future design+dev tickets). This user-flow is quite large, and so we are needing to do partial handoffs to keep work manageable for individual volunteers.
@githelsui I've updated Entire Flow (filtered for #2035 dev requirements) to indicate that the parts marked in red are for future tickets. For full context on the Blank Map flow, see the following resources:
- https://github.com/hackforla/311-data/issues/1943
- https://github.com/hackforla/311-data/issues/1848
- (see dropdown below to peek at low-fidelity user flow)
- https://github.com/hackforla/311-data/issues/1848
Hopefully that puts this ticket's Figma designs into context. If you follow #1944's Figma from section to section, you can see how it implements the low-fidelity user-flow.
Click to see: Low fidelity blank map user flow
Lastly, @githelsui please provide your initial update:
Instructions
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures (if necessary): "Add any pictures that will help illustrate what you are working on."
- ~Progress:~
- Blockers:
- Availability:
- ETA:
- ~Pictures (if necessary):~
@ryanfchase Thanks for providing that clarification! The diagram is now easier to follow and it is helpful to know how this ticket fits into the larger scope of the user flow.
Progress:
- Feature Branch: /2035-validate-filters-form-load-sr
- Section 1: Modified Form Elements
- Changes from latest push: Commit c98baa2
- Added new "Display Data" button
- Modified "Export" button
- Todo:
- Update Request Status Selection to multi-select
- Changes from latest push: Commit c98baa2
Blockers:
- N/A
Availability: Fri-Sun
ETA: 2 wks
Pictures:
Pictures
@githelsui per design team, they've asked that we make the start/end date validation message as follows:
- If both start date & end date are missing β "Please select a date range"
- If only start date is missing β "Please select a start date"
- If only end date is missing β "Please select an end date"
I have updated the Action Items in the main ticket to reflect this. I don't think it will affect scope too greatly, but let me know if you are concerned. Thanks!
@ryanfchase Thanks for the updates. The details for the new date validation is easy to follow. Will reach out if I run into any other blocks.
Hey @githelsui , we've added action items, "Ticket Bookkeeping" to help us manage the project board after you've completed your action items. If you have any questions, @ryanfchase can help you with that once you get there. Thank you!
Progress:
Feature Branch: /2035-validate-filters-form-load-sr Section 1: Modified Form Elements
- Updated Request Status Selection to multi-select
Blockers: N/A
Availability: Fri-Sun
- Note: Wonβt have as time to work on this as it's been extremely busy time at work and need to do overtime some days for it.
ETA: 2 wks
Pictures:
Progress:
Feature Branch: /2035-validate-filters-form-load-sr
COMPLETED:
- Section 2: Modified Form Control
- Display Data button triggers form validation error messages
- Section 3: Added Form Validations
- Address OR Council Validation
- Request Type Validation
- Request Status Validation CURRENT TO- DO
- Date Range Form Validation
- Disable Export Button
Blockers:
- Section 3: Date Range Form Validation:
- @ryanfchase The current DateSelector does not have a way for me to test a case where there is no startDate or endDate as the DatePicker requires user to input these two regardless. What can I do in this case? I believe I am not suppose to update the DateSelector to the new design for this ticket, but I may have misunderstood.
Availability: Fri-Sun
Note: Wonβt have as time to work on this as it's been extremely busy time at work and need to do overtime some days for it. ETA: 2 wks
Pictures:
-
Select Display Data -> Invalid Form
-
Select Display Data -> Valid Form
Progress:
Feature Branch: /2035-validate-filters-form-load-sr
COMPLETED:
Section 2: Modified Form Control
- Export button disabled until data is fetched and loaded Section 4: Modified Data Flow
- Hooked up Display Data button from FilterMenu component to Redux to trigger data download
Blockers:
- Section 3: Date Range Form Validation (Continued)
- Section 4: Removing createRequestTable() and setData() from componentDidMount() causes page to stay stuck on loading modal on initial load of site
- Some issues with the new Display Data button trigger: - Loading time for new Display Button takes quite a while, not sure if this is normal (Pin load time: 153581 ms) - How to trigger zoom into selected address pin? My current version does not do this, but not sure if I need to implement that in this ticket [Ref Image 1].
[Ref Image 1] Image below of valid address without selected address pin on the map
Availability: Fri-Sun Note: Wonβt have as time to work on this as it's been extremely busy time at work and need to do overtime some days for it.
ETA: 2 wks
Pictures:
Disabled Export Button with Invalid Form
Enabled Export Button with Valid Form and Triggers Redux to Fetch Data
Console Show Printed Logs For:
- New redux action triggered by Display Data button: TRIGGER_DISPLAY_DATA
- Redux actions for getting DB requests: GET_DB_REQUEST_SUCCESS
- Redux action for resetting display data for the ability to make another query: RESET_DISPLAY_DATA
Progress:
Feature Branch: /2035-validate-filters-form-load-sr
COMPLETED: Section 2: Modified Form Control
- updated DateSelector and DatePicker to be empty (startDate, endDate = null) upon initial load
- Implemented UI errors for invalid form for empty date picker values
Section 3: Modified Data Flow
- createRequestsTable() and setData() are no longer being called upon initial website load
- updated initial state for isDbLoad to false for redux data.jsx to prevent loading modal from appearing on initial website load
TO-DO:
- Update DatePicker so that dates can be selected (currently blocked due to blank initial dates, refer to Blockers section for more details)
- Continue logic for Date Form Validation: need to account for if only start date, or if only end date is missing
Blockers:
- DateSelector will not allow user to select a date after my updates making the initial dates state empty/null
ETA: My work capacity has increased at my place of work so my availability for this ticket has decreased for the next week. Will continue to work on this ticket on my free hours (Fri, Sundays)
Pictures:
- Invalid Form Validation for all fields (now including Dates):
Progress:
Feature Branch: /2035-validate-filters-form-load-sr
COMPLETED:
- Accounted for date form validation:
- both start and end date are missing returns
Please select a date range - end date not selected returns
Please select an end date
- both start and end date are missing returns
- Resolved block regarding DateSelector not allowing user to select a date after updating the initial dates' state as empty/null for the blank map implementation
- Fixed by updating its child component
ReactDayPickerso that dates can be selected with edits to the onClick event
- Fixed by updating its child component
TO-DO:
- Continue logic for Date Form Validation, need to account for
- CASE: if only start date is missing (ReactDayPicker's first user selection will always bet he start date... applied this case's validation in the form validation but have not been able to test)
- Resolve bug with Search Address Section - flags as null input even with contents inside search bar after each Display Data click (need more time to look into this, related to a flag to manually check if content existed in search bar)
Blockers: N/A
ETA: My work capacity has increased at my place of work so my availability for this ticket has decreased for the next week. Will continue to work on this ticket on my free hours (Fri, Sundays)
Pictures:
DateSelector now able to initially load with empty dates, and user can now select dates:
DateSelector with only start date selected, but missing end date selection:
DateSelector missing both start date and end date selection:
Progress:
Feature Branch: /2035-validate-filters-form-load-sr
COMPLETED:
- Accounted for all date form validation cases:
- both start and end date are missing returns Please select a date range
- end date not selected returns Please select an end date
- start date not selected returns Please select a start date
TO-DO:
- Resolve bug with Search Address Section - flags as null input even with contents inside search bar after each Display Data click (need more time to look into this, related to a flag to manually check if content existed in search bar)
Blockers: Resolving bug with Address Section
ETA: My work capacity has increased at my place of work so my availability for this ticket has decreased for the next week. Will continue to work on this ticket on my free hours (Fri, Sundays)
Pictures:
Start Date Missing
Returns 'Please select a start date'
End Date Missing
Returns 'Please select an end date'
Both End and Start Date Missing
Returns 'Please select a date range'
Progress:
Feature Branch: /2035-validate-filters-form-load-sr
COMPLETED:
- Resolved bug regarding Search Address Section:
- Previous Error: When clearing search bar, form validation does not register the search bar as empty and incorrectly approves the form
- Solution: Include an event listener that listened to 'clear' events for the geocoder (search bar) and send an empty string to FilterMenu when this is triggered to indicate that the search bar has been cleared. This updates the form validation inputs required in the FilterMenu as well.
ETA: My work capacity has increased at my place of work so my availability for this ticket has decreased for the next week. Will continue to work on this ticket on my free hours (Fri, Sundays)
Pictures:
Resolved Bug
1. Valid search address Input 2. Select Display Data 3. Reset search address input 4. Successful form validation for empty search address after resubmission (Bug now resoled)