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

Add beforeunload to dataset upload view #5049

Merged
merged 7 commits into from
Feb 1, 2021

Conversation

grittaweisheit
Copy link
Contributor

@grittaweisheit grittaweisheit commented Jan 15, 2021

This PR double checks with the user if he/she really wants to leave the dataset upload view.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • upload a dataset
  • try to navigate elsewhere while it's still uploading
  • you should be warned about leaving while it's still loading

Issues:


Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Works great! Please only adapt the user message :)

// restore the event handler in case a user chose to stay on the page
window.onbeforeunload = beforeUnload;
}, 500);
return messages["save.leave_page_unfinished"];
Copy link
Member

Choose a reason for hiding this comment

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

Could you create a new message string for this scenario? Right now, it says: WARNING: You have unsaved progress that may be lost when hitting OK. Please click cancel, wait until the progress is saved and the save button displays a checkmark before leaving the page... However, the text doesn't fit the dataset upload page :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I totally forgot about that, thanks for pointing it out! It's adjusted now.

@daniel-wer daniel-wer removed their request for review January 21, 2021 09:05
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add beforeunload to dataset upload
2 participants