{"action":"created","comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/213289852","pull_request_review_id":150093231,"id":213289852,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzI4OTg1Mg==","diff_hunk":"@@ -23,6 +23,9 @@ import { BlockControls, BlockAlignmentToolbar } from '../components';\n  * @return {Object}          Filtered block settings\n  */\n export function addAttribute( settings ) {\n+\tif ( has( settings, [ 'attributes', 'align' ] ) ) {","path":"packages/editor/src/hooks/align.js","position":13,"original_position":13,"commit_id":"64a1bfe4a9b19a1e24cded950e3df60535a6583f","original_commit_id":"64a1bfe4a9b19a1e24cded950e3df60535a6583f","user":{"login":"aduth","id":1779930,"node_id":"MDQ6VXNlcjE3Nzk5MzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1779930?v=4","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"Do we expect `settings` to always be non-undefined?\r\n\r\n- If yes, we don't need to incur Lodash's extra nullish check on `settings.attributes`, and instead express this as `has( settings.attributes, [ 'align' ] )`\r\n- If no, then we have issues below where we assign a new `settings.attributes` on what we're arguing to be a potentially `undefined` settings object","created_at":"2018-08-28T12:19:45Z","updated_at":"2018-08-28T12:19:45Z","html_url":"https://github.com/WordPress/gutenberg/pull/7184#discussion_r213289852","pull_request_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/213289852"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/7184#discussion_r213289852"},"pull_request":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184"}},"in_reply_to_id":213289402},"pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184","id":193089263,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMDg5MjYz","html_url":"https://github.com/WordPress/gutenberg/pull/7184","diff_url":"https://github.com/WordPress/gutenberg/pull/7184.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/7184.patch","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7184","number":7184,"state":"open","locked":false,"title":"Only show transforms to blocks that can be inserted on the root block; Order transforms by frecency;","user":{"login":"jorgefilipecosta","id":11271197,"node_id":"MDQ6VXNlcjExMjcxMTk3","avatar_url":"https://avatars1.githubusercontent.com/u/11271197?v=4","gravatar_id":"","url":"https://api.github.com/users/jorgefilipecosta","html_url":"https://github.com/jorgefilipecosta","followers_url":"https://api.github.com/users/jorgefilipecosta/followers","following_url":"https://api.github.com/users/jorgefilipecosta/following{/other_user}","gists_url":"https://api.github.com/users/jorgefilipecosta/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgefilipecosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgefilipecosta/subscriptions","organizations_url":"https://api.github.com/users/jorgefilipecosta/orgs","repos_url":"https://api.github.com/users/jorgefilipecosta/repos","events_url":"https://api.github.com/users/jorgefilipecosta/events{/privacy}","received_events_url":"https://api.github.com/users/jorgefilipecosta/received_events","type":"User","site_admin":false},"body":"Fixes: https://github.com/WordPress/gutenberg/issues/6363\r\nPart of a general polishing to get #6993.\r\nRelates to: https://github.com/WordPress/gutenberg/issues/7227\r\n\r\nThis PR makes sure we can only transform to blocks that can be inserted in the root block.\r\nThe transformations are also sorted by frecency (a heuristic used by the inserter)  so items transformations should appear in the same order as they appear on the inserter.\r\n\r\nTest block: https://gist.github.com/jorgefilipecosta/b958239761a24664685d5efc7ab48fa6\r\n(can be pasted in the browser console)\r\n## How has this been tested?\r\nUse a block that sets allowed blocks in the nested area (test block). Verify it is only possible to transform blocks to the allowed blocks (list and quote).\r\nTest both single and multi-block transforms and verify the restriction applies to transforms rendered on the block toolbar and to transforms presented on the side menu.\r\nVerify that if the allowed blocks restriction is applied via PHP filters, the transforms also respect it.\r\ne.g:\r\n```\r\nadd_filter( 'allowed_block_types', function( $allowed_block_types, $post ) {\r\n\tif ( $post->post_type === 'post' ) {\r\n\t    return $allowed_block_types;\r\n\t}\r\n\treturn [ 'core/paragraph' ];\r\n}, 10, 2 );\r\n```\r\n\r\nVerify the order blocks appear on the transformations list is the same as the order they appear on the inserted.","created_at":"2018-06-06T17:40:20Z","updated_at":"2018-08-28T12:19:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aef0a4c1c0616a84f2c111882302f50ff681a2ca","assignee":{"login":"jorgefilipecosta","id":11271197,"node_id":"MDQ6VXNlcjExMjcxMTk3","avatar_url":"https://avatars1.githubusercontent.com/u/11271197?v=4","gravatar_id":"","url":"https://api.github.com/users/jorgefilipecosta","html_url":"https://github.com/jorgefilipecosta","followers_url":"https://api.github.com/users/jorgefilipecosta/followers","following_url":"https://api.github.com/users/jorgefilipecosta/following{/other_user}","gists_url":"https://api.github.com/users/jorgefilipecosta/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgefilipecosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgefilipecosta/subscriptions","organizations_url":"https://api.github.com/users/jorgefilipecosta/orgs","repos_url":"https://api.github.com/users/jorgefilipecosta/repos","events_url":"https://api.github.com/users/jorgefilipecosta/events{/privacy}","received_events_url":"https://api.github.com/users/jorgefilipecosta/received_events","type":"User","site_admin":false},"assignees":[{"login":"jorgefilipecosta","id":11271197,"node_id":"MDQ6VXNlcjExMjcxMTk3","avatar_url":"https://avatars1.githubusercontent.com/u/11271197?v=4","gravatar_id":"","url":"https://api.github.com/users/jorgefilipecosta","html_url":"https://github.com/jorgefilipecosta","followers_url":"https://api.github.com/users/jorgefilipecosta/followers","following_url":"https://api.github.com/users/jorgefilipecosta/following{/other_user}","gists_url":"https://api.github.com/users/jorgefilipecosta/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgefilipecosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgefilipecosta/subscriptions","organizations_url":"https://api.github.com/users/jorgefilipecosta/orgs","repos_url":"https://api.github.com/users/jorgefilipecosta/repos","events_url":"https://api.github.com/users/jorgefilipecosta/events{/privacy}","received_events_url":"https://api.github.com/users/jorgefilipecosta/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":531680823,"node_id":"MDU6TGFiZWw1MzE2ODA4MjM=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Bug","name":"[Type] Bug","color":"d93f0b","default":false}],"milestone":{"url":"https://api.github.com/repos/WordPress/gutenberg/milestones/62","html_url":"https://github.com/WordPress/gutenberg/milestone/62","labels_url":"https://api.github.com/repos/WordPress/gutenberg/milestones/62/labels","id":3572512,"node_id":"MDk6TWlsZXN0b25lMzU3MjUxMg==","number":62,"title":"3.7","description":"","creator":{"login":"youknowriad","id":272444,"node_id":"MDQ6VXNlcjI3MjQ0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/272444?v=4","gravatar_id":"","url":"https://api.github.com/users/youknowriad","html_url":"https://github.com/youknowriad","followers_url":"https://api.github.com/users/youknowriad/followers","following_url":"https://api.github.com/users/youknowriad/following{/other_user}","gists_url":"https://api.github.com/users/youknowriad/gists{/gist_id}","starred_url":"https://api.github.com/users/youknowriad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youknowriad/subscriptions","organizations_url":"https://api.github.com/users/youknowriad/orgs","repos_url":"https://api.github.com/users/youknowriad/repos","events_url":"https://api.github.com/users/youknowriad/events{/privacy}","received_events_url":"https://api.github.com/users/youknowriad/received_events","type":"User","site_admin":false},"open_issues":48,"closed_issues":78,"state":"open","created_at":"2018-08-15T13:05:08Z","updated_at":"2018-08-28T11:13:57Z","due_on":"2018-08-29T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184/commits","review_comments_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184/comments","review_comment_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7184/comments","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/64a1bfe4a9b19a1e24cded950e3df60535a6583f","head":{"label":"WordPress:update/only-transform-to-blocks-that-can-be-inserted-on-root","ref":"update/only-transform-to-blocks-that-can-be-inserted-on-root","sha":"64a1bfe4a9b19a1e24cded950e3df60535a6583f","user":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"node_id":"MDEwOlJlcG9zaXRvcnk4MDg2MjU4NA==","name":"gutenberg","full_name":"WordPress/gutenberg","owner":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Beta plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-08-28T11:39:18Z","pushed_at":"2018-08-28T12:16:39Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/ ","size":21838,"stargazers_count":3135,"watchers_count":3135,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":827,"mirror_url":null,"archived":false,"open_issues_count":1291,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":827,"open_issues":1291,"watchers":3135,"default_branch":"master"}},"base":{"label":"WordPress:master","ref":"master","sha":"d2074efea6543c378ee31924094d5c54ba01b8ac","user":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"node_id":"MDEwOlJlcG9zaXRvcnk4MDg2MjU4NA==","name":"gutenberg","full_name":"WordPress/gutenberg","owner":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Beta plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-08-28T11:39:18Z","pushed_at":"2018-08-28T12:16:39Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/ ","size":21838,"stargazers_count":3135,"watchers_count":3135,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":827,"mirror_url":null,"archived":false,"open_issues_count":1291,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":827,"open_issues":1291,"watchers":3135,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/7184"},"issue":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/7184"},"comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/7184/comments"},"review_comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184/comments"},"review_comment":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/7184/commits"},"statuses":{"href":"https://api.github.com/repos/WordPress/gutenberg/statuses/64a1bfe4a9b19a1e24cded950e3df60535a6583f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aduth"}}