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

Using addQueryArgs to generate Manage All Reusable Blocks link #13653

Merged
merged 8 commits into from
Feb 4, 2019
Merged

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Feb 4, 2019

Description

Copied over from #10065. Props to @SofiaSousa for all work done on this PR.

Using addQueryArgs method from @wordpress/url instead of hand coding 'Manage All Reusable Blocks' link.

How has this been tested?

  1. Open 'Reusable' panel in 'Add Block' menu
  2. Check 'Manage All Reusable Blocks' link is redirecting to edit.php?post_type=wp_block.
  3. Open 'More' menu (top right ...)
  4. Check 'Manage All Reusable Blocks' link is redirecting to edit.php?post_type=wp_block.

Screenshots

Types of changes

Reuse an existing method.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Code Quality Issues or PRs that relate to code quality labels Feb 4, 2019
@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 4, 2019
@gziolo gziolo changed the title Pr/10065 Using addQueryArgs to generate Manage All Reusable Blocks link Feb 4, 2019
@gziolo gziolo requested a review from a team February 4, 2019 12:00
@gziolo
Copy link
Member Author

gziolo commented Feb 4, 2019

I can't approve my own PR but this is something that I opened to land #10065 which I approved already ...

@gziolo gziolo merged commit a3f016a into master Feb 4, 2019
@gziolo gziolo deleted the pr/10065 branch February 4, 2019 12:25
@gziolo
Copy link
Member Author

gziolo commented Feb 4, 2019

Thanks, @SofiaSousa for your contribution 💯

If you feel like we should further abstract all WordPress urls, I'm happy to discuss next steps.

@aduth
Copy link
Member

aduth commented Feb 4, 2019

It's unclear between this and #10065:

Why is this change necessary?

@gziolo
Copy link
Member Author

gziolo commented Feb 4, 2019

Let me copy a #10065 (comment) from @SofiaSousa:

To be coherent. Then in our case, we override addQueryArgs in order to apply the changes we need on the editor paths since paths are not configurable.

this is in the context of Gutenberg in Drupal. I think we should further abstract all WordPress links in the follow-up PR. They are now included in @wordpress/editor package which is meant to be platform indepenendent. At the moment it isn't because of all those hardcoded links.

@aduth
Copy link
Member

aduth commented Feb 4, 2019

Gotcha, sorry I missed the comment in the other pull request.

I agree, for this purpose (and even for WP's own maintainability), the links ought to be created more abstractly.

In this example, I could imagine a function like getPostListLink( 'wp_block' ), though even concepts of "post" and slug-based post types are in a more limited sense tied to a WordPress implementation.

daniloercoli added a commit that referenced this pull request Feb 5, 2019
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg: (22 commits)
  Make the modal title styling consistent (#13669)
  Disable navigation block for text mode. (#12185)
  Fix: Linting problem in modal example code (#13671)
  Add myself as a code owner to the annotations (#13672)
  Add more reviewers to CODEOWNERS.md file (#13667)
  Plugin: Remove jQuery heartbeat-to-hooks proxying (#13576)
  Workflow: Add repository CODEOWNERS file (#13604)
  Add a mobile minimum size for form fields (#13639)
  Update edit-save documentation  (#13578)
  Alt image setting (#13631)
  Fix: Allow years lower than 1970 in DateTime component. (#13602)
  Using addQueryArgs to generate Manage All Reusable Blocks link (#13653)
  Bump plugin version to 5.0.0-rc.1 (#13652)
  Update lodash to 4.17.10 (#13651)
  Refreshed PR (#9469)
  Set default values of the width and height input fields according to the actual image dimensions (#7687)
  12647 fix css color picker (#12747)
  Remove "we" from messages (#13644)
  Fix: Font size picker max width on mobile (#13264)
  Fix/issue 12501 menu item aria label
  ...
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* feat: Use addQueryArgs to generate Manage All Reusable Blocks link

* feat: Use addQueryArgs to generate Manage All Reusable Blocks link (forgotten file)

* feat: Use addQueryArgs to generate Manage All Reusable Blocks link

* fix: Import missing addQueryArgs method

* chore: Update package-lock after run npm@6.7 install
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* feat: Use addQueryArgs to generate Manage All Reusable Blocks link

* feat: Use addQueryArgs to generate Manage All Reusable Blocks link (forgotten file)

* feat: Use addQueryArgs to generate Manage All Reusable Blocks link

* fix: Import missing addQueryArgs method

* chore: Update package-lock after run npm@6.7 install
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] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants