{"action":"created","comment":{"url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/comments/220929762","pull_request_review_id":159437766,"id":220929762,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDkyOTc2Mg==","diff_hunk":"@@ -0,0 +1,139 @@\n+import React, {Component} from 'react'\n+import {Button} from 'reactstrap'\n+import Dropzone from 'react-dropzone'\n+/*eslint-disable */\n+import ReactCrop from 'react-image-crop'\n+/*eslint-enable */\n+\n+import {connect} from 'react-redux'\n+import {FormattedMessage, injectIntl} from 'react-intl'\n+import {image64toCanvasRef, extractImageFileExtensionFromBase64} from './ReusableUtils';\n+\n+const imageMaxSize = 1000000000000000\n+const acceptedFileTypes = 'image/x-png, image/png, image/jpg, image/jpeg, image/gif'\n+const acceptedFileTypesArray = acceptedFileTypes.split(',').map((item) => {return item.trim()})\n+class ImgDropAndCrop extends Component {\n+    constructor(props){\n+        super(props)\n+        this.imagePreviewCanvasRef = React.createRef()\n+        this.state = {\n+            imgSrc: null,\n+            crop: {\n+                aspect: 1 / 1,\n+            },\n+            pixelCrop: null,\n+        }\n+    }\n+\n+    verifyFile = (files) => {\n+        if (files && files.length > 0) {\n+            const currentFile = files[0]\n+            const currentFileType = currentFile.type\n+            const currentFileSize = currentFile.size\n+            if(currentFileSize > imageMaxSize) {\n+                alert(<FormattedMessage id=\"profile.fileSize.error\" /> + currentFileSize + <FormattedMessage id=\"byte.size.error\" />)\n+                return false\n+            }\n+            if (!acceptedFileTypesArray.includes(currentFileType)){\n+                alert('This file is not allowed. Only images are allowed.')","path":"assets/js/components/ImgDropAndCrop/index.js","position":38,"original_position":38,"commit_id":"f6bb0e66bd25600aea1b3479af21c852229960de","original_commit_id":"ae253678997d558bbf7456b7c6c289c55130fea6","user":{"login":"jimppa","id":3331410,"node_id":"MDQ6VXNlcjMzMzE0MTA=","avatar_url":"https://avatars0.githubusercontent.com/u/3331410?v=4","gravatar_id":"","url":"https://api.github.com/users/jimppa","html_url":"https://github.com/jimppa","followers_url":"https://api.github.com/users/jimppa/followers","following_url":"https://api.github.com/users/jimppa/following{/other_user}","gists_url":"https://api.github.com/users/jimppa/gists{/gist_id}","starred_url":"https://api.github.com/users/jimppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimppa/subscriptions","organizations_url":"https://api.github.com/users/jimppa/orgs","repos_url":"https://api.github.com/users/jimppa/repos","events_url":"https://api.github.com/users/jimppa/events{/privacy}","received_events_url":"https://api.github.com/users/jimppa/received_events","type":"User","site_admin":false},"body":"This should be translatable.","created_at":"2018-09-27T13:48:09Z","updated_at":"2018-09-27T13:50:31Z","html_url":"https://github.com/City-of-Helsinki/omahelsinki/pull/27#discussion_r220929762","pull_request_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/comments/220929762"},"html":{"href":"https://github.com/City-of-Helsinki/omahelsinki/pull/27#discussion_r220929762"},"pull_request":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27","id":217611441,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NjExNDQx","html_url":"https://github.com/City-of-Helsinki/omahelsinki/pull/27","diff_url":"https://github.com/City-of-Helsinki/omahelsinki/pull/27.diff","patch_url":"https://github.com/City-of-Helsinki/omahelsinki/pull/27.patch","issue_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/27","number":27,"state":"open","locked":false,"title":"Feature/image crop","user":{"login":"Rasbin","id":15159607,"node_id":"MDQ6VXNlcjE1MTU5NjA3","avatar_url":"https://avatars1.githubusercontent.com/u/15159607?v=4","gravatar_id":"","url":"https://api.github.com/users/Rasbin","html_url":"https://github.com/Rasbin","followers_url":"https://api.github.com/users/Rasbin/followers","following_url":"https://api.github.com/users/Rasbin/following{/other_user}","gists_url":"https://api.github.com/users/Rasbin/gists{/gist_id}","starred_url":"https://api.github.com/users/Rasbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rasbin/subscriptions","organizations_url":"https://api.github.com/users/Rasbin/orgs","repos_url":"https://api.github.com/users/Rasbin/repos","events_url":"https://api.github.com/users/Rasbin/events{/privacy}","received_events_url":"https://api.github.com/users/Rasbin/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-24T10:26:36Z","updated_at":"2018-09-27T13:50:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6ef110d80cbe86037343c8c1c07e0fc37677d0f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27/commits","review_comments_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27/comments","review_comment_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/27/comments","statuses_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/statuses/f6bb0e66bd25600aea1b3479af21c852229960de","head":{"label":"City-of-Helsinki:feature/imageCrop","ref":"feature/imageCrop","sha":"f6bb0e66bd25600aea1b3479af21c852229960de","user":{"login":"City-of-Helsinki","id":1875564,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzU1NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1875564?v=4","gravatar_id":"","url":"https://api.github.com/users/City-of-Helsinki","html_url":"https://github.com/City-of-Helsinki","followers_url":"https://api.github.com/users/City-of-Helsinki/followers","following_url":"https://api.github.com/users/City-of-Helsinki/following{/other_user}","gists_url":"https://api.github.com/users/City-of-Helsinki/gists{/gist_id}","starred_url":"https://api.github.com/users/City-of-Helsinki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/City-of-Helsinki/subscriptions","organizations_url":"https://api.github.com/users/City-of-Helsinki/orgs","repos_url":"https://api.github.com/users/City-of-Helsinki/repos","events_url":"https://api.github.com/users/City-of-Helsinki/events{/privacy}","received_events_url":"https://api.github.com/users/City-of-Helsinki/received_events","type":"Organization","site_admin":false},"repo":{"id":138710736,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg3MTA3MzY=","name":"omahelsinki","full_name":"City-of-Helsinki/omahelsinki","private":false,"owner":{"login":"City-of-Helsinki","id":1875564,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzU1NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1875564?v=4","gravatar_id":"","url":"https://api.github.com/users/City-of-Helsinki","html_url":"https://github.com/City-of-Helsinki","followers_url":"https://api.github.com/users/City-of-Helsinki/followers","following_url":"https://api.github.com/users/City-of-Helsinki/following{/other_user}","gists_url":"https://api.github.com/users/City-of-Helsinki/gists{/gist_id}","starred_url":"https://api.github.com/users/City-of-Helsinki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/City-of-Helsinki/subscriptions","organizations_url":"https://api.github.com/users/City-of-Helsinki/orgs","repos_url":"https://api.github.com/users/City-of-Helsinki/repos","events_url":"https://api.github.com/users/City-of-Helsinki/events{/privacy}","received_events_url":"https://api.github.com/users/City-of-Helsinki/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/City-of-Helsinki/omahelsinki","description":"Djagno Wagtail site for oma.helsinki","fork":false,"url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki","forks_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/forks","keys_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/teams","hooks_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/hooks","issue_events_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/events{/number}","events_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/events","assignees_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/assignees{/user}","branches_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/branches{/branch}","tags_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/tags","blobs_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/refs{/sha}","trees_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/statuses/{sha}","languages_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/languages","stargazers_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/stargazers","contributors_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/contributors","subscribers_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/subscribers","subscription_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/subscription","commits_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/commits{/sha}","git_commits_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/commits{/sha}","comments_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/comments{/number}","issue_comment_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/comments{/number}","contents_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/contents/{+path}","compare_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/merges","archive_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/downloads","issues_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues{/number}","pulls_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls{/number}","milestones_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/milestones{/number}","notifications_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/labels{/name}","releases_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/releases{/id}","deployments_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/deployments","created_at":"2018-06-26T08:49:25Z","updated_at":"2018-09-25T13:19:22Z","pushed_at":"2018-09-27T13:00:02Z","git_url":"git://github.com/City-of-Helsinki/omahelsinki.git","ssh_url":"git@github.com:City-of-Helsinki/omahelsinki.git","clone_url":"https://github.com/City-of-Helsinki/omahelsinki.git","svn_url":"https://github.com/City-of-Helsinki/omahelsinki","homepage":null,"size":494,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":3,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"City-of-Helsinki:master","ref":"master","sha":"acf1c44f6ea8b14526fb2e760d22e337c9620daa","user":{"login":"City-of-Helsinki","id":1875564,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzU1NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1875564?v=4","gravatar_id":"","url":"https://api.github.com/users/City-of-Helsinki","html_url":"https://github.com/City-of-Helsinki","followers_url":"https://api.github.com/users/City-of-Helsinki/followers","following_url":"https://api.github.com/users/City-of-Helsinki/following{/other_user}","gists_url":"https://api.github.com/users/City-of-Helsinki/gists{/gist_id}","starred_url":"https://api.github.com/users/City-of-Helsinki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/City-of-Helsinki/subscriptions","organizations_url":"https://api.github.com/users/City-of-Helsinki/orgs","repos_url":"https://api.github.com/users/City-of-Helsinki/repos","events_url":"https://api.github.com/users/City-of-Helsinki/events{/privacy}","received_events_url":"https://api.github.com/users/City-of-Helsinki/received_events","type":"Organization","site_admin":false},"repo":{"id":138710736,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg3MTA3MzY=","name":"omahelsinki","full_name":"City-of-Helsinki/omahelsinki","private":false,"owner":{"login":"City-of-Helsinki","id":1875564,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzU1NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1875564?v=4","gravatar_id":"","url":"https://api.github.com/users/City-of-Helsinki","html_url":"https://github.com/City-of-Helsinki","followers_url":"https://api.github.com/users/City-of-Helsinki/followers","following_url":"https://api.github.com/users/City-of-Helsinki/following{/other_user}","gists_url":"https://api.github.com/users/City-of-Helsinki/gists{/gist_id}","starred_url":"https://api.github.com/users/City-of-Helsinki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/City-of-Helsinki/subscriptions","organizations_url":"https://api.github.com/users/City-of-Helsinki/orgs","repos_url":"https://api.github.com/users/City-of-Helsinki/repos","events_url":"https://api.github.com/users/City-of-Helsinki/events{/privacy}","received_events_url":"https://api.github.com/users/City-of-Helsinki/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/City-of-Helsinki/omahelsinki","description":"Djagno Wagtail site for oma.helsinki","fork":false,"url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki","forks_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/forks","keys_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/teams","hooks_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/hooks","issue_events_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/events{/number}","events_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/events","assignees_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/assignees{/user}","branches_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/branches{/branch}","tags_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/tags","blobs_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/refs{/sha}","trees_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/statuses/{sha}","languages_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/languages","stargazers_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/stargazers","contributors_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/contributors","subscribers_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/subscribers","subscription_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/subscription","commits_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/commits{/sha}","git_commits_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/git/commits{/sha}","comments_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/comments{/number}","issue_comment_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/comments{/number}","contents_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/contents/{+path}","compare_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/merges","archive_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/downloads","issues_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues{/number}","pulls_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls{/number}","milestones_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/milestones{/number}","notifications_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/labels{/name}","releases_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/releases{/id}","deployments_url":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/deployments","created_at":"2018-06-26T08:49:25Z","updated_at":"2018-09-25T13:19:22Z","pushed_at":"2018-09-27T13:00:02Z","git_url":"git://github.com/City-of-Helsinki/omahelsinki.git","ssh_url":"git@github.com:City-of-Helsinki/omahelsinki.git","clone_url":"https://github.com/City-of-Helsinki/omahelsinki.git","svn_url":"https://github.com/City-of-Helsinki/omahelsinki","homepage":null,"size":494,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":3,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27"},"html":{"href":"https://github.com/City-of-Helsinki/omahelsinki/pull/27"},"issue":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/27"},"comments":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/City-of-Helsinki/omahelsinki/statuses/f6bb0e66bd25600aea1b3479af21c852229960de"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jimppa"}}