Project

General

Profile

Actions

Feature #2910

closed

Warning on leaving edited issue/wiki page without saving

Added by Kaspars Sprogis over 15 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
Start date:
2009-03-05
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

I had already few times situations while posting quite large issues in redmine, i accidentally push something, go back or forward, or close tab and so i loose all my information, that i has been entering for let's say quite a long time and this situation is very upseting!!!

There is one solution right now, but it isn't good: Save issue time to time, BUT user that i had assigned to already got mail with issue content at my first save and if user doesn't come to redmine and starts developing by email content, this issue can be incomplete yet.

So one of two solutions would be great feature:

1) Javascript alert on leaving page if issue form has been changed or any data has been entered or change (This can be easily done by binding form.onchange property and on page unload check if form has been changed...)

2) Add new Status: "Draft" where nothing happens when user saves issue with this Status - no emails sent. Or maybe this can be handled in some other way. "Draft" checkbox, etc...

Maybe there are other solutions than i have missed. If there are any, let me know. Thanks.


Files

textsave.js (1.41 KB) textsave.js Mathias Fischer, 2009-06-24 18:40

Related issues

Related to Redmine - Defect #1852: Use regular POST (non-ajax) for wiki previewClosed2008-09-04

Actions
Related to Redmine - Defect #9845: Changes to Wiki content are lost when using Back buttonClosed

Actions
Has duplicate Redmine - Feature #2981: Prevent from leaving the page when in edit mode for issue, wiki or otherClosed

Actions
Has duplicate Redmine - Defect #3298: When updating an issue, clicking a link destroys all my inputClosed2009-05-05

Actions
Has duplicate Redmine - Feature #4396: Ask user to confim exiting unsaved wiki pageClosed2009-12-14

Actions
Is duplicate of Redmine - Feature #810: Warning when navigating away from editing a formClosed2008-03-07

Actions
Has duplicate Redmine - Feature #1888: Wiki savingClosed2008-09-11

Actions
Has duplicate Redmine - Feature #6043: Prevent from leaving unsaved "New Issue" page.Closed2010-08-05

Actions
Has duplicate Redmine - Feature #1250: Ask confirmation on PageLeave in wikiClosed2008-05-17

Actions
Actions #1

Updated by Paul Rivier over 15 years ago

Hi,

both proposals seem reasonable to me.

For drafts, some models could act_as_draftable (issue, wikipage, ...?). This would allow to set a draft flag to true. Models set as "Draft" would not be accessible to other users. However, they could be listed and accessed by the author, maybe via the author "my page".

For JS, it is quiet common to see this type of alert on web applications, I think this can also do the job and is simpler. My vote goes for this one because it does the job and is not too intrusive into redmine existing code.

Actions #2

Updated by Mathias Fischer over 15 years ago

I wrote a small piece of javascript like in #2981 proposed, because some people urgently needed it in our company ;-)

Added the following line to the header of app/views/layouts/base.rhtml:

<%= javascript_include_tag 'textsave' %>

and the .js-file to public/javascripts/textsave.js

Perhaps anybody likes to test it?

Actions #3

Updated by Kaspars Sprogis over 15 years ago

Added textsave.js to our redmine. So far it seems working fine. Thanks a lot! :)
Will let you know if there will be any problems in the future.

Actions #4

Updated by Kaspars Sprogis over 15 years ago

Mathias Fischer wrote:

I wrote a small piece of javascript like in #2981 proposed, because some people urgently needed it in our company ;-)

There is one bug actually. Try following action sequence:
  1. Choose "New Issue"
  2. Change Tracker to "Feature" or any other (which is not default)
  3. Input subject and descriprion.
  4. Push "Submit"
    And after pushing SUBMIT warning alert shows, which shouldn't happen.
Actions #5

Updated by Mathias Fischer over 15 years ago

Yes, I can reproduce this bug. Guess there is an event triggered when changing the tracker. Other forms with onsubmit/onchange-Events have problems too, like the stuff_to_do-Plugin. Perhaps I can find a workaround...

Actions #6

Updated by Mathias Fischer over 15 years ago

The problem is the AJAX-Request on the site, so you would have to register the events again. But it is easier to put the following line in the initialize-function:

document.observe('submit',this.setUnchanged.bind(this));

