-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Staff Dashboard - External Form Upload: Display import summary / errors #1112
Comments
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 :) |
Absolutely!! Thank you |
Hey @jmilljr24! I noticed there are many potential outcomes when a CSV is uploaded. I feel like I took some notes on the different scenarios, and potential messages we could display. I wanted to check in with you to make sure these scenarios align with your understanding!
If anything looks off here, let me know! I also welcome any suggestions you have on the messages we provide! I crafted these based on best guess, but I may lack some context. For example, I'm not sure sure about what action (if any) we want the user to take in scenario 4 (where form submissions aren't added due to the e-mail not being recognized). |
@khiga8 I built the csv import service with a lot of assumptions. We do not have actual user data yet so changes will likely happen when we get feedback from our stakeholders in the near future. Your summary matches my train of thought of what information the service returns. Please let me know if I miss anything or need to explain better!! I do think for the time being we can keep what is displayed a bit simpler due to the good chance there will be changes happening. I viewed success as all or nothing as you state (specifically for errors). In the most basic sense if a user uploads a file and there are no errors they can move on in their work. For MVP we really don't even need to know "what" was imported, just that there were no issues with their file. Staff can go to a different location in the dashboard and see what adopters now have form questions/answers. If there are errors, Staff will need to know the error and potentially edit their csv to make it work. You can expand on this but I'd like to keep it flexible for future changes. Here are a couple of examples of what I would do below the upload form: A. B. C. D. Regarding #4, it is something we should probably have but that list could be excessively long for a new Organization first getting set up with this website. I say for now we can skip that unless you have a nice solution you would like to implement. Side note: We can certainly change what's being returned to the controller from the service if it makes things easier, just let me know. |
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
The text was updated successfully, but these errors were encountered: