Feature #23555
open
Add cancel button to create/edit item page (issues, files, news, etc.)
Added by Anonymous over 10 years ago. Updated about 1 month ago.
Description
As discussed in #4285, a cancel button while creating or editing an item is very useful. It should allow the user to return to the previous page.
While this was implemented for wiki pages, it currently does not apply to the "+" function in Redmine 3.3, see Screenshot:
The button should be available for any item, i.e.
- issues
- categories
- versions
- files
- documents
- wiki pages
- news
Files
| new_wiki.PNG (11 KB) new_wiki.PNG | Anonymous, 2016-08-10 09:02 | ||
| rm_23555_add_cancel_button.patch (17.5 KB) rm_23555_add_cancel_button.patch | Marius BĂLTEANU, 2017-03-08 07:09 | ||
| 0001-Add-cancel-links-to-create-edit-pages-23555.patch (16.2 KB) 0001-Add-cancel-links-to-create-edit-pages-23555.patch | Florian Walchshofer, 2026-10-22 23:22 |
Updated by Anonymous over 10 years ago
Actions
#1
Related to #18051
Updated by Toshi MARUYAMA about 10 years ago
Actions
#2
- Description updated (diff)
Updated by Marius BĂLTEANU almost 10 years ago
Actions
#3
Do you consider that the "Cancel" button should behave exactly like the "Back" button from the browser or it should have predefined paths?
For example: Cancel button from Files should redirect to Files index even if you opened the Files new page from "+" button.
Updated by Anonymous almost 10 years ago
Actions
#4
Marius BALTEANU wrote:
Do you consider that the "Cancel" button should behave exactly like the "Back" button from the browser or it should have predefined paths?
For example: Cancel button from Files should redirect to Files index even if you opened the Files new page from "+" button.
Predefined paths could be quite confusing, so I suggest it should work exactly like a browser's "back" button.
Updated by Marius BĂLTEANU over 9 years ago
Actions
#5
Totally agree with JW Fuchs, a cancel button will improve the UX. Even if you have the "Back" button available to return to the previous page, for me and our users is more natural to click on a cancel button when you don't want to go forward with the submit/save operation.
Attached is a patch proposal which adds the cancel button in most of the pages. JW Fuchs, can you test it and tell me your feedback?
I don't think that tests are necessary.
Updated by Jean-Philippe Lang over 9 years ago
Actions
#6
Marius BALTEANU wrote:
Thanks for the patch Marius but linking toAttached is a patch proposal which adds the cancel button in most of the pages. JW Fuchs, can you test it and tell me your feedback?
url_for(:back) does not work after a validation error:
- go to
/time_entries/new - don't fill anything and hit Create => you get a validation error
- clicking Cancel then sends you back to
/time_entries/new
Updated by Marius BĂLTEANU over 9 years ago
Actions
#7
Thanks for your feedback, Jean-Philippe. Unfortunately, I didn't test this scenario. I'll look for another solution.
Updated by Toshi MARUYAMA over 9 years ago
Actions
#8
- Related to Feature #8888: Add a link / button to get back to the Issue/Time tracking screen from the "Log time" screen added
Updated by Marius BĂLTEANU over 8 years ago
Actions
#9
Jean-Philippe Lang wrote:
Thanks for the patch Marius but linking tourl_for(:back)does not work after a validation error:
- go to
/time_entries/new- don't fill anything and hit Create => you get a validation error
- clicking Cancel then sends you back to
/time_entries/new
I think I've found a solution to this issue and I've attached a patch to #8888 to validate the implementation.
Updated by Marius BĂLTEANU about 8 years ago
Actions
#10
- Assignee set to Marius BĂLTEANU
Updated by Andreas Treubert 5 months ago
Actions
#11
Currently I got from my collegaues the same requests. It would be nice, if this gets merged.
Updated by Florian Walchshofer about 1 month ago
Actions
#12
- File 0001-Add-cancel-links-to-create-edit-pages-23555.patch 0001-Add-cancel-links-to-create-edit-pages-23555.patch added
The attached patch adds Cancel links to the create/edit pages of issues, issue categories, versions, files, documents, news and wiki pages.
It uses the same approach as the log time page (#8888): cancel_button_tag with a fallback URL, and back_url_hidden_field_tag in the form.
To fix the problem from #note-6 (Cancel goes back to the form after a validation error), cancel_button_tag is changed:
- After a form submission, it only uses the
back_urlparameter and no longer the referer, which is then the form itself. - It does not link to the form itself, e.g. after "Create and continue".
The new issue page gets no hidden back_url field, because IssuesController#create redirects to back_url after saving.
Functional tests are included, also for the case from #note-6.