Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ experimental/nav-menus ] Delete menus in nav menus screen #21486

Merged
merged 13 commits into from
May 7, 2020

Conversation

draganescu
Copy link
Contributor

@draganescu draganescu commented Apr 8, 2020

Description

Adds delete button to #21281

Given deleting entities is a complex endeavor, that will eventually allow to undo deletes before saving, this approach advances the navigation screen and allows for user testing.

It is not the best way to implement this, but it allows the new screen to have this behavior now and not wait on some technicalities to be solved.

How has this been tested?

Tested locally by:

  • Enable the menu edit experiment
  • Make sure to use a theme that supports menus
  • Create some menus
  • Go to Gutenberg -> Navigation (beta)
  • Start deleting menus

Screenshots

delete-menus

Types of changes

Non breaking change that adds a delete call to the API inside the MenuEditor component and creates a state from initial menus inside MenusEdtior component.

@draganescu draganescu changed the title adds delete with menus as state [ experimental/nav-menus ] Delete menus in nav menus screen Apr 8, 2020
@draganescu draganescu mentioned this pull request Apr 8, 2020
2 tasks
@github-actions
Copy link

github-actions bot commented Apr 8, 2020

Size Change: +3.57 kB (0%)

Total Size: 822 kB

Filename Size Change
build/annotations/index.js 3.62 kB +2 B (0%)
build/api-fetch/index.js 4.08 kB -2 B (0%)
build/autop/index.js 2.82 kB +2 B (0%)
build/block-directory/index.js 6.6 kB +375 B (5%) 🔍
build/block-editor/index.js 101 kB -5.33 kB (5%)
build/block-editor/style-rtl.css 10.2 kB +22 B (0%)
build/block-editor/style.css 10.2 kB +21 B (0%)
build/block-library/editor-rtl.css 7.08 kB -31 B (0%)
build/block-library/editor.css 7.08 kB -30 B (0%)
build/block-library/index.js 115 kB +537 B (0%)
build/block-library/style-rtl.css 7.28 kB +59 B (0%)
build/block-library/style.css 7.29 kB +60 B (0%)
build/block-serialization-spec-parser/index.js 3.1 kB +1 B
build/blocks/index.js 48.1 kB -4 B (0%)
build/components/index.js 179 kB +34 B (0%)
build/core-data/index.js 11.4 kB -12 B (0%)
build/data/index.js 8.44 kB +6 B (0%)
build/date/index.js 5.47 kB -1 B
build/edit-navigation/index.js 4.4 kB +347 B (7%) 🔍
build/edit-navigation/style-rtl.css 608 B +123 B (20%) 🚨
build/edit-navigation/style.css 607 B +122 B (20%) 🚨
build/edit-post/index.js 28.1 kB +541 B (1%)
build/edit-post/style-rtl.css 12.2 kB +29 B (0%)
build/edit-post/style.css 12.2 kB +30 B (0%)
build/edit-site/index.js 12.3 kB +1.37 kB (11%) ⚠️
build/edit-site/style-rtl.css 5.19 kB +88 B (1%)
build/edit-site/style.css 5.2 kB +90 B (1%)
build/edit-widgets/index.js 8.37 kB +875 B (10%) ⚠️
build/edit-widgets/style-rtl.css 4.68 kB +16 B (0%)
build/edit-widgets/style.css 4.68 kB +17 B (0%)
build/editor/index.js 44.3 kB +706 B (1%)
build/editor/style-rtl.css 5.07 kB +1.8 kB (35%) 🚨
build/editor/style.css 5.08 kB +1.81 kB (35%) 🚨
build/escape-html/index.js 734 B +1 B
build/format-library/index.js 7.63 kB +3 B (0%)
build/keyboard-shortcuts/index.js 2.51 kB +3 B (0%)
build/keycodes/index.js 1.94 kB +1 B
build/media-utils/index.js 5.29 kB +1 B
build/nux/index.js 3.4 kB +1 B
build/plugins/index.js 2.56 kB -114 B (4%)
build/primitives/index.js 1.5 kB +1 B
build/redux-routine/index.js 2.85 kB +1 B
build/rich-text/index.js 14.8 kB +3 B (0%)
build/server-side-render/index.js 2.67 kB -5 B (0%)
build/url/index.js 4.02 kB -2 B (0%)
build/viewport/index.js 1.84 kB -1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.02 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/style-rtl.css 760 B 0 B
build/block-directory/style.css 761 B 0 B
build/block-library/theme-rtl.css 683 B 0 B
build/block-library/theme.css 685 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/components/style-rtl.css 16.9 kB 0 B
build/components/style.css 16.9 kB 0 B
build/compose/index.js 6.66 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom-ready/index.js 568 B 0 B
build/dom/index.js 3.1 kB 0 B
build/editor/editor-styles-rtl.css 428 B 0 B
build/editor/editor-styles.css 431 B 0 B
build/element/index.js 4.65 kB 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/hooks/index.js 2.13 kB 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.56 kB 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/list-reusable-blocks/index.js 3.12 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/priority-queue/index.js 789 B 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.28 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.18 kB 0 B

compressed-size-action

@karmatosed
Copy link
Member

karmatosed commented Apr 14, 2020

For me, this wouldn't be a button and I think we should avoid this. There are a few issues in the implementation:

  • There are now 2 primary action buttons.
  • Delete is becoming a primary action by positioning.

A very easy win here I think is just to make this simply have the text 'delete', this aligns more with the wp-admin interface. What there is now:

image

Let's bring this in with the save button at the top, right and then a simple text 'Delete Navigation' at the bottom:

Frame 3

@draganescu
Copy link
Contributor Author

draganescu commented Apr 15, 2020

Sure @karmatosed that is a great observation! I just went ahead and implemented "a button to click on" :) This mockup is a lot better. It also solves #21523

@draganescu draganescu force-pushed the add/delete-menus-fast-solution branch from e4102a5 to f74c24e Compare April 27, 2020 12:27
@draganescu
Copy link
Contributor Author

draganescu commented Apr 27, 2020

@noisysocks take this for a new spin and check out the current state code, I've added your suggestions. Thanks!
I've also applied a layout closer to @karmatosed 's mockup.

Given deleting entities is a complex endeavor, that will eventually allow to undo deletes before saving, this approach advances the navigation screen and allows for user testing.
removes extra getEntities call
@draganescu draganescu force-pushed the add/delete-menus-fast-solution branch from 239fe59 to a3d44c8 Compare April 30, 2020 13:49
Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! Nice work.

@draganescu
Copy link
Contributor Author

Howdy @noisysocks this is ready for re-reviewing :)

Copy link
Contributor

@adamziel adamziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some minor notes but nothing blocking, good job!

@draganescu draganescu requested a review from noisysocks May 6, 2020 17:06
@draganescu draganescu merged commit 9949b40 into master May 7, 2020
@draganescu draganescu deleted the add/delete-menus-fast-solution branch May 7, 2020 14:10
@github-actions github-actions bot added this to the Gutenberg 8.1 milestone May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants