WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 4 months ago

#46367 reviewing enhancement

Introduce a cancel button to the create new menu screen when 1 or more menus exist

Reported by: garrett-eclipse Owned by: audrasjb
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch has-screenshots needs-testing
Focuses: ui, administration Cc:

Description

Hello,

On the create new menu screen it would be nice to introduce a Cancel link in the same location as the 'Delete Menu' link appears when editing a menu.

This would only make sense when there are one or more menus in existence, when there aren't any menus there's nothing to cancel. When there is a single menu and you go to create a new menu there's no indication on screen that a menu exists and you need to reload to be able to edit the existing menu. When there is more than one menu the select menu dropdown appears so at least you can switch menus to cancel.

The use case this helps the most is when there's only one menu and you click 'create a new menu'. In this case the cancel allows you to go back to the single existing menu.

Hope that was clear,
Thank you

Attachments (6)

Screen Shot 2019-02-27 at 10.10.48 PM.png (171.9 KB) - added by garrett-eclipse 6 months ago.
This screen shows the create menu screen when there's one existing menu. Nothing indicates a menu exists and there's no way to cancel or navigate back except with a reload.
Screen Shot 2019-02-27 at 10.15.48 PM.png (143.9 KB) - added by garrett-eclipse 6 months ago.
When there's more than one menu on the create a new menu screen you at least get the select a menu as a way to cancel the create action.
Screen Shot 2019-02-27 at 10.22.46 PM.png (56.3 KB) - added by garrett-eclipse 6 months ago.
Suggested ui addition of Cancel onto create new menu view
46367.diff (1.4 KB) - added by garrett-eclipse 4 months ago.
Initial patch - Introduces cancel-button to redirect back to nav-menus.php
46367.2.diff (1.4 KB) - added by garrett-eclipse 4 months ago.
Minor adjustment to original, moving the cancel-action conditional prior to the delete-action we can cleanup the if/elseif removing the ! $add_new_screen as we confirm that in the first condition
Screen Shot 2019-05-04 at 10.46.26 AM.png (67.0 KB) - added by garrett-eclipse 4 months ago.
Screen illustrating applied patch w/ 'Cancel' button. Colours in patch use same as 'Delete Menu'

Download all attachments as: .zip

Change History (8)

@garrett-eclipse
6 months ago

This screen shows the create menu screen when there's one existing menu. Nothing indicates a menu exists and there's no way to cancel or navigate back except with a reload.

@garrett-eclipse
6 months ago

When there's more than one menu on the create a new menu screen you at least get the select a menu as a way to cancel the create action.

@garrett-eclipse
6 months ago

Suggested ui addition of Cancel onto create new menu view

#1 @audrasjb
4 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

Hi @garrett-eclipse and thanks for the ticket :-)

I'm wondering what would be the best action triggered by the cancel button. Simply reload the current page?

@garrett-eclipse
4 months ago

Initial patch - Introduces cancel-button to redirect back to nav-menus.php

@garrett-eclipse
4 months ago

Minor adjustment to original, moving the cancel-action conditional prior to the delete-action we can cleanup the if/elseif removing the ! $add_new_screen as we confirm that in the first condition

@garrett-eclipse
4 months ago

Screen illustrating applied patch w/ 'Cancel' button. Colours in patch use same as 'Delete Menu'

#2 @garrett-eclipse
4 months ago

  • Keywords has-patch has-screenshots needs-testing added

Hi @audrasjb thanks for the ping.

Reviewing the setup WP has, the create menu redirects the user to nav-menus.php?action=edit&menu=0 so taking the user back to nav-menus.php seems like the most appropriate course here.

I setup an initial patch for this in 46367.diff (and minor tweak in 46367.2.diff to cleanup the conditional), which introduces the menu-cancel action link. To give it the same red as the menu-delete action I've added the selector to the common.css file where menu-cancel is setup. I'm not sure if we want to give it an alternate colour but felt it made sense and should never appear alongside the menu-delete action.

Give it a shot and let me know if you have any issues.

All the best

Last edited 4 months ago by garrett-eclipse (previous) (diff)
Note: See TracTickets for help on using tickets.