{"action":"created","comment":{"url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/comments/217508762","pull_request_review_id":155239622,"id":217508762,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzUwODc2Mg==","diff_hunk":"@@ -0,0 +1,16 @@\n+/**\n+ * Calculate the percentage of two numbers\n+ *\n+ * @param {number} value Initial value from where to take the percentage\n+ * @param {number} total Total value to get the percentage relative to this value\n+ * @returns {number} total percentage value\n+ */\n+export const percentage = ( value = 0, total = 0 ) => {\n+\tif ( total === 0 ) {\n+\t\treturn 0;\n+\t}\n+\n+\tconst result = Number.parseFloat( ( value / total ) * 100 );\n+\n+\treturn isNaN( result ) ? 0 : result;","path":"plugins/common/src/modules/utils/number.js","position":15,"original_position":15,"commit_id":"5ddaa6fdb45a04c3bf6d715ca9afbe8d391a6d0b","original_commit_id":"5ddaa6fdb45a04c3bf6d715ca9afbe8d391a6d0b","user":{"login":"paulmskim","id":16699941,"node_id":"MDQ6VXNlcjE2Njk5OTQx","avatar_url":"https://avatars2.githubusercontent.com/u/16699941?v=4","gravatar_id":"","url":"https://api.github.com/users/paulmskim","html_url":"https://github.com/paulmskim","followers_url":"https://api.github.com/users/paulmskim/followers","following_url":"https://api.github.com/users/paulmskim/following{/other_user}","gists_url":"https://api.github.com/users/paulmskim/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmskim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmskim/subscriptions","organizations_url":"https://api.github.com/users/paulmskim/orgs","repos_url":"https://api.github.com/users/paulmskim/repos","events_url":"https://api.github.com/users/paulmskim/events{/privacy}","received_events_url":"https://api.github.com/users/paulmskim/received_events","type":"User","site_admin":false},"body":"last thing here, and the same above where `if ( total === 0 )`, if `result` is `NaN`, we shouldn't be returning 0 as that doesn't make any sense. We should probably return `NaN` or `false` to separate a bad result from a result that is actually 0.","created_at":"2018-09-13T19:37:42Z","updated_at":"2018-09-13T19:37:42Z","html_url":"https://github.com/moderntribe/events-gutenberg/pull/310#discussion_r217508762","pull_request_url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/comments/217508762"},"html":{"href":"https://github.com/moderntribe/events-gutenberg/pull/310#discussion_r217508762"},"pull_request":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310"}}},"pull_request":{"url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310","id":215143205,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MTQzMjA1","html_url":"https://github.com/moderntribe/events-gutenberg/pull/310","diff_url":"https://github.com/moderntribe/events-gutenberg/pull/310.diff","patch_url":"https://github.com/moderntribe/events-gutenberg/pull/310.patch","issue_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/310","number":310,"state":"open","locked":false,"title":"Add <Ticket> block","user":{"login":"mitogh","id":3921289,"node_id":"MDQ6VXNlcjM5MjEyODk=","avatar_url":"https://avatars1.githubusercontent.com/u/3921289?v=4","gravatar_id":"","url":"https://api.github.com/users/mitogh","html_url":"https://github.com/mitogh","followers_url":"https://api.github.com/users/mitogh/followers","following_url":"https://api.github.com/users/mitogh/following{/other_user}","gists_url":"https://api.github.com/users/mitogh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitogh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitogh/subscriptions","organizations_url":"https://api.github.com/users/mitogh/orgs","repos_url":"https://api.github.com/users/mitogh/repos","events_url":"https://api.github.com/users/mitogh/events{/privacy}","received_events_url":"https://api.github.com/users/mitogh/received_events","type":"User","site_admin":false},"body":"Create a child block available to insert a new ticket inside of the tickets list","created_at":"2018-09-13T01:56:49Z","updated_at":"2018-09-13T19:37:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"980fd7638012a4ecd5615eccf110fc410f161382","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bordoni","id":236579,"node_id":"MDQ6VXNlcjIzNjU3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/236579?v=4","gravatar_id":"","url":"https://api.github.com/users/bordoni","html_url":"https://github.com/bordoni","followers_url":"https://api.github.com/users/bordoni/followers","following_url":"https://api.github.com/users/bordoni/following{/other_user}","gists_url":"https://api.github.com/users/bordoni/gists{/gist_id}","starred_url":"https://api.github.com/users/bordoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bordoni/subscriptions","organizations_url":"https://api.github.com/users/bordoni/orgs","repos_url":"https://api.github.com/users/bordoni/repos","events_url":"https://api.github.com/users/bordoni/events{/privacy}","received_events_url":"https://api.github.com/users/bordoni/received_events","type":"User","site_admin":false},{"login":"nealfennimore","id":5731551,"node_id":"MDQ6VXNlcjU3MzE1NTE=","avatar_url":"https://avatars3.githubusercontent.com/u/5731551?v=4","gravatar_id":"","url":"https://api.github.com/users/nealfennimore","html_url":"https://github.com/nealfennimore","followers_url":"https://api.github.com/users/nealfennimore/followers","following_url":"https://api.github.com/users/nealfennimore/following{/other_user}","gists_url":"https://api.github.com/users/nealfennimore/gists{/gist_id}","starred_url":"https://api.github.com/users/nealfennimore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nealfennimore/subscriptions","organizations_url":"https://api.github.com/users/nealfennimore/orgs","repos_url":"https://api.github.com/users/nealfennimore/repos","events_url":"https://api.github.com/users/nealfennimore/events{/privacy}","received_events_url":"https://api.github.com/users/nealfennimore/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":807884483,"node_id":"MDU6TGFiZWw4MDc4ODQ0ODM=","url":"https://api.github.com/repos/moderntribe/events-gutenberg/labels/review:enhance","name":"review:enhance","color":"bfd4f2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310/commits","review_comments_url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310/comments","review_comment_url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/310/comments","statuses_url":"https://api.github.com/repos/moderntribe/events-gutenberg/statuses/5ddaa6fdb45a04c3bf6d715ca9afbe8d391a6d0b","head":{"label":"moderntribe:110052/ticket-item","ref":"110052/ticket-item","sha":"5ddaa6fdb45a04c3bf6d715ca9afbe8d391a6d0b","user":{"login":"moderntribe","id":2279551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNzk1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"repo":{"id":117871285,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc4NzEyODU=","name":"events-gutenberg","full_name":"moderntribe/events-gutenberg","owner":{"login":"moderntribe","id":2279551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNzk1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moderntribe/events-gutenberg","description":null,"fork":false,"url":"https://api.github.com/repos/moderntribe/events-gutenberg","forks_url":"https://api.github.com/repos/moderntribe/events-gutenberg/forks","keys_url":"https://api.github.com/repos/moderntribe/events-gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moderntribe/events-gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moderntribe/events-gutenberg/teams","hooks_url":"https://api.github.com/repos/moderntribe/events-gutenberg/hooks","issue_events_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/moderntribe/events-gutenberg/events","assignees_url":"https://api.github.com/repos/moderntribe/events-gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/moderntribe/events-gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/moderntribe/events-gutenberg/tags","blobs_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moderntribe/events-gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/moderntribe/events-gutenberg/languages","stargazers_url":"https://api.github.com/repos/moderntribe/events-gutenberg/stargazers","contributors_url":"https://api.github.com/repos/moderntribe/events-gutenberg/contributors","subscribers_url":"https://api.github.com/repos/moderntribe/events-gutenberg/subscribers","subscription_url":"https://api.github.com/repos/moderntribe/events-gutenberg/subscription","commits_url":"https://api.github.com/repos/moderntribe/events-gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/moderntribe/events-gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/moderntribe/events-gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/moderntribe/events-gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moderntribe/events-gutenberg/merges","archive_url":"https://api.github.com/repos/moderntribe/events-gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moderntribe/events-gutenberg/downloads","issues_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/moderntribe/events-gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/moderntribe/events-gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moderntribe/events-gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/moderntribe/events-gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/moderntribe/events-gutenberg/deployments","created_at":"2018-01-17T17:46:47Z","updated_at":"2018-09-13T19:11:55Z","pushed_at":"2018-09-13T19:11:55Z","git_url":"git://github.com/moderntribe/events-gutenberg.git","ssh_url":"git@github.com:moderntribe/events-gutenberg.git","clone_url":"https://github.com/moderntribe/events-gutenberg.git","svn_url":"https://github.com/moderntribe/events-gutenberg","homepage":"https://theeventscalendar.com/extensions/events-gutenberg/","size":4451,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":7,"watchers":18,"default_branch":"master"}},"base":{"label":"moderntribe:feature/event-ticket-blocks","ref":"feature/event-ticket-blocks","sha":"8af10ca9dc527abd964d931c89bd6ea6f02bdb62","user":{"login":"moderntribe","id":2279551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNzk1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"repo":{"id":117871285,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc4NzEyODU=","name":"events-gutenberg","full_name":"moderntribe/events-gutenberg","owner":{"login":"moderntribe","id":2279551,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNzk1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2279551?v=4","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moderntribe/events-gutenberg","description":null,"fork":false,"url":"https://api.github.com/repos/moderntribe/events-gutenberg","forks_url":"https://api.github.com/repos/moderntribe/events-gutenberg/forks","keys_url":"https://api.github.com/repos/moderntribe/events-gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moderntribe/events-gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moderntribe/events-gutenberg/teams","hooks_url":"https://api.github.com/repos/moderntribe/events-gutenberg/hooks","issue_events_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/moderntribe/events-gutenberg/events","assignees_url":"https://api.github.com/repos/moderntribe/events-gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/moderntribe/events-gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/moderntribe/events-gutenberg/tags","blobs_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moderntribe/events-gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/moderntribe/events-gutenberg/languages","stargazers_url":"https://api.github.com/repos/moderntribe/events-gutenberg/stargazers","contributors_url":"https://api.github.com/repos/moderntribe/events-gutenberg/contributors","subscribers_url":"https://api.github.com/repos/moderntribe/events-gutenberg/subscribers","subscription_url":"https://api.github.com/repos/moderntribe/events-gutenberg/subscription","commits_url":"https://api.github.com/repos/moderntribe/events-gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/moderntribe/events-gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/moderntribe/events-gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/moderntribe/events-gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/moderntribe/events-gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moderntribe/events-gutenberg/merges","archive_url":"https://api.github.com/repos/moderntribe/events-gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moderntribe/events-gutenberg/downloads","issues_url":"https://api.github.com/repos/moderntribe/events-gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/moderntribe/events-gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/moderntribe/events-gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moderntribe/events-gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/moderntribe/events-gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/moderntribe/events-gutenberg/deployments","created_at":"2018-01-17T17:46:47Z","updated_at":"2018-09-13T19:11:55Z","pushed_at":"2018-09-13T19:11:55Z","git_url":"git://github.com/moderntribe/events-gutenberg.git","ssh_url":"git@github.com:moderntribe/events-gutenberg.git","clone_url":"https://github.com/moderntribe/events-gutenberg.git","svn_url":"https://github.com/moderntribe/events-gutenberg","homepage":"https://theeventscalendar.com/extensions/events-gutenberg/","size":4451,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":7,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310"},"html":{"href":"https://github.com/moderntribe/events-gutenberg/pull/310"},"issue":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/310"},"comments":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/issues/310/comments"},"review_comments":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310/comments"},"review_comment":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/pulls/310/commits"},"statuses":{"href":"https://api.github.com/repos/moderntribe/events-gutenberg/statuses/5ddaa6fdb45a04c3bf6d715ca9afbe8d391a6d0b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"paulmskim"}}