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
Member

noisysocks commented Sep 3, 2018

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

bulk

Reusable blocks: Add UI for bulk deleting blocks
First pass at allowing reusable blocks to be edited via
the edit.php?post_type=wp_block page.
@noisysocks

This comment has been minimized.

Show comment
Hide comment
@noisysocks

noisysocks Sep 3, 2018

Member

@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 🙂

Member

noisysocks commented Sep 3, 2018

@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;

This comment has been minimized.

@noisysocks

noisysocks Sep 3, 2018

Member

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.

@noisysocks

noisysocks Sep 3, 2018

Member

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

This comment has been minimized.

Show comment
Hide comment
@mtias

mtias Sep 3, 2018

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@slimmilkduds

slimmilkduds Sep 4, 2018

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?

slimmilkduds commented Sep 4, 2018

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

This comment has been minimized.

Show comment
Hide comment
@jasmussen

jasmussen Sep 4, 2018

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.
Contributor

jasmussen commented Sep 4, 2018

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

This comment has been minimized.

Show comment
Hide comment
@mtias

mtias Sep 4, 2018

Contributor

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

Contributor

mtias commented Sep 4, 2018

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

@chrisvanpatten

This comment has been minimized.

Show comment
Hide comment
@chrisvanpatten

chrisvanpatten Sep 4, 2018

Contributor

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

Contributor

chrisvanpatten commented Sep 4, 2018

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

@karmatosed

This comment has been minimized.

Show comment
Hide comment
@karmatosed

karmatosed Sep 4, 2018

Member

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

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

Member

karmatosed commented Sep 4, 2018

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"

This comment has been minimized.

@youknowriad

youknowriad Sep 5, 2018

Contributor

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.

@youknowriad

youknowriad Sep 5, 2018

Contributor

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.

This comment has been minimized.

@mtias

mtias Sep 5, 2018

Contributor

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

@mtias

mtias Sep 5, 2018

Contributor

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

This comment has been minimized.

@youknowriad
@youknowriad
@youknowriad

LGTM 👍

@youknowriad youknowriad merged commit ec59f94 into master Sep 5, 2018

2 checks passed

codecov/project 50.38% (+0.01%) compared to cf74b67
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@youknowriad youknowriad deleted the add/bulk-reusable-block-management branch Sep 5, 2018

@@ -9,13 +9,14 @@
position: relative;
overflow: hidden;
text-indent: 4px;
border-radius: $radius-round-rectangle;

This comment has been minimized.

@aduth

aduth Sep 7, 2018

Member

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

border-radius: $radius-round-rectangle;

@aduth

aduth Sep 7, 2018

Member

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

border-radius: $radius-round-rectangle;

This comment has been minimized.

@aduth

aduth Sep 7, 2018

Member

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)

@aduth

aduth Sep 7, 2018

Member

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)

This comment has been minimized.

@jasmussen

jasmussen Sep 10, 2018

Contributor

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?

@jasmussen

jasmussen Sep 10, 2018

Contributor

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?

This comment has been minimized.

@aduth

aduth Sep 18, 2018

Member

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

@aduth

aduth Sep 18, 2018

Member

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

This comment has been minimized.

@jasmussen

jasmussen Sep 19, 2018

Contributor

Created PR here: #10021

@jasmussen

jasmussen Sep 19, 2018

Contributor

Created PR here: #10021

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.

@jasmussen jasmussen referenced this pull request Sep 19, 2018

Merged

Remove redundant rule. #10021

jasmussen added a commit that referenced this pull request Sep 19, 2018

Remove redundant rule. (#10021)
* Remove redundant rule.

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

It also polishes the comments a bit.

* Address feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment