Skip to content
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

External Form Upload: Display import summary / errors #1208

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

khiga8
Copy link
Contributor

@khiga8 khiga8 commented Dec 2, 2024

🔗 Issue

#1112

✍️ Description

This PR displays import summary feedback when a file is uploaded through the external form upload.

  • I opted to display a visually prominent banner right below the attach control, rather than top of the page. This banner is injected via turbo (following rec in Staff Dashboard - External Form Upload: Display import summary / errors #1112), and the page doesn't reload, so I believe placing it right by the control that the user just interacted with would make it more visible.
  • A red banner is shown for an error state, and a green banner is shown for a success state.
  • I set a role="alert" on the heading of the dynamically injected content, so that assistive technology users, such as screen reader users, are made aware of this new content via announcement when it's added to the page.

📷 Screenshots/Demos

Screenshot of green success banner placed below the upload control with the heading, 'File successfully scanned' Screenshot of red error banner placed below the upload control, with the heading, 'File scanned: 1 error(s) present'

@@ -13,6 +13,7 @@ def initialize(file)
end

def call
# Validate that file is in CSV format before we read from it.
Copy link
Collaborator

@jmilljr24 jmilljr24 Dec 5, 2024

Choose a reason for hiding this comment

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

@khiga8 Thanks for pointing this out! This started a discussion in our last meeting about other validations we should be checking for in this service. I opened PR #1211 which adds a file type validation and checks for the correct headers.

Hopefully I didn't step on your toes, but I figured the validations were outside the scope of this issues and didn't want to cause any confusion or add more work. If you have a better way to validate though I'd love to see it!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is great! Thank you :)

@khiga8 khiga8 changed the title [work in progress] External Form Upload: Display import summary / errors External Form Upload: Display import summary / errors Dec 15, 2024
@khiga8 khiga8 marked this pull request as ready for review December 15, 2024 23:32
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.

2 participants