Feature #2910
closedWarning on leaving edited issue/wiki page without saving
0%
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
Related issues
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.
Updated by Mathias Fischer over 15 years ago
- File textsave.js textsave.js added
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?
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.
Updated by Kaspars Sprogis over 15 years ago
Mathias Fischer wrote:
There is one bug actually. Try following action sequence:I wrote a small piece of javascript like in #2981 proposed, because some people urgently needed it in our company ;-)
- Choose "New Issue"
- Change Tracker to "Feature" or any other (which is not default)
- Input subject and descriprion.
- Push "Submit"
And after pushing SUBMIT warning alert shows, which shouldn't happen.
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...
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.
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.
Updated by Mischa The Evil almost 15 years ago
- Category changed from Issues to UI
Updated by Shane Pearlman almost 15 years ago
+1 for getting the javascript alert pushed into the core. It has been a common tragedy,
Updated by Nico van Dalen almost 15 years ago
I would like to second the option to have a (good) javascript alert.
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.
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 ;-)
I disagree, there IS a way to correct it :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.
- 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
- 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).
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-)
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.
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
Updated by Fernando Hartmann almost 14 years ago
+1 The two options are very useful.
Updated by Fernando Hartmann almost 14 years ago
I believe that #7066 can be a good implementation too.
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.
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.
Updated by salman mp over 8 years ago
This feature does not work when using CKEditor text formatter.
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