4821 part2 partner profile remove attached docs#5090
Conversation
|
Hey @danielabar -- you've got this as "resolves', but said in the issue that there would be 3 steps -- which is it? |
Sorry about that, it's a partial solution, part 2 of 3. Updated PR description. |
|
@danielabar Would it be trivial to show the names of the files chosen when you choose multiples, where it currently says "2 files" if you've selected two? We show the name if only one is chosen. (If it's not trivial, we could leave it and see if anyone complains) Other than that, it looks pretty good! |
I'll look into it, that's a native file input. According to MDN on file input:
I tried selecting multiple files, then selecting that file input in browser dev tools to check it's So it's a matter of how to expose this in the UI, might be possible with some JavaScript in a Stimulus controller. Will investigate further... |
|
@cielf Display of multiple file selection has been added. |
|
For future, if I ask if it's trivial, it's probably a "nice to have" so I'd rather you didn't spend too much time on it -- we can probably use your talents better elsewhere! (though it looks like you didn't have to spend a lot of time on this one) I've run out of time for HE today -- so it'll be tomorrow or Friday before I get to this. |
|
No worries, was about an hour, and interesting to learn about the |
| } | ||
|
|
||
| const ul = document.createElement("ul"); | ||
| ul.classList.add("list-unstyled", "mt-2"); |
There was a problem hiding this comment.
This is a fine way to do it, but thinking to myself here I wish we didn't need the mt-2; seems like it might later be harder to maintain.
There was a problem hiding this comment.
I tried removing the mt-2 and it looks fine. This has already been merged but there's still a Part 3 for this issue, so I can remove the extra margin in that PR.
awwaiid
left a comment
There was a problem hiding this comment.
Looks good and good tests!
|
@danielabar: Your PR |

Partial solution for #4821
Description
This is for part 2 of incremental improvements to editing partner profile Attached Documents section.
It adds a "Remove" button beside each attached document in the partner profile, allowing user to remove any individual document(s). Changes are persisted when they click Save Progress.
It makes use of the existing method
remove_element_buttoninapp/helpers/ui_helper.rb, along with a few styling adjustments to align the file listing and Remove action.Update 2025-03-12: As per PR comment, added display of file names if user selects more than one. See second screenshot below.
Type of change
How Has This Been Tested?
Automated test:
spec/system/partners/profile_edit_system_spec.rb->it "allows removal of attached documents"...Manual test:
Screenshots