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

Automatically trigger download of exported files #5418

Merged
merged 20 commits into from
Mar 14, 2024
Merged

Conversation

jorg-vr
Copy link
Contributor

@jorg-vr jorg-vr commented Mar 5, 2024

This pull request simplifies the download process of submission exports.

When a users clicks download after submitting the form, a loading bar will be shown while the backend is preparing the zip. Once this is done, the download is automatically triggered.

A retry button is shown, to use should the automatic download fail. ALso a go back button is added to easily return to the page where you came from.

Peek 2024-03-11 13-56

This pr removes the old page with the index of downloads. This is not seen as a relevant feature for dodona. A user should keep track of their downloads themselves.

I also removed the notification for when a download is ready.
I did some benchmarks and the expected zip speed > 100 submissions per second.
This means that for every normal usecase it should only take a few seconds and never more then a minute.
Downloading all 381 417submissions from Peters programming course does take an hour. If we want to keep async support for these cases, I can revert this.

Part of #3457

@jorg-vr jorg-vr added the enhancement A change that isn't substantial enough to be called a feature label Mar 5, 2024
@jorg-vr jorg-vr self-assigned this Mar 5, 2024
@jorg-vr jorg-vr marked this pull request as ready for review March 5, 2024 15:30
@jorg-vr jorg-vr requested a review from a team as a code owner March 5, 2024 15:30
@jorg-vr jorg-vr requested review from bmesuere and niknetniko and removed request for a team March 5, 2024 15:30
Copy link
Member

@niknetniko niknetniko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also want to handle the case where the download doesn't happen or isn't successful? For example, if you have your browser set to ask where a download should be saved and you press cancel, the button still says downloaded, and there is no way I see to download again (except going back through everything).

config/locales/js/nl.yml Outdated Show resolved Hide resolved
@jorg-vr
Copy link
Contributor Author

jorg-vr commented Mar 6, 2024

Hmm, maybe the text should not say 'downloaded', but ready to download

We could add a separate 'retry' and 'go back' button

Maybe:

Export is ready. The download should start automatically. <btn-outline>Retry</btn-outline> <btn-filled>Go Back</btn-filled>

@jorg-vr
Copy link
Contributor Author

jorg-vr commented Mar 6, 2024

@niknetniko
image

@jorg-vr jorg-vr requested a review from niknetniko March 6, 2024 10:57
Copy link
Member

@bmesuere bmesuere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality-wise, it would make sense to make the waiting/downloading step 3 in the stepper. This, also because:

  • the text above the buttons in the action area of the card is a bit strange
  • making "go back" the primary action is strange
  • next to the automatic download, you also need an explicit button to trigger the download. Some browsers ask for permission to download first, or block such automatic downloads. In such cases, the download would fail.

@jorg-vr
Copy link
Contributor Author

jorg-vr commented Mar 11, 2024

Functionality-wise, it would make sense to make the waiting/downloading step 3 in the stepper.

Great idea. Indeed a big improvement

making "go back" the primary action is strange

Is it? I think this is the action everyone would preform after download?

next to the automatic download, you also need an explicit button to trigger the download.

This is what the "retry download" button is for. Is this not clear enough? or do you expect something totally different?

@jorg-vr jorg-vr requested a review from bmesuere March 11, 2024 12:39
@bmesuere bmesuere requested a review from chvp March 13, 2024 18:28
app/assets/stylesheets/components/btn.css.scss Outdated Show resolved Hide resolved
@jorg-vr jorg-vr merged commit 1a00c07 into main Mar 14, 2024
11 of 13 checks passed
@jorg-vr jorg-vr deleted the enhance/direct-download branch March 14, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A change that isn't substantial enough to be called a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants