CRM-11606 Warn users about unsaved changes in form designer

    Details

    • Type: Sub-task
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: CiviCRM Profile
    • Labels:
      None

      Description

      When a user makes a change to a form and clicks"X" (dialog-close from jQuery) or "Reload" (in the web browser), any changes will be abandoned. Users should be warned before abandoning changes.

        Attachments

          Activity

          [CRM-11606] Warn users about unsaved changes in form designer
          Coleman Watts added a comment - - edited

          tim, I was inspired by this article to try to reduce our use of warnings:
          http://www.alistapart.com/articles/neveruseawarning/

          What do you think of the following from a ux perspective:

          • When you close the dialog a CRM.alert pops up saying "Your changes to xxx profile have been discarded. Click here to undo"
          • When you click the red x to remove a field from the canvas, a similar alert pops up saying "Field xxx removed. [undo]"

          Since these things can be held in memory both might be fairly easy to implement.
          As for the window close issue, I suppose that will still have to be a confirm()

          Tim Otten added a comment -

          From UX perspective, agree that undo sounds better than warning.

          For CRM.alert, the timing of the auto-close for the alert may be a bit finicky. On one hand, you don't want to close too quickly or the user won't have a chance to undo. On the other hand, if you do a popup for every field deletion, then you don't want those popups to hang around too long (because they'll get annoying). But maybe there's a simple solution.

          From an implementation perspective, the undo makes me more nervous... we don't really have a way to estimate it, and the warning popup is really simple (eg "confirm" or "CRM.confirm"). What you might do is take a stab at implementing undo but set a fixed time limit (like 30-60 min); if it's not reliably working after 30-60min of dev time, then skip it... the "undo" goes on the wishlist and we use a "confirm" for now.

          Coleman Watts added a comment -

          Added undo when closing dialog and warning when leaving page.
          Not tackling the field-level undo for now.

            People

            • Assignee:
              Coleman Watts
              Reporter:
              Tim Otten

              Dates

              • Created:
                Updated:
                Resolved: