{"action":"created","comment":{"url":"https://api.github.com/repos/decentraland/marketplace/pulls/comments/192602182","pull_request_review_id":125408015,"id":192602182,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjYwMjE4Mg==","diff_hunk":"@@ -0,0 +1,134 @@\n+import React from 'react'\n+import PropTypes from 'prop-types'\n+import { Container } from 'semantic-ui-react'\n+\n+import ParcelPreview from 'components/ParcelPreview'\n+import EstateSelectActions from './EstateSelectActions'\n+import Parcel from 'components/Parcel'\n+import { t } from 'modules/translation/utils'\n+import { isOwner } from 'modules/parcels/utils'\n+import { coordsType } from 'components/types'\n+\n+import './EstateSelect.css'\n+\n+export default class EstateSelect extends React.PureComponent {\n+  static propTypes = {\n+    x: PropTypes.number.isRequired,\n+    y: PropTypes.number.isRequired,\n+    error: PropTypes.string,\n+    onCancel: PropTypes.func.isRequired,\n+    onContinue: PropTypes.func.isRequired,\n+    onChange: PropTypes.func.isRequired,\n+    value: PropTypes.arrayOf(coordsType).isRequired\n+  }\n+\n+  isNeighbour = (x, y) => coords => {\n+    return (\n+      (coords.x === x && (coords.y + 1 === y || coords.y - 1 === y)) ||\n+      (coords.y === y && (coords.x + 1 === x || coords.x - 1 === x))\n+    )\n+  }\n+\n+  hasNeighbour = (x, y) => {\n+    const { value: parcels } = this.props\n+    return parcels.some(this.isNeighbour(x, y))\n+  }\n+\n+  getNeighbours = (x, y, parcels = this.props.parcels) => {\n+    return parcels.filter(this.isNeighbour(x, y))\n+  }\n+\n+  areConnected = (parcels, alreadyTraveled = [], remaining = [...parcels]) => {\n+    if (alreadyTraveled.length === parcels.length) {\n+      return true\n+    }\n+\n+    if (remaining.length === 0) {\n+      return false\n+    }\n+\n+    let actual = remaining.pop()\n+\n+    const neighbours = this.getNeighbours(actual.x, actual.y, parcels).filter(\n+      coords => {\n+        return (\n+          parcels.some(\n+            coords2 => coords.x === coords2.x && coords.y === coords2.y\n+          ) &&\n+          !alreadyTraveled.some(\n+            coords2 => coords.x === coords2.x && coords.y === coords2.y\n+          )\n+        )\n+      }\n+    )\n+\n+    return this.areConnected(\n+      parcels,\n+      [...alreadyTraveled, ...neighbours],\n+      remaining\n+    )\n+  }\n+\n+  handleParcelClick = wallet => (x, y) => {\n+    if (!isOwner(wallet, x, y)) {\n+      return\n+    }\n+\n+    if (!this.hasNeighbour(x, y)) {\n+      return\n+    }","path":"webapp/src/components/CreateEstatePage/EstateSelect/EstateSelect.js","position":75,"original_position":79,"commit_id":"539d61796ea4d7c047323646a99e8cff42f8797a","original_commit_id":"7053ad09f112e860761e2e6b46cc3923dacce4d1","user":{"login":"fmiras","id":14364153,"node_id":"MDQ6VXNlcjE0MzY0MTUz","avatar_url":"https://avatars1.githubusercontent.com/u/14364153?v=4","gravatar_id":"","url":"https://api.github.com/users/fmiras","html_url":"https://github.com/fmiras","followers_url":"https://api.github.com/users/fmiras/followers","following_url":"https://api.github.com/users/fmiras/following{/other_user}","gists_url":"https://api.github.com/users/fmiras/gists{/gist_id}","starred_url":"https://api.github.com/users/fmiras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmiras/subscriptions","organizations_url":"https://api.github.com/users/fmiras/orgs","repos_url":"https://api.github.com/users/fmiras/repos","events_url":"https://api.github.com/users/fmiras/events{/privacy}","received_events_url":"https://api.github.com/users/fmiras/received_events","type":"User","site_admin":false},"body":"I agree to merge the function validations with and OR, in some point maybe a very big or concatenated chain may be difficult to read, but in this case there are only two.\r\n\r\nAccording to the boolean return, why do you prefer returning false instead of nothing? The purpose of this return statement is to stop executing code because is conditional code, also I think that returning a boolean flag will make harder to understand because coders may think that is meant to be use as a function for validating instead of execution.","created_at":"2018-06-03T20:57:53Z","updated_at":"2018-06-03T20:57:53Z","html_url":"https://github.com/decentraland/marketplace/pull/224#discussion_r192602182","pull_request_url":"https://api.github.com/repos/decentraland/marketplace/pulls/224","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/decentraland/marketplace/pulls/comments/192602182"},"html":{"href":"https://github.com/decentraland/marketplace/pull/224#discussion_r192602182"},"pull_request":{"href":"https://api.github.com/repos/decentraland/marketplace/pulls/224"}},"in_reply_to_id":192195461},"pull_request":{"url":"https://api.github.com/repos/decentraland/marketplace/pulls/224","id":188846944,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4ODQ2OTQ0","html_url":"https://github.com/decentraland/marketplace/pull/224","diff_url":"https://github.com/decentraland/marketplace/pull/224.diff","patch_url":"https://github.com/decentraland/marketplace/pull/224.patch","issue_url":"https://api.github.com/repos/decentraland/marketplace/issues/224","number":224,"state":"open","locked":false,"title":"feat: create estate UI","user":{"login":"fmiras","id":14364153,"node_id":"MDQ6VXNlcjE0MzY0MTUz","avatar_url":"https://avatars1.githubusercontent.com/u/14364153?v=4","gravatar_id":"","url":"https://api.github.com/users/fmiras","html_url":"https://github.com/fmiras","followers_url":"https://api.github.com/users/fmiras/followers","following_url":"https://api.github.com/users/fmiras/following{/other_user}","gists_url":"https://api.github.com/users/fmiras/gists{/gist_id}","starred_url":"https://api.github.com/users/fmiras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmiras/subscriptions","organizations_url":"https://api.github.com/users/fmiras/orgs","repos_url":"https://api.github.com/users/fmiras/repos","events_url":"https://api.github.com/users/fmiras/events{/privacy}","received_events_url":"https://api.github.com/users/fmiras/received_events","type":"User","site_admin":false},"body":"- [x] Location:  +2 locations\r\n- [x] Routes: +1 route\r\n- [x] Component: Page -> (use ParcelDetailPage as layout model)\r\n- [x] Map: onClick and selected\r\n- [x] Validate that is more than 1 parcel\r\n- [x] Validate that selected parcels are from the operating owner\r\n- [x] Create estate modal and form to edit name and description\r\n- [x] Calculate center and zoom of estate preview (don't use first parcel X and Y)\r\n- [x] Validate that selected parcels are neighbours (pending decision)\r\n- [x] Create actions, reducers and saga\r\n- [x] Show estates on MY LAND\r\n- [x] Create Estate PropType\r\n- [x] Connect with Estate Backend\r\n- [x] Optionally enable Estates feature\r\n- [x] Translations\r\n\r\n","created_at":"2018-05-17T20:06:24Z","updated_at":"2018-06-03T20:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df1224eb8b35e66214b41baf01adbdc3e433e0c2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"cazala","id":2781777,"node_id":"MDQ6VXNlcjI3ODE3Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/2781777?v=4","gravatar_id":"","url":"https://api.github.com/users/cazala","html_url":"https://github.com/cazala","followers_url":"https://api.github.com/users/cazala/followers","following_url":"https://api.github.com/users/cazala/following{/other_user}","gists_url":"https://api.github.com/users/cazala/gists{/gist_id}","starred_url":"https://api.github.com/users/cazala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cazala/subscriptions","organizations_url":"https://api.github.com/users/cazala/orgs","repos_url":"https://api.github.com/users/cazala/repos","events_url":"https://api.github.com/users/cazala/events{/privacy}","received_events_url":"https://api.github.com/users/cazala/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":788370812,"node_id":"MDU6TGFiZWw3ODgzNzA4MTI=","url":"https://api.github.com/repos/decentraland/marketplace/labels/ready%20for%20review","name":"ready for review","color":"134ecc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/decentraland/marketplace/pulls/224/commits","review_comments_url":"https://api.github.com/repos/decentraland/marketplace/pulls/224/comments","review_comment_url":"https://api.github.com/repos/decentraland/marketplace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/decentraland/marketplace/issues/224/comments","statuses_url":"https://api.github.com/repos/decentraland/marketplace/statuses/539d61796ea4d7c047323646a99e8cff42f8797a","head":{"label":"decentraland:feat/create-estate","ref":"feat/create-estate","sha":"539d61796ea4d7c047323646a99e8cff42f8797a","user":{"login":"decentraland","id":12685795,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjg1Nzk1","avatar_url":"https://avatars3.githubusercontent.com/u/12685795?v=4","gravatar_id":"","url":"https://api.github.com/users/decentraland","html_url":"https://github.com/decentraland","followers_url":"https://api.github.com/users/decentraland/followers","following_url":"https://api.github.com/users/decentraland/following{/other_user}","gists_url":"https://api.github.com/users/decentraland/gists{/gist_id}","starred_url":"https://api.github.com/users/decentraland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decentraland/subscriptions","organizations_url":"https://api.github.com/users/decentraland/orgs","repos_url":"https://api.github.com/users/decentraland/repos","events_url":"https://api.github.com/users/decentraland/events{/privacy}","received_events_url":"https://api.github.com/users/decentraland/received_events","type":"Organization","site_admin":false},"repo":{"id":115438139,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU0MzgxMzk=","name":"marketplace","full_name":"decentraland/marketplace","owner":{"login":"decentraland","id":12685795,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjg1Nzk1","avatar_url":"https://avatars3.githubusercontent.com/u/12685795?v=4","gravatar_id":"","url":"https://api.github.com/users/decentraland","html_url":"https://github.com/decentraland","followers_url":"https://api.github.com/users/decentraland/followers","following_url":"https://api.github.com/users/decentraland/following{/other_user}","gists_url":"https://api.github.com/users/decentraland/gists{/gist_id}","starred_url":"https://api.github.com/users/decentraland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decentraland/subscriptions","organizations_url":"https://api.github.com/users/decentraland/orgs","repos_url":"https://api.github.com/users/decentraland/repos","events_url":"https://api.github.com/users/decentraland/events{/privacy}","received_events_url":"https://api.github.com/users/decentraland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/decentraland/marketplace","description":"🏛️ Decentraland's LAND Marketplace","fork":false,"url":"https://api.github.com/repos/decentraland/marketplace","forks_url":"https://api.github.com/repos/decentraland/marketplace/forks","keys_url":"https://api.github.com/repos/decentraland/marketplace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/decentraland/marketplace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/decentraland/marketplace/teams","hooks_url":"https://api.github.com/repos/decentraland/marketplace/hooks","issue_events_url":"https://api.github.com/repos/decentraland/marketplace/issues/events{/number}","events_url":"https://api.github.com/repos/decentraland/marketplace/events","assignees_url":"https://api.github.com/repos/decentraland/marketplace/assignees{/user}","branches_url":"https://api.github.com/repos/decentraland/marketplace/branches{/branch}","tags_url":"https://api.github.com/repos/decentraland/marketplace/tags","blobs_url":"https://api.github.com/repos/decentraland/marketplace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/decentraland/marketplace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/decentraland/marketplace/git/refs{/sha}","trees_url":"https://api.github.com/repos/decentraland/marketplace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/decentraland/marketplace/statuses/{sha}","languages_url":"https://api.github.com/repos/decentraland/marketplace/languages","stargazers_url":"https://api.github.com/repos/decentraland/marketplace/stargazers","contributors_url":"https://api.github.com/repos/decentraland/marketplace/contributors","subscribers_url":"https://api.github.com/repos/decentraland/marketplace/subscribers","subscription_url":"https://api.github.com/repos/decentraland/marketplace/subscription","commits_url":"https://api.github.com/repos/decentraland/marketplace/commits{/sha}","git_commits_url":"https://api.github.com/repos/decentraland/marketplace/git/commits{/sha}","comments_url":"https://api.github.com/repos/decentraland/marketplace/comments{/number}","issue_comment_url":"https://api.github.com/repos/decentraland/marketplace/issues/comments{/number}","contents_url":"https://api.github.com/repos/decentraland/marketplace/contents/{+path}","compare_url":"https://api.github.com/repos/decentraland/marketplace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/decentraland/marketplace/merges","archive_url":"https://api.github.com/repos/decentraland/marketplace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/decentraland/marketplace/downloads","issues_url":"https://api.github.com/repos/decentraland/marketplace/issues{/number}","pulls_url":"https://api.github.com/repos/decentraland/marketplace/pulls{/number}","milestones_url":"https://api.github.com/repos/decentraland/marketplace/milestones{/number}","notifications_url":"https://api.github.com/repos/decentraland/marketplace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/decentraland/marketplace/labels{/name}","releases_url":"https://api.github.com/repos/decentraland/marketplace/releases{/id}","deployments_url":"https://api.github.com/repos/decentraland/marketplace/deployments","created_at":"2017-12-26T16:31:44Z","updated_at":"2018-06-01T22:00:41Z","pushed_at":"2018-06-03T20:29:52Z","git_url":"git://github.com/decentraland/marketplace.git","ssh_url":"git@github.com:decentraland/marketplace.git","clone_url":"https://github.com/decentraland/marketplace.git","svn_url":"https://github.com/decentraland/marketplace","homepage":"https://market.decentraland.org","size":7567,"stargazers_count":41,"watchers_count":41,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":12,"open_issues":16,"watchers":41,"default_branch":"master"}},"base":{"label":"decentraland:master","ref":"master","sha":"54848b67ca40152b14031d0e369110d47b235590","user":{"login":"decentraland","id":12685795,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjg1Nzk1","avatar_url":"https://avatars3.githubusercontent.com/u/12685795?v=4","gravatar_id":"","url":"https://api.github.com/users/decentraland","html_url":"https://github.com/decentraland","followers_url":"https://api.github.com/users/decentraland/followers","following_url":"https://api.github.com/users/decentraland/following{/other_user}","gists_url":"https://api.github.com/users/decentraland/gists{/gist_id}","starred_url":"https://api.github.com/users/decentraland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decentraland/subscriptions","organizations_url":"https://api.github.com/users/decentraland/orgs","repos_url":"https://api.github.com/users/decentraland/repos","events_url":"https://api.github.com/users/decentraland/events{/privacy}","received_events_url":"https://api.github.com/users/decentraland/received_events","type":"Organization","site_admin":false},"repo":{"id":115438139,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU0MzgxMzk=","name":"marketplace","full_name":"decentraland/marketplace","owner":{"login":"decentraland","id":12685795,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjg1Nzk1","avatar_url":"https://avatars3.githubusercontent.com/u/12685795?v=4","gravatar_id":"","url":"https://api.github.com/users/decentraland","html_url":"https://github.com/decentraland","followers_url":"https://api.github.com/users/decentraland/followers","following_url":"https://api.github.com/users/decentraland/following{/other_user}","gists_url":"https://api.github.com/users/decentraland/gists{/gist_id}","starred_url":"https://api.github.com/users/decentraland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decentraland/subscriptions","organizations_url":"https://api.github.com/users/decentraland/orgs","repos_url":"https://api.github.com/users/decentraland/repos","events_url":"https://api.github.com/users/decentraland/events{/privacy}","received_events_url":"https://api.github.com/users/decentraland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/decentraland/marketplace","description":"🏛️ Decentraland's LAND Marketplace","fork":false,"url":"https://api.github.com/repos/decentraland/marketplace","forks_url":"https://api.github.com/repos/decentraland/marketplace/forks","keys_url":"https://api.github.com/repos/decentraland/marketplace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/decentraland/marketplace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/decentraland/marketplace/teams","hooks_url":"https://api.github.com/repos/decentraland/marketplace/hooks","issue_events_url":"https://api.github.com/repos/decentraland/marketplace/issues/events{/number}","events_url":"https://api.github.com/repos/decentraland/marketplace/events","assignees_url":"https://api.github.com/repos/decentraland/marketplace/assignees{/user}","branches_url":"https://api.github.com/repos/decentraland/marketplace/branches{/branch}","tags_url":"https://api.github.com/repos/decentraland/marketplace/tags","blobs_url":"https://api.github.com/repos/decentraland/marketplace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/decentraland/marketplace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/decentraland/marketplace/git/refs{/sha}","trees_url":"https://api.github.com/repos/decentraland/marketplace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/decentraland/marketplace/statuses/{sha}","languages_url":"https://api.github.com/repos/decentraland/marketplace/languages","stargazers_url":"https://api.github.com/repos/decentraland/marketplace/stargazers","contributors_url":"https://api.github.com/repos/decentraland/marketplace/contributors","subscribers_url":"https://api.github.com/repos/decentraland/marketplace/subscribers","subscription_url":"https://api.github.com/repos/decentraland/marketplace/subscription","commits_url":"https://api.github.com/repos/decentraland/marketplace/commits{/sha}","git_commits_url":"https://api.github.com/repos/decentraland/marketplace/git/commits{/sha}","comments_url":"https://api.github.com/repos/decentraland/marketplace/comments{/number}","issue_comment_url":"https://api.github.com/repos/decentraland/marketplace/issues/comments{/number}","contents_url":"https://api.github.com/repos/decentraland/marketplace/contents/{+path}","compare_url":"https://api.github.com/repos/decentraland/marketplace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/decentraland/marketplace/merges","archive_url":"https://api.github.com/repos/decentraland/marketplace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/decentraland/marketplace/downloads","issues_url":"https://api.github.com/repos/decentraland/marketplace/issues{/number}","pulls_url":"https://api.github.com/repos/decentraland/marketplace/pulls{/number}","milestones_url":"https://api.github.com/repos/decentraland/marketplace/milestones{/number}","notifications_url":"https://api.github.com/repos/decentraland/marketplace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/decentraland/marketplace/labels{/name}","releases_url":"https://api.github.com/repos/decentraland/marketplace/releases{/id}","deployments_url":"https://api.github.com/repos/decentraland/marketplace/deployments","created_at":"2017-12-26T16:31:44Z","updated_at":"2018-06-01T22:00:41Z","pushed_at":"2018-06-03T20:29:52Z","git_url":"git://github.com/decentraland/marketplace.git","ssh_url":"git@github.com:decentraland/marketplace.git","clone_url":"https://github.com/decentraland/marketplace.git","svn_url":"https://github.com/decentraland/marketplace","homepage":"https://market.decentraland.org","size":7567,"stargazers_count":41,"watchers_count":41,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":12,"open_issues":16,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/decentraland/marketplace/pulls/224"},"html":{"href":"https://github.com/decentraland/marketplace/pull/224"},"issue":{"href":"https://api.github.com/repos/decentraland/marketplace/issues/224"},"comments":{"href":"https://api.github.com/repos/decentraland/marketplace/issues/224/comments"},"review_comments":{"href":"https://api.github.com/repos/decentraland/marketplace/pulls/224/comments"},"review_comment":{"href":"https://api.github.com/repos/decentraland/marketplace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/decentraland/marketplace/pulls/224/commits"},"statuses":{"href":"https://api.github.com/repos/decentraland/marketplace/statuses/539d61796ea4d7c047323646a99e8cff42f8797a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"fmiras"}}