{"action":"created","comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/191383327","pull_request_review_id":123942480,"id":191383327,"diff_hunk":"@@ -1230,20 +1230,20 @@ export const canInsertBlockType = createSelector(\n \t\t\treturn false;\n \t\t}\n \n-\t\tconst { allowedBlockTypes, templateLock } = getEditorSettings( state );\n+\t\tconst { allowedBlockTypes } = getEditorSettings( state );\n \n \t\tconst isBlockAllowedInEditor = checkAllowList( allowedBlockTypes, blockName, true );\n \t\tif ( ! isBlockAllowedInEditor ) {\n \t\t\treturn false;\n \t\t}\n \n-\t\tconst isEditorLocked = !! templateLock;\n-\t\tif ( isEditorLocked ) {\n+\t\tconst isLocked = !! getLocking( state, parentUID );\n+\t\tif ( isLocked ) {\n \t\t\treturn false;\n \t\t}\n \n \t\tconst parentBlockListSettings = getBlockListSettings( state, parentUID );\n-\t\tconst parentAllowedBlocks = get( parentBlockListSettings, [ 'supportedBlocks' ] );\n+\t\tconst parentAllowedBlocks = get( parentBlockListSettings, [ 'allowedBlocks' ] );","path":"editor/store/selectors.js","position":21,"original_position":21,"commit_id":"15d5c5042d53c3225ff2e669bd9c73b395125a97","original_commit_id":"15d5c5042d53c3225ff2e669bd9c73b395125a97","user":{"login":"youknowriad","id":272444,"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},"body":"Oh I see, it's renamed nvm","created_at":"2018-05-29T11:01:27Z","updated_at":"2018-05-29T11:01:28Z","html_url":"https://github.com/WordPress/gutenberg/pull/6991#discussion_r191383327","pull_request_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/191383327"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/6991#discussion_r191383327"},"pull_request":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991"}},"in_reply_to_id":191383215},"pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991","id":190981571,"html_url":"https://github.com/WordPress/gutenberg/pull/6991","diff_url":"https://github.com/WordPress/gutenberg/pull/6991.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/6991.patch","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/6991","number":6991,"state":"open","locked":false,"title":"Add InnerBlocks locking","user":{"login":"jorgefilipecosta","id":11271197,"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":"## Description\r\nThis PR adds the possibility to set locking in InnerBlocks in a similar way we can now do with the template locking.\r\nUsage:\r\n\r\n```js\r\nedit() {\r\n\treturn el( 'div', { style: { outline: '1px solid gray', padding: 5 } },\r\n\t\tel( InnerBlocks, {\r\n\t\t\tlocking: 'insert', // all, insert, or none\r\n\t\t\ttemplate: [\r\n\t\t\t\t[ 'core/paragraph', {\r\n\t\t\t\t\tplaceholder: 'Enter locking insert p1 content…',\r\n\t\t\t\t} ],\r\n\t\t\t\t[ 'core/paragraph', {\r\n\t\t\t\t\tplaceholder: 'Enter locking insert p2 content…',\r\n\t\t\t\t} ],\r\n\t\t\t],\r\n\t\t} )\r\n\t);\r\n}\r\n```\r\n\r\n\r\nLocking can be all, insert or not set.\r\nRight now with template locking if we have locking active and a template with a column block we cannot insert anything into the column so it seems locking applies to children.\r\nWe followed the same logic in this PR locking applies to descends even if the descends set a less restrictive locking or no locking at all. We may change this behavior but if changing it we should also change it for the CPT templates case.\r\n\r\n## How has this been tested?\r\n\r\nThe best way is to use the test blocks in https://gist.github.com/jorgefilipecosta/2bac096fe3be7f6ff0de7452292161cb, and verify everything works as expected. To simplest way to have the blocks is to paste all the code in the developer console.","created_at":"2018-05-28T18:45:43Z","updated_at":"2018-05-29T11:01:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdec9d388e0644225204236c44beee4be8d4eaa6","assignee":{"login":"jorgefilipecosta","id":11271197,"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,"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":[{"login":"noisysocks","id":612155,"avatar_url":"https://avatars1.githubusercontent.com/u/612155?v=4","gravatar_id":"","url":"https://api.github.com/users/noisysocks","html_url":"https://github.com/noisysocks","followers_url":"https://api.github.com/users/noisysocks/followers","following_url":"https://api.github.com/users/noisysocks/following{/other_user}","gists_url":"https://api.github.com/users/noisysocks/gists{/gist_id}","starred_url":"https://api.github.com/users/noisysocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisysocks/subscriptions","organizations_url":"https://api.github.com/users/noisysocks/orgs","repos_url":"https://api.github.com/users/noisysocks/repos","events_url":"https://api.github.com/users/noisysocks/events{/privacy}","received_events_url":"https://api.github.com/users/noisysocks/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":531680825,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Enhancement","name":"[Type] Enhancement","color":"c5def5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991/commits","review_comments_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991/comments","review_comment_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/6991/comments","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/15d5c5042d53c3225ff2e669bd9c73b395125a97","head":{"label":"WordPress:add/inner-blocks-locking","ref":"add/inner-blocks-locking","sha":"15d5c5042d53c3225ff2e669bd9c73b395125a97","user":{"login":"WordPress","id":276006,"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,"name":"gutenberg","full_name":"WordPress/gutenberg","owner":{"login":"WordPress","id":276006,"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-05-29T07:50:32Z","pushed_at":"2018-05-29T10:54:10Z","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":14770,"stargazers_count":2559,"watchers_count":2559,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":643,"mirror_url":null,"archived":false,"open_issues_count":830,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":643,"open_issues":830,"watchers":2559,"default_branch":"master"}},"base":{"label":"WordPress:master","ref":"master","sha":"bfafd1b6992e89cde8b71717043c1ec8c5a27e0d","user":{"login":"WordPress","id":276006,"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,"name":"gutenberg","full_name":"WordPress/gutenberg","owner":{"login":"WordPress","id":276006,"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-05-29T07:50:32Z","pushed_at":"2018-05-29T10:54:10Z","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":14770,"stargazers_count":2559,"watchers_count":2559,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":643,"mirror_url":null,"archived":false,"open_issues_count":830,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":643,"open_issues":830,"watchers":2559,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/6991"},"issue":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/6991"},"comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/6991/comments"},"review_comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991/comments"},"review_comment":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/6991/commits"},"statuses":{"href":"https://api.github.com/repos/WordPress/gutenberg/statuses/15d5c5042d53c3225ff2e669bd9c73b395125a97"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"youknowriad"}}