Project

General

Profile

Actions

Feature #23555

open

Add cancel button to create/edit item page (issues, files, news, etc.)

Added by Anonymous about 10 years ago. Updated 13 days ago.

Status:
New
Priority:
Normal
Category:
UI
Target version:
-
Resolution:

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


Related issues

Related to Redmine - Feature #8888: Add a link / button to get back to the Issue/Time tracking screen from the "Log time" screenClosedJean-Philippe Lang2011-07-23Actions
Actions #1

Updated by Anonymous about 10 years ago

Related to #18051

Actions #2

Updated by Toshi MARUYAMA about 10 years ago

  • Description updated (diff)
Actions #3

Updated by Marius BĂLTEANU over 9 years ago

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.

Actions #4

Updated by Anonymous over 9 years ago

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.

Actions #5

Updated by Marius BĂLTEANU over 9 years ago

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.

Actions #6

Updated by Jean-Philippe Lang over 9 years ago

Marius BALTEANU wrote:

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?

Thanks for the patch Marius but linking to 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
Actions #7

Updated by Marius BĂLTEANU over 9 years ago

Thanks for your feedback, Jean-Philippe. Unfortunately, I didn't test this scenario. I'll look for another solution.

Actions #8

Updated by Toshi MARUYAMA over 9 years ago

  • Related to Feature #8888: Add a link / button to get back to the Issue/Time tracking screen from the "Log time" screen added
Actions #9

Updated by Marius BĂLTEANU over 8 years ago

Jean-Philippe Lang wrote:

Thanks for the patch Marius but linking to 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

I think I've found a solution to this issue and I've attached a patch to #8888 to validate the implementation.

Actions #10

Updated by Marius BĂLTEANU about 8 years ago

  • Assignee set to Marius BĂLTEANU
Actions #11

Updated by Andreas Treubert 4 months ago

Currently I got from my collegaues the same requests. It would be nice, if this gets merged.

Actions #12

Updated by Florian Walchshofer 13 days ago

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_url parameter 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.

Actions

Also available in: Atom PDF