BCStudentSoftwareDevTeam / celts

Web app to support the CELTS program at Berea College
BSD 3-Clause "New" or "Revised" License
1 stars 8 forks source link

1115 event attachment filenames #1116

Closed hoerstl closed 5 months ago

hoerstl commented 5 months ago

Issue: Fixes #1115. When files are displayed to the user they are displayed with the event ID as part of the file's path. This ought not to be visible to users and adds too much irrelevant information to the screen. We'd like to remove this event ID and use the original filename. Additionally, we abbreviate the filenames of uploaded files for formatting which makes us unable to properly distinguish them later. To fix this, we needed to add a tooltip with the full filename listed.

Solution: I've removed the odd prefix from the filenames by altering the displayFiles macro. Additionally, I've added the tooltip and fixed a small bug where duplicate filenames didn't stop you from adding a file until you saved the page. Now they stop you from uploading a file and it provides you with immediate feedback.

To Test: Go to any event and upload a file. Save the event and ensure that what is displayed is the filename (possibly shortened) without the event ID. Check the tooltip and assert that it correctly displays the unshortened filename.

Additionally, prepare a different file and upload it once before saving the event. Now that it's saved, try to upload it again and ensure that you can't and that a message is displayed communicating the file duplication as the root cause of the failure.

As there are two places where the display files macro is used, a tester should also navigate to the course proposals page and upload a file to any course proposal. I shouldn't have changed anything here so play with the name and make sure that no prefix is removed from these files. We only add the folder to the filename behind the scenes for event attachments. If someone wants to upload a weird filename to the slc proposal page we should let them.

github-actions[bot] commented 5 months ago

View Code Coverage