Add choice of files to package for download for datasets over zip maximum #1956
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes datadryad/dryad-product-roadmap#3325
I think this solution is pretty elegant as it uses the same mechanisms for all datasets—it adds the ability to select files for packaging and download, then for datasets under the zip max, it hides the (checked) checkboxes and changes some text (so the experience remains as it currently is on production).
For datasets over the zip max, it allows you to select any files under the maximum, and as you select it disables checkboxes for files that, if you added them, would put you over the max.
While the ability to select/deselect all was requested, I have not implemented this as I can't think of a way to do it that makes sense while not allowing users to select more than the size limit—it would have to do something like start selecting all starting from the top but stop once the limit is reached, which I think might be frustrating and confusing.
The easiest way to test this is to adjust your dev or local
APP_CONFIG.maximums.zip_size
value way down (after doing this and restarting rails you may also need to hard refresh your browser to clear your javascript cache of the previous stored value)