fix(#3602): FileUploadInput error state to match FileUploadCard#3842
fix(#3602): FileUploadInput error state to match FileUploadCard#3842willcodeforcoffee wants to merge 1 commit intodevfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
c881917 to
6490d79
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the goa-file-upload-input web component to present validation errors using the same goa-file-upload-card UI as FileUploadCard, and adds Angular/React PR demo routes for bug #3602.
Changes:
- Render
FileUploadInputvalidation issues asgoa-file-upload-cardinstances (including size/type metadata). - Update
FileUploadInputunit tests to assert the new issue rendering format. - Add PR demo routes/pages for Angular and React to reproduce/verify bug #3602.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/web-components/src/components/file-upload-input/FileUploadInput.svelte | Switches issue rendering to goa-file-upload-card and adds delete-to-dismiss behavior. |
| libs/web-components/src/components/file-upload-input/file-upload-input.spec.ts | Updates tests to look for the new issue card test ids. |
| apps/prs/react/src/routes/bugs/bug3602.tsx | Adds a React demo page showcasing FileUploadInput + FileUploadCard together. |
| apps/prs/react/src/app/routes/bugs/bug3602.route.ts | Registers the React demo route. |
| apps/prs/angular/src/routes/bugs/3602/bug3602.route.json | Registers the Angular demo route metadata. |
| apps/prs/angular/src/routes/bugs/3602/bug3602.component.ts | Adds an Angular demo component for the scenario. |
| apps/prs/angular/src/routes/bugs/3602/bug3602.component.html | Adds the Angular demo template displaying uploaded cards. |
|
@copilot apply changes based on the comments in this thread |
Applied all changes from the review thread in commit
|
8b50b90 to
5496f96
Compare
5496f96 to
7d63a4d
Compare
|
Preview links
Built from commit aeaba12. Previews are removed automatically when this PR closes. |
7d63a4d to
e4bfd74
Compare
bdfranck
left a comment
There was a problem hiding this comment.
I looked at the changes...
- ✅ When I attempt to upload a file that exceeds the limits, I see the error on the file card.
- ✅ I don't see the error message below the drag-and-drop upload input.
- ✅ The error message aligns with our "File too large" error message content guidelines.
Looks good to me! 👍
|
@ArakTaiRoth ready for merge when you are! 🙏 |
|
@Spark450 In the story attached to this PR, you have "The FileUploadCard component is documented as a "subcomponent" and is not surfaced for users that may want to use it independently from the uploader. There should be examples that show both uploader and uploader cards." I just want to check about this, as this requirement doesn't make sense to me. Reading this implies to me that we have File Upload Card as a completely separate component from File Upload Input and documented as such. That doesn't make sense to me because Card is only meant to be used with Input, and is not intended to be used independently. As this isn't included in the Acceptance Criteria, I just want to make sure that this is a mistake and not intended to be taken this way? |
| files: UploadedFile[], | ||
| detail: GoabFileUploadOnDeleteDetail, | ||
| ): UploadedFile[] { | ||
| const index = files.findIndex((f) => f.filename === detail.filename); |
There was a problem hiding this comment.
Here you're deleting files based off of filename while they're tracked in the html file by id. If 2 files have the same filename (which would work because tracked by id), deleting the second item will remove the first matching item instead of the one selected.
This doesn't happen in the React playground, because it deletes via id and tracks via id.
There was a problem hiding this comment.
@ArakTaiRoth Good point. It is just for the PR code, but I updated it.
Mark and I had discussed this. I was planning to do the documentation updates in a separate PR. That said, Vanessa just did a huge PR with a ton of documentation updates, including stuff for FileUploadInput and FileUploadCard and now I'm not sure its even necessary. |
…d format Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: willcodeforcoffee <3766866+willcodeforcoffee@users.noreply.github.com>
e4bfd74 to
aeaba12
Compare
@ArakTaiRoth There has been a use case surfaced to me a few times where a team would want to use the upload card without the uploader. For example a worker could be reviewing a submission that includes uploaded files. Designers have expressed interest in showing those uploaded file (cards) on the page of that submission. I think its likely that they would need a this new feature to round out what they would want to do though. |
Before (the change)
File upload errors were listed in a unique state, which could cause them to not be visible when used in conjunction with the
FileUploadCards.After (the change)
File upload errors are listed in the same format as FileUploadCard.
Make sure that you've checked the boxes below before you submit the PR
Steps needed to test