MobilityData / mobility-feed-api

Apache License 2.0
9 stars 3 forks source link

feat: add feed form, conditional functionality + submit #737

Closed Alessandro100 closed 1 month ago

Alessandro100 commented 2 months ago

closes #657 and #738 Summary:

Dynamic form behaviour for add new feed.

Ability to submit the form to google sheet

Expected behavior:

The form should display different fields for gtfs and gtfs_rt The third page should be the same for both If "update feed" for rt, show 3 more fields All required fields will show errors if not provided For RT an error will show if no feeds are entered Ability to submit the form

Testing tips:

Go through the add-feed form and see if anything is un clear or glitchy functionality. Once you submit the form, you should be able to see the data in the DEV google sheet https://docs.google.com/spreadsheets/d/1iXwux9hM4p5Li1EGgwx-8hU3sMDnF15yTflqmGjiZqE/edit?gid=0#gid=0

Please make sure these boxes are checked before submitting your pull request - thanks!

Screenshot 2024-09-11 at 09 16 06 Screenshot 2024-09-11 at 09 17 06 Screenshot 2024-09-11 at 09 17 10 Screenshot 2024-09-11 at 09 17 19 Screenshot 2024-09-11 at 09 17 26 Screenshot 2024-09-11 at 09 17 32

github-actions[bot] commented 2 months ago

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-737-zb89ptxr.web.app

davidgamez commented 2 months ago

I noticed that there is no URL validation for the feed link in the first step. Let's add it as a basic validation to prevent bad data from being submitted.

davidgamez commented 2 months ago

[out of scope]: It would be nice to add a reCaptcha component before submitting the form to prevent "robot" submissions.

Alessandro100 commented 2 months ago

I noticed that there is no URL validation for the feed link in the first step. Let's add it as a basic validation to prevent bad data from being submitted.

I was talking with @emmambd about validating a feed link and apparently these links can vary. What could be a good validation that wouldn't have false positives?

davidgamez commented 2 months ago

I noticed that there is no URL validation for the feed link in the first step. Let's add it as a basic validation to prevent bad data from being submitted.

I was talking with @emmambd about validating a feed link and apparently these links can vary. What could be a good validation that wouldn't have false positives?

At least it needs a URL like {HTTP, HTTPS, FTP}://www.mydata.org. I added abc, and I was able to submit the form. If it's not a properly formatted URL, we cannot process it anyway. But maybe I'm missing something here.

Alessandro100 commented 1 month ago

@emmambd my hesitation for adding license to page 2 is that for real time the page could get very busy if it's an update image

The way I see the form Step 1: Basic details Step 2: GTFS / RT specific details Step 3: Additional details Step 4: producer information

I think license on step 3 makes sense. We could also potentially use page 3 in the future to ask more questions as feeds evolve

github-actions[bot] commented 1 month ago

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-737-212h2xgg.web.app

emmambd commented 1 month ago

@Alessandro100 That's a good point - page 3 works for me!