But it does not work in IE6 :-(

And I would restrict the observedElements to textareas, because the selects have onchange-Events by themself.

Actions #7

Updated by Randy Syring about 15 years ago

FWIW, I would like to see the draft option as well as a well implemented JS warning option. I would also like to see the draft option auto-save à la Gmail. That way, if your browser crashes, you hopefully have some of your work.

Personally, I think Gmail is a really good model for this type of thing.

Actions #8

Updated by Mischa The Evil almost 15 years ago

  • Category changed from Issues to UI
Actions #9

Updated by Shane Pearlman almost 15 years ago

+1 for getting the javascript alert pushed into the core. It has been a common tragedy,

Actions #10

Updated by Nico van Dalen almost 15 years ago

I would like to second the option to have a (good) javascript alert.

Actions #11

Updated by Paulo Santos over 14 years ago

+1
This issue should be addressed as soon as possible, is not admissible users can loose all their work just this easy. Every week I get someone complaining about loosing their changes, and the only solution I can give them is... write everything outside Redmine first! This is extremely unproductive.

Also related, every Submit should request a confirmation... every now and then, everyone presses the wrong option by mistake, and there's way to correct it.

Actions #12

Updated by Jean-Baptiste Barth over 14 years ago

Paulo Santos wrote:

+1
This issue should be addressed as soon as possible, is not admissible users can loose all their work just this easy. Every week I get someone complaining about loosing their changes, and the only solution I can give them is... write everything outside Redmine first! This is extremely unproductive.

I also used to say that to my users before I found this post. There is a script attached right here on this issue which prevents losing data, maybe you should try it. I admit it has side-effects, sometimes it is triggered while it should not (on Issues page when you have a filter for instance). But I'm nearly 100% happy with it for 6 months, and my users too ;-)

Also related, every Submit should request a confirmation... every now and then, everyone presses the wrong option by mistake, and there's way to correct it.

I disagree, there IS a way to correct it :
  1. it's not too complicated modifying your message after it has been published. OK the notifications were already sent, but you can edit it with "more" button or with the pen on the side of each comment
  2. I think it would be complicated to implement something "a-la-gmail" to allow people to stop sending an issue/comment X seconds after they pressed Enter key or pushed the button...

Anyway, I totally agree Randy's comment : I think Gmail is a really good model for this problem. I started implementing an autosave functionality as a plugin. I don't consider it as stable, but you can find it at github and try it if you want. I would be happy to have feedback or contributions on it. As I really need this functionality before may 2010, it will be released as stable before this date, maybe with the 2 functionalities (autosave + javascript).

Actions #13

Updated by Paulo Santos over 14 years ago

The "Request confirmation on Submit" feature, is more like a simple popup message requesting "Are you sure you want to submit this?"... for flexibility, this feature could be an option in Project/Redmine settings, not a mandatory behavior.

As for the hack, I'll may give it a try... but I'm not comfortable making surgical changes to a SW installation, I would rather have a Redmine release with a final solution... otherwise I may end up needing a personalized Redmine repository to manage this small improvements B-)

Actions #14

Updated by Daniel N over 14 years ago

I prefer the idea of a lightweigt JS solution over the heavier drafts implementation. I think this feature would add a lot of usability for many users and increase the acceptance of web-based software.

Actions #15

Updated by Jean-Philippe Lang almost 14 years ago

  • Target version set to 1.2.0
Actions #16

Updated by Jean-Philippe Lang almost 14 years ago

  • Subject changed from Warning on leaving edited issue page without saving or save issue as draft to Warning on leaving edited issue/wiki page without saving
Actions #17

Updated by Fernando Hartmann almost 14 years ago

+1 The two options are very useful.

Actions #18

Updated by Fernando Hartmann almost 14 years ago

I believe that #7066 can be a good implementation too.

Actions #19

Updated by Fernando Hartmann almost 14 years ago

I just realized that #2698 suggest auto save being minor-revisions, can be one option too IMHO.

Actions #20

Updated by Jean-Philippe Lang almost 14 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Feature added in r4900 base on Mathias' javascript implementation.
Only textareas are monitored and the warning can be turned off in user's preference.

Actions #21

Updated by salman mp over 8 years ago

This feature does not work when using CKEditor text formatter.

Actions #22

Updated by Mathias Fischer over 8 years ago

salman mp wrote:

This feature does not work when using CKEditor text formatter.

The CKEditor is a plugin to redmine, afaik. I believe, the CKEditor changes the textarea and would have to implement the feature by itself. I would suggest to look here for an answer: https://github.com/a-ono/redmine_ckeditor/issues

Actions

Also available in: Atom PDF