Open jmilljr24 opened 2 weeks ago
Hi! Can I pick this one up?
@khiga8 Just checking in to see how this is going. No pressure.
Hey there! Planning to dig into this in the next week! Hope that's okay :)
Hey there! Planning to dig into this in the next week! Hope that's okay :)
Absolutely!! Thank you
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:import.success?
will return true or falseimport.count
returns the number of form submissions successfully added to the DBimport.errors
returns a nested array with each error having the row number and the errorThis 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