Page MenuHomePhabricator

Add a dialog box to tell users they are leaving the page with unsaved changes
Closed, ResolvedPublic3 Estimated Story Points

Description

When an event organizer is adding usernames to the Participants and Categories filters, there is some ambiguity as to whether particular changes are saved or unsaved. This issue has been discussed extensively in T201710, and various solutions were entertained but put on hold. Meanwhile, we decided to address the most pressing part of the problem, which is that currently users who leave the page with unsaved changes get no warning.

New Functionality

  • When a user clicks to leave the Event Summary page (which is where the Participants and Categories filters live until we move them in Phase II), we will determine whether she has unsaved changes. If so, we will warn with a dialog box.
  • Text of dialog: Leave page? You have unsaved changes that will be lost. [Leave] [Stay]
    • If the user clicks Stay, the dialog to disappears and the user returns to the Setup page.
    • If the user clicks Leave, the dialog closes the the user progresses to whichever page she originally selected.

Event Timeline

jmatazzoni created this task.

@Prtksxna, I'm moving this to stalled, since I see no point in adding the dialog for unsaved changes to the interim page. And I am currently assuming that we can specify the functionality we wanted (to save valid usernames) on the redesigned Setup page you are designing now. Should that not be the case, we can revive this ticket then.

Just note that browsers started considering these custom messages as security breach. They allow us to display a warning before navigating away, but not to set the text of that warning.

In chrome, it looks like this:

leave-site-alert-chrome.png (141×453 px, 12 KB)

And it will only appear if there are invalid participants in the form.

PR is here: https://github.com/wikimedia/eventmetrics/pull/262

@jmatazzoni please verify that the behavior is okay (see my comment above). We can't set a custom note on that alert anymore, we can only display the default "Leave site?" alert. The PR does that only when there are invalid participants in the list, and the error message saying "there are invalid participants" should be sufficient in directing the user's attention there.

Is this change from the original spec okay? If so, I'll move to review.

The standard dialog box seems fine. Not ideal, but it's what users are used to. Let's try it.

I tested this and saw the dialog box on the Settings, Create a New Program and Event Summary pages when I tried to leave the pages with unsaved settings. Resolving this.