rubyforgood / homeward-tails

Homeward Tails is an application making it easy to link adopters/fosters with pets. We work with grassroots pet rescue organizations to understand how we can make the most impact.
MIT License
70 stars 117 forks source link

Staff Dashboard - External Form Upload: Display import summary / errors #1112

Open jmilljr24 opened 2 weeks ago

jmilljr24 commented 2 weeks ago

Staff can upload a csv file with form submission data. This data is matched to people in the DB. Currently staff can upload the file but there is no indication in the UI for success or any errors.

In the ExternalFormUploadController, use the data returned from the import service to display a separate card below the upload form that gives a summary of the import. This should be implemented using turbo_frames.

This is just a rough example. Feel free to play around with what looks best. It may even make sense to use two cards. Maybe display one for Success information and conditionally display a second card if errors are present?

Use green for the Success title and Red for the Errors title. It may be worth added a flash notice/alert as well, as the summary card may not be visible on a smaller screen until you scroll down.

The import service returns a Data object Data.define(:success?, :count, :no_match, :errors). For this PR the following should be used:

Screenshot from 2024-11-02 07-14-28

This file should result in a successful upload. A simple way to create an error is to change one of the timestamps to have month "13" which is out of range "2024-13-03 08:09:10 -0400" test_google_upload.csv

khiga8 commented 2 weeks ago

Hi! Can I pick this one up?

jmilljr24 commented 4 days ago

@khiga8 Just checking in to see how this is going. No pressure.

khiga8 commented 2 days ago

Hey there! Planning to dig into this in the next week! Hope that's okay :)

jmilljr24 commented 2 days ago

Hey there! Planning to dig into this in the next week! Hope that's okay :)

Absolutely!! Thank you