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

File upload: alert when a file could not be added for upload #478

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ErykKul
Copy link
Contributor

@ErykKul ErykKul commented Sep 4, 2024

What this PR does / why we need it:

With each upload, all files need to have a unique combination of the label (directory) and the file name. Until now, when adding the same file (as already present in the list of files to be added at the bottom of the file upload page), it is silently ignored and is not uploaded. This PR adds an alert on the top of the page when this happens to notify the user that the file could not be added.

Note that you can still add the same file multiple times to the dataset by uploading them one by one. The upload page does not check the file names of the files already present in the dataset. When the same file is uploaded again, it is handled in the standard way by the Dataverse API and gets the "-1" suffix, e.g., after adding "test.json" twice, you will have two files in the dataset: "test.json" and "test-1.json".

Which issue(s) this PR closes:

Special notes for your reviewer:

Suggestions on how to test this:

Add the same file for upload twice, when adding second time (and the previously added files is still in the list of the files to be added at the bottom of the upload page), an alert should be shown (and the file is not added second time).

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

@coveralls
Copy link

Coverage Status

coverage: 97.424% (+0.02%) from 97.406%
when pulling b9dff2c on 467-feature-requestidea-better-handling-of-duplicate-files-when-adding-files-to-upload
into 08511d7 on develop.

@g-saracca g-saracca added Size: 3 A percentage of a sprint. 2.1 hours. SPA: File Upload Page SPA FY25 Sprint 4 FY25 Sprint 4 FY25 Sprint 5 FY25 sprint 5 labels Sep 9, 2024
@g-saracca
Copy link
Contributor

Hi @ErykKul, after discussing with the team we thought it was a good idea to discuss about this behavior change with the rest of the team.
The behavior you propose here is to show an alert for each duplicate file but if you have several duplicates the UI and UX will not be really good, I think we need to come up with a better idea.
Note that currently in the JSF version, duplicate files are also being uploaded and there is a modal that shows the duplicate files (by name or content) and the option for the user to delete them, maybe we don't want to lose that feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 4 FY25 Sprint 4 FY25 Sprint 5 FY25 sprint 5 Size: 3 A percentage of a sprint. 2.1 hours. SPA: File Upload Page SPA
Projects
Status: Ready for Review ⏩
Development

Successfully merging this pull request may close these issues.

Feature Request/Idea: better handling of duplicate files when adding files to upload
3 participants