Skip to content

feat: enhance compliant form#1300

Open
AvivAbachi wants to merge 86 commits intomainfrom
feat/complent-form
Open

feat: enhance compliant form#1300
AvivAbachi wants to merge 86 commits intomainfrom
feat/complent-form

Conversation

@AvivAbachi
Copy link
Copy Markdown
Collaborator

@AvivAbachi AvivAbachi commented Sep 27, 2025

list of complient (he)

Server PR #20

  • Client: Build a modular Form
  • Client: Fix Stories
  • Server: Update the schema
  • Server: Implement the TemplateBuild for the complaint base type
  • Package: Update the client API to reflect the new schema
  • Client: Update the client API + Integrated To API
  • Server: Fix XML
  • Client: Error Handeling
  • Client: Fix submit data

Copy link
Copy Markdown
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far it looks great!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 15, 2025

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.
@AvivAbachi AvivAbachi requested a review from NoamGaash January 20, 2026 22:57
@NoamGaash NoamGaash requested a review from Copilot January 23, 2026 11:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observations -

  1. 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.
  2. I tried to do the following:
    • made sure that the debug flag is activated
    • sent a test complaint
    • copied the xml from the response payload of the send endpoint
    • tried to use יבא in the actual form.
      I can see the following error, which can indicate that we might have date formatting issue:
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:

Image

@NoamGaash
Copy link
Copy Markdown
Member

nice to have - when debug is true, we can have a button to download the xml for self submission in the MOT website

@AvivAbachi
Copy link
Copy Markdown
Collaborator Author

nice to have - when debug is true, we can have a button to download the xml for self submission in the MOT website

lets do this in anothers pr

@AvivAbachi
Copy link
Copy Markdown
Collaborator Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants