Conversation
The modal now imports field definitions, mappings, and rendering logic from `ComplaintModalConfig.tsx`. Inline `renderField` implementation and type declarations have been removed, simplifying maintenance and adding support for new train complaint types.
… consolidate field handling
…de and debug state
There was a problem hiding this comment.
Pull request overview
This PR enhances the complaint form functionality with a modular, comprehensive form system that supports multiple complaint types and integrates with government transportation APIs.
Changes:
- Implemented a modular form architecture with type-specific field configurations
- Integrated government transportation APIs for operators, lines, stations, and cities
- Added comprehensive form validation and error handling
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ComplaintModalForms.tsx | Defines complaint type mappings with field configurations and government API schemas |
| ComplaintModalFields.tsx | Implements reusable form field components with validation rules and title generation |
| ComplaintModal.tsx | Refactored modal with dynamic form rendering, API integration, and state management |
| ComplaintModal.stories.tsx | Updated Storybook configuration with route data for testing |
| BusToolTip.tsx | Moved complaint button outside easter egg and added bus-type filtering |
| useFormQuerys.ts | Custom hooks for fetching government transportation data |
| locale files (he.json, en.json, ru.json) | Added translations for new form fields and complaint types |
| App.scss | Increased z-index for dropdown components to fix layering issues |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/pages/components/map-related/MapLayers/ComplaintModalForms.tsx
Outdated
Show resolved
Hide resolved
src/pages/components/map-related/MapLayers/ComplaintModalFields.tsx
Outdated
Show resolved
Hide resolved
NoamGaash
left a comment
There was a problem hiding this comment.
Observations -
- you have removed the "complaint" easter egg. Is it on purpose? Are we sure that we want to expose this button to everyone? Maybe we can do some more tests before exposing it to the public. We can create a google form and ask friends and colleagues to help us with real data to perform some more e2e manual tests with against the MOT production.
- I tried to do the following:
- made sure that the
debugflag is activated - sent a test complaint
- copied the
xmlfrom the response payload of thesendendpoint - tried to use
יבאin the actual form.
I can see the following error, which can indicate that we might have date formatting issue:
- made sure that the
Uncaught TypeError: Cannot read properties of null (reading 'getFullYear')
at FormScripts_combined.js:2106:10422
at a (FormScripts_combined.js:62:19000)
at s.Ub.ft [as La] (FormScripts_combined.js:62:18752)
at t.notifySubscribers (FormScripts_combined.js:62:13382)
at t.W (FormScripts_combined.js:62:15227)
at t (FormScripts_combined.js:62:15116)
at l (FormScripts_combined.js:69:5424)
at FormScripts_combined.js:69:4891
at g (FormScripts_combined.js:69:6122)
at l (FormScripts_combined.js:69:4584)
but despite a very broken layout, seems like we do capture most of the essential fields:
|
nice to have - when |
lets do this in anothers pr |
|
@NoamGaash, I’m going to proceed with merging and working on a new compliant submission version in a different PR. This will not negatively impact any other aspects of the project. You be good with this? |
list of complient (he)
Server PR #20