From 0d1ce90c70bb2d32029943b9ea6fbe8c3e99da8e Mon Sep 17 00:00:00 2001 From: Sofia Sousa Date: Thu, 20 Sep 2018 11:51:17 +0100 Subject: [PATCH 1/5] feat: Use addQueryArgs to generate Manage All Reusable Blocks link --- edit-post/components/header/more-menu/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edit-post/components/header/more-menu/index.js b/edit-post/components/header/more-menu/index.js index 60f4a9225b52d5..b5a7ea06a4d7bc 100644 --- a/edit-post/components/header/more-menu/index.js +++ b/edit-post/components/header/more-menu/index.js @@ -4,6 +4,7 @@ import { __, _x } from '@wordpress/i18n'; import { IconButton, Dropdown, MenuGroup, MenuItem } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; +import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies @@ -40,7 +41,7 @@ const MoreMenu = () => ( > { __( 'Manage All Reusable Blocks' ) } From ccdec53c3a6ad28e8cd5ebb495150532bde1397d Mon Sep 17 00:00:00 2001 From: Sofia Sousa Date: Thu, 20 Sep 2018 12:05:45 +0100 Subject: [PATCH 2/5] feat: Use addQueryArgs to generate Manage All Reusable Blocks link (forgotten file) --- packages/editor/src/components/inserter/menu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/inserter/menu.js b/packages/editor/src/components/inserter/menu.js index 16e763dba24994..4e785ba89e9e8b 100644 --- a/packages/editor/src/components/inserter/menu.js +++ b/packages/editor/src/components/inserter/menu.js @@ -26,6 +26,7 @@ import { withSpokenMessages, PanelBody, IconButton } from '@wordpress/components import { getCategories, isReusableBlock } from '@wordpress/blocks'; import { withDispatch, withSelect } from '@wordpress/data'; import { withInstanceId, compose, withSafeTimeout } from '@wordpress/compose'; +import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies @@ -290,7 +291,7 @@ export class InserterMenu extends Component { className="editor-inserter__manage-reusable-blocks" icon="admin-generic" label={ __( 'Manage All Reusable Blocks' ) } - href="edit.php?post_type=wp_block" + href={ addQueryArgs( 'edit.php', { post_type: 'wp_block' } ) } /> ) } From eb3c419b614e1d342e7f31b1854543d9062ba522 Mon Sep 17 00:00:00 2001 From: Sofia Sousa Date: Thu, 31 Jan 2019 21:40:39 +0000 Subject: [PATCH 3/5] feat: Use addQueryArgs to generate Manage All Reusable Blocks link --- packages/edit-post/src/plugins/index.js | 2 +- packages/editor/src/components/inserter/menu.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/edit-post/src/plugins/index.js b/packages/edit-post/src/plugins/index.js index 34db5f51dd1a14..7a6ea233dfeb88 100644 --- a/packages/edit-post/src/plugins/index.js +++ b/packages/edit-post/src/plugins/index.js @@ -22,7 +22,7 @@ registerPlugin( 'edit-post', { { __( 'Manage All Reusable Blocks' ) } diff --git a/packages/editor/src/components/inserter/menu.js b/packages/editor/src/components/inserter/menu.js index 0f5ebb437f9e16..7fb3cb2ffdca6d 100644 --- a/packages/editor/src/components/inserter/menu.js +++ b/packages/editor/src/components/inserter/menu.js @@ -32,6 +32,7 @@ import { import { withDispatch, withSelect } from '@wordpress/data'; import { withInstanceId, compose, withSafeTimeout } from '@wordpress/compose'; import { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } from '@wordpress/keycodes'; +import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies @@ -323,7 +324,7 @@ export class InserterMenu extends Component { { __( 'Manage All Reusable Blocks' ) } From a11ff7a620b3ccadf6def09f4792b19cf3eb7a17 Mon Sep 17 00:00:00 2001 From: Sofia Sousa Date: Thu, 31 Jan 2019 22:01:27 +0000 Subject: [PATCH 4/5] fix: Import missing addQueryArgs method --- package-lock.json | 46 +++++++------------------ packages/edit-post/src/plugins/index.js | 1 + 2 files changed, 13 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 83491b6775a238..4af334996808c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2975,7 +2975,6 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, - "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -2987,7 +2986,6 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, - "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -8105,8 +8103,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -8127,14 +8124,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8149,20 +8144,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -8279,8 +8271,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -8292,7 +8283,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -8307,7 +8297,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -8315,14 +8304,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -8341,7 +8328,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -8422,8 +8408,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -8435,7 +8420,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -8521,8 +8505,7 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -8558,7 +8541,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -8578,7 +8560,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -8622,14 +8603,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -12727,8 +12706,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "longest-streak": { "version": "2.0.2", diff --git a/packages/edit-post/src/plugins/index.js b/packages/edit-post/src/plugins/index.js index 7a6ea233dfeb88..05a079db4738f2 100644 --- a/packages/edit-post/src/plugins/index.js +++ b/packages/edit-post/src/plugins/index.js @@ -5,6 +5,7 @@ import { MenuItem } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { registerPlugin } from '@wordpress/plugins'; +import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies From a39622a3bd7c0ba36e453a66e2bdf97aebc5268c Mon Sep 17 00:00:00 2001 From: Sofia Sousa Date: Sun, 3 Feb 2019 00:00:05 +0000 Subject: [PATCH 5/5] chore: Update package-lock after run npm@6.7 install --- package-lock.json | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4af334996808c9..83491b6775a238 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2975,6 +2975,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -2986,6 +2987,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, + "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -8103,7 +8105,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -8124,12 +8127,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8144,17 +8149,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -8271,7 +8279,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -8283,6 +8292,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -8297,6 +8307,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -8304,12 +8315,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -8328,6 +8341,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -8408,7 +8422,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -8420,6 +8435,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -8505,7 +8521,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -8541,6 +8558,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -8560,6 +8578,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -8603,12 +8622,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -12706,7 +12727,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "longest-streak": { "version": "2.0.2",