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

Warn user with pop-up modal of unsaved changes #3942

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

Dananji
Copy link
Contributor

@Dananji Dananji commented Sep 4, 2019

Fixes #3911 ; refs #3454

This uses the modal implementation in #2977, across the following scenarios.

Changes proposed in this pull request:

  • Use confirmation when editing tabbed forms in Admin Pages, Collection edit, and File-set edit

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  • Dashboard -> Collections
  • Choose 'Edit collection' from the drop-down for one collection in the list
  • Change a field in the Description tab
  • Go to Discovery tab without saving the changes
  • A modal pops up as follows;
    modal-confirm
  • Click OK to go to the Discovery tab OR click on modal backdrop/hit ESC button on keyboard to close the modal

@samvera/hyrax-code-reviewers

@Dananji Dananji force-pushed the add-modal-confirmation-for-tabs branch from 4f578a4 to 293891a Compare September 4, 2019 13:24
@Dananji Dananji force-pushed the add-modal-confirmation-for-tabs branch from 293891a to 5b47ebf Compare September 4, 2019 13:29
@Dananji Dananji marked this pull request as ready for review September 4, 2019 13:43
Copy link
Contributor

@no-reply no-reply left a comment

Choose a reason for hiding this comment

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

With the understanding that this is a stop-gap for the 3.0 release, and that form work is pending in the 3.0 series, let's get this in.

I'd appreciate if someone with better front-end JS expertise than I could review it.

cc: @samvera/hyrax-ui-ux-advisors

Copy link
Member

@adamjarling adamjarling left a comment

Choose a reason for hiding this comment

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

Looks good, although note I don't have a current running version of Hyrax set up to test it on. But visually looks good I'd say.

$('.nav-safety-confirm').on('click', function(evt) {
clickedTab = $(this).attr('href');
Copy link
Member

Choose a reason for hiding this comment

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

Just a thought @Dananji in the future, for shared convention if referring to a jQuery variable, how about doing var $clickedTab = ... instead of var clickedTab = ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes 👍 Thanks!

@cjcolvar cjcolvar merged commit 16c8508 into master Sep 9, 2019
@cjcolvar cjcolvar deleted the add-modal-confirmation-for-tabs branch September 9, 2019 15:43
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.

Show confirmation before leaving unsaved changes in forms with tabs
4 participants