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

Reusable blocks: Add UI for bulk deleting blocks #9588

Merged
merged 2 commits into from
Sep 5, 2018

Conversation

noisysocks
Copy link
Member

Fixes #7387. First pass at allowing reusable blocks to be edited via edit.php?post_type=wp_block.

bulk

First pass at allowing reusable blocks to be edited via
the edit.php?post_type=wp_block page.
@noisysocks noisysocks added [Type] Enhancement A suggestion for improvement. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Sep 3, 2018
@noisysocks
Copy link
Member Author

@pento @talldan @mtias: Hopefully this PR is a good start. I've put it together fairly quickly. Wanted to get something submitted before I am AFK tomorrow 🙂

?>
<style type="text/css">
.page-title-action {
display: none;
Copy link
Member Author

Choose a reason for hiding this comment

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

Was chatting to @azaozz about this. In the medium term, we should patch Core to add a filter here:

https://github.com/WordPress/WordPress/blob/master/wp-admin/edit.php#L352

This would allow us to remove this hacky way of hiding the Add New button and improve how gutenberg_replace_default_add_new_button works.

@mtias
Copy link
Member

mtias commented Sep 3, 2018

Thanks, this looks like a great start to me. It feels like we should add explanatory text to the cog button like "manage all blocks". cc @jasmussen @karmatosed

@mtias mtias added this to the 3.8 milestone Sep 3, 2018
@slimmilkduds
Copy link

This is great! Out of curiosity: How far away would the process be to be able to edit or add a new reusable block instead of just being able to trash it?

@jasmussen
Copy link
Contributor

In 6808783 I took the liberty of doing two things:

  • Changing from "Manage Blocks" to "Manage All Reusable Blocks"
  • Adding a default round rectangle border-radius to all icon buttons. I know this change affects all icon buttons, but it should — notably the X button in the sidebar is square right now and it shouldn't be. Instead of adding that radius on a per-button basis, all icon buttons should default to rounded.

@mtias
Copy link
Member

mtias commented Sep 4, 2018

@slimmilkduds editing and adding should become more viable after the following refactor #7453

@chrisvanpatten
Copy link
Member

@jasmussen that border radius issue has been making me slightly crazy… thanks for that tweak :)

@karmatosed
Copy link
Member

Changing from "Manage Blocks" to "Manage All Reusable Blocks"

Yep this works for me! Great work and really useful.

@talldan talldan self-assigned this Sep 5, 2018
className="editor-inserter__manage-reusable-blocks"
icon="admin-generic"
label={ __( 'Manage All Reusable Blocks' ) }
href="edit.php?post_type=wp_block"
Copy link
Contributor

Choose a reason for hiding this comment

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

For a later PR. We use links to target WP Admin pages (here, revisions, I'm probably missing other links too). The thing is. These links only work in WP context. We need to find a way to add these links in an "augmented" manner. Keeping the packages WP links free.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, let's make sure we make an issue for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@youknowriad youknowriad merged commit ec59f94 into master Sep 5, 2018
@youknowriad youknowriad deleted the add/bulk-reusable-block-management branch September 5, 2018 16:48
@@ -9,13 +9,14 @@
position: relative;
overflow: hidden;
text-indent: 4px;
border-radius: $radius-round-rectangle;
Copy link
Member

@aduth aduth Sep 7, 2018

Choose a reason for hiding this comment

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

Does this change make the following line redundant now (for .edit-post-header .components-button selector)?

border-radius: $radius-round-rectangle;

Copy link
Member

Choose a reason for hiding this comment

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

Also, I don't understand why it's IconButton which applies hover and active button styles (and the associated border radius), rather than the underlying Button ?

See related comment at #7534 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that makes this rule redundant.

And I don't have a good answer to your question, other than this is how we got to where we are today.

I very much appreciate the effort you are putting in #9702 — would you like help with that? Do you want to remove the redundant rule in the header as part of that PR, or would you like me to create a quick fixup here?

Copy link
Member

Choose a reason for hiding this comment

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

There doesn't appear to be great consensus around #9702 / #7534, so if the change can happen separately, it's probably better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Created PR here: #10021

jasmussen pushed a commit that referenced this pull request Sep 19, 2018
This addresses an issue reported in #9588 (comment).

It also polishes the comments a bit.
jasmussen added a commit that referenced this pull request Sep 19, 2018
* Remove redundant rule.

This addresses an issue reported in #9588 (comment).

It also polishes the comments a bit.

* Address feedback.
@aduth aduth mentioned this pull request Sep 21, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants