{"action":"created","comment":{"url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/comments/106698717","pull_request_review_id":27637682,"id":106698717,"diff_hunk":"@@ -0,0 +1,227 @@\n+'use strict';\n+var React = require('react');\n+var globals = require('./globals');\n+var _ = require('underscore');\n+var { ajax, console, object, isServerSide } = require('./util');\n+var ProgressBar = require('rc-progress').Line;\n+\n+/*\n+Uploads component holds the s3 file upload managers generated in action.js.\n+State works where key is object ID of file, values are important object context and\n+upload info.\n+*/\n+var Uploads = module.exports = React.createClass({\n+\n+    contextTypes: {\n+        fetch: React.PropTypes.func\n+    },\n+\n+    getInitialState: function(){\n+        var initial_uploads = {};\n+        var upload_keys = Object.keys(this.props.uploads);\n+        for(var i=0; i<upload_keys.length; i++){\n+            var this_upload = this.props.uploads[upload_keys[i]];\n+            var context_key = this_upload.context['@id'];\n+            var upload_info = this.buildUploadInfo(this_upload.context, this_upload.original_filename);\n+            initial_uploads[context_key] = upload_info;\n+            this.handleAsyncUpload(context_key, this_upload.manager);\n+        }\n+        return {'uploads': initial_uploads};\n+    },\n+\n+    componentDidMount: function(){\n+        this._isMounted = true;\n+    },\n+\n+    componentWillUnmount: function(){\n+        this._isMounted = false;\n+    },\n+\n+    /*\n+    Run async upload and update state to reflect percentage uploaded\n+    */\n+    handleAsyncUpload: function(upload_key, upload_manager){\n+        upload_manager.on('httpUploadProgress',\n+            function(evt) {\n+                var percentage = Math.round((evt.loaded * 100) / evt.total);\n+                if(this._isMounted){\n+                    this.modifyRunningUploads(upload_key, percentage, evt.total);\n+                }\n+            }.bind(this))\n+            .send(function(err, data) {\n+                if(err){\n+                    // PATCH original filename back to metadata\n+                    var orig_filename = this.state.uploads[upload_key]['original_filename'];\n+                    var props_uuid = this.props.uploads[upload_key]['context']['uuid'];","path":"src/encoded/static/components/uploads.js","position":55,"original_position":55,"commit_id":"bce7be9cfeeef9d2389b45c77bc3b1dd2dacb4b4","original_commit_id":"bce7be9cfeeef9d2389b45c77bc3b1dd2dacb4b4","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars2.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [['context'] is better written in dot notation.](https://www.codacy.com/app/4dn/fourfront/pullRequest?prid=565009)","created_at":"2017-03-17T17:05:08Z","updated_at":"2017-03-17T17:05:09Z","html_url":"https://github.com/4dn-dcic/fourfront/pull/397#discussion_r106698717","pull_request_url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397","_links":{"self":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/comments/106698717"},"html":{"href":"https://github.com/4dn-dcic/fourfront/pull/397#discussion_r106698717"},"pull_request":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397"}}},"pull_request":{"url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397","id":111292715,"html_url":"https://github.com/4dn-dcic/fourfront/pull/397","diff_url":"https://github.com/4dn-dcic/fourfront/pull/397.diff","patch_url":"https://github.com/4dn-dcic/fourfront/pull/397.patch","issue_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues/397","number":397,"state":"open","locked":false,"title":"FF-617","user":{"login":"carlvitzthum","id":19821645,"avatar_url":"https://avatars1.githubusercontent.com/u/19821645?v=3","gravatar_id":"","url":"https://api.github.com/users/carlvitzthum","html_url":"https://github.com/carlvitzthum","followers_url":"https://api.github.com/users/carlvitzthum/followers","following_url":"https://api.github.com/users/carlvitzthum/following{/other_user}","gists_url":"https://api.github.com/users/carlvitzthum/gists{/gist_id}","starred_url":"https://api.github.com/users/carlvitzthum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlvitzthum/subscriptions","organizations_url":"https://api.github.com/users/carlvitzthum/orgs","repos_url":"https://api.github.com/users/carlvitzthum/repos","events_url":"https://api.github.com/users/carlvitzthum/events{/privacy}","received_events_url":"https://api.github.com/users/carlvitzthum/received_events","type":"User","site_admin":false},"body":"Includes:\r\n* FF-625\r\n* s3 uploads for front-end edit and create\r\n* new /uploads endpoint, linked on user profile\r\n* validation changes\r\n* test and insert changes","created_at":"2017-03-17T14:30:41Z","updated_at":"2017-03-17T17:05:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d671903ca7c7376177e4808564100920d3fcf89a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397/commits","review_comments_url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397/comments","review_comment_url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues/397/comments","statuses_url":"https://api.github.com/repos/4dn-dcic/fourfront/statuses/bce7be9cfeeef9d2389b45c77bc3b1dd2dacb4b4","head":{"label":"4dn-dcic:FF-617","ref":"FF-617","sha":"bce7be9cfeeef9d2389b45c77bc3b1dd2dacb4b4","user":{"login":"4dn-dcic","id":23222469,"avatar_url":"https://avatars0.githubusercontent.com/u/23222469?v=3","gravatar_id":"","url":"https://api.github.com/users/4dn-dcic","html_url":"https://github.com/4dn-dcic","followers_url":"https://api.github.com/users/4dn-dcic/followers","following_url":"https://api.github.com/users/4dn-dcic/following{/other_user}","gists_url":"https://api.github.com/users/4dn-dcic/gists{/gist_id}","starred_url":"https://api.github.com/users/4dn-dcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4dn-dcic/subscriptions","organizations_url":"https://api.github.com/users/4dn-dcic/orgs","repos_url":"https://api.github.com/users/4dn-dcic/repos","events_url":"https://api.github.com/users/4dn-dcic/events{/privacy}","received_events_url":"https://api.github.com/users/4dn-dcic/received_events","type":"Organization","site_admin":false},"repo":{"id":58398322,"name":"fourfront","full_name":"4dn-dcic/fourfront","owner":{"login":"4dn-dcic","id":23222469,"avatar_url":"https://avatars0.githubusercontent.com/u/23222469?v=3","gravatar_id":"","url":"https://api.github.com/users/4dn-dcic","html_url":"https://github.com/4dn-dcic","followers_url":"https://api.github.com/users/4dn-dcic/followers","following_url":"https://api.github.com/users/4dn-dcic/following{/other_user}","gists_url":"https://api.github.com/users/4dn-dcic/gists{/gist_id}","starred_url":"https://api.github.com/users/4dn-dcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4dn-dcic/subscriptions","organizations_url":"https://api.github.com/users/4dn-dcic/orgs","repos_url":"https://api.github.com/users/4dn-dcic/repos","events_url":"https://api.github.com/users/4dn-dcic/events{/privacy}","received_events_url":"https://api.github.com/users/4dn-dcic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4dn-dcic/fourfront","description":"website for submitting and viewing genomic data","fork":false,"url":"https://api.github.com/repos/4dn-dcic/fourfront","forks_url":"https://api.github.com/repos/4dn-dcic/fourfront/forks","keys_url":"https://api.github.com/repos/4dn-dcic/fourfront/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4dn-dcic/fourfront/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4dn-dcic/fourfront/teams","hooks_url":"https://api.github.com/repos/4dn-dcic/fourfront/hooks","issue_events_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues/events{/number}","events_url":"https://api.github.com/repos/4dn-dcic/fourfront/events","assignees_url":"https://api.github.com/repos/4dn-dcic/fourfront/assignees{/user}","branches_url":"https://api.github.com/repos/4dn-dcic/fourfront/branches{/branch}","tags_url":"https://api.github.com/repos/4dn-dcic/fourfront/tags","blobs_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/refs{/sha}","trees_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4dn-dcic/fourfront/statuses/{sha}","languages_url":"https://api.github.com/repos/4dn-dcic/fourfront/languages","stargazers_url":"https://api.github.com/repos/4dn-dcic/fourfront/stargazers","contributors_url":"https://api.github.com/repos/4dn-dcic/fourfront/contributors","subscribers_url":"https://api.github.com/repos/4dn-dcic/fourfront/subscribers","subscription_url":"https://api.github.com/repos/4dn-dcic/fourfront/subscription","commits_url":"https://api.github.com/repos/4dn-dcic/fourfront/commits{/sha}","git_commits_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/commits{/sha}","comments_url":"https://api.github.com/repos/4dn-dcic/fourfront/comments{/number}","issue_comment_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues/comments{/number}","contents_url":"https://api.github.com/repos/4dn-dcic/fourfront/contents/{+path}","compare_url":"https://api.github.com/repos/4dn-dcic/fourfront/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4dn-dcic/fourfront/merges","archive_url":"https://api.github.com/repos/4dn-dcic/fourfront/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4dn-dcic/fourfront/downloads","issues_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues{/number}","pulls_url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls{/number}","milestones_url":"https://api.github.com/repos/4dn-dcic/fourfront/milestones{/number}","notifications_url":"https://api.github.com/repos/4dn-dcic/fourfront/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4dn-dcic/fourfront/labels{/name}","releases_url":"https://api.github.com/repos/4dn-dcic/fourfront/releases{/id}","deployments_url":"https://api.github.com/repos/4dn-dcic/fourfront/deployments","created_at":"2016-05-09T18:19:56Z","updated_at":"2017-02-18T19:41:43Z","pushed_at":"2017-03-17T17:04:15Z","git_url":"git://github.com/4dn-dcic/fourfront.git","ssh_url":"git@github.com:4dn-dcic/fourfront.git","clone_url":"https://github.com/4dn-dcic/fourfront.git","svn_url":"https://github.com/4dn-dcic/fourfront","homepage":null,"size":103329,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":5,"default_branch":"master"}},"base":{"label":"4dn-dcic:master","ref":"master","sha":"324283b30bfa1f637788095c791030745084e76a","user":{"login":"4dn-dcic","id":23222469,"avatar_url":"https://avatars0.githubusercontent.com/u/23222469?v=3","gravatar_id":"","url":"https://api.github.com/users/4dn-dcic","html_url":"https://github.com/4dn-dcic","followers_url":"https://api.github.com/users/4dn-dcic/followers","following_url":"https://api.github.com/users/4dn-dcic/following{/other_user}","gists_url":"https://api.github.com/users/4dn-dcic/gists{/gist_id}","starred_url":"https://api.github.com/users/4dn-dcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4dn-dcic/subscriptions","organizations_url":"https://api.github.com/users/4dn-dcic/orgs","repos_url":"https://api.github.com/users/4dn-dcic/repos","events_url":"https://api.github.com/users/4dn-dcic/events{/privacy}","received_events_url":"https://api.github.com/users/4dn-dcic/received_events","type":"Organization","site_admin":false},"repo":{"id":58398322,"name":"fourfront","full_name":"4dn-dcic/fourfront","owner":{"login":"4dn-dcic","id":23222469,"avatar_url":"https://avatars0.githubusercontent.com/u/23222469?v=3","gravatar_id":"","url":"https://api.github.com/users/4dn-dcic","html_url":"https://github.com/4dn-dcic","followers_url":"https://api.github.com/users/4dn-dcic/followers","following_url":"https://api.github.com/users/4dn-dcic/following{/other_user}","gists_url":"https://api.github.com/users/4dn-dcic/gists{/gist_id}","starred_url":"https://api.github.com/users/4dn-dcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4dn-dcic/subscriptions","organizations_url":"https://api.github.com/users/4dn-dcic/orgs","repos_url":"https://api.github.com/users/4dn-dcic/repos","events_url":"https://api.github.com/users/4dn-dcic/events{/privacy}","received_events_url":"https://api.github.com/users/4dn-dcic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4dn-dcic/fourfront","description":"website for submitting and viewing genomic data","fork":false,"url":"https://api.github.com/repos/4dn-dcic/fourfront","forks_url":"https://api.github.com/repos/4dn-dcic/fourfront/forks","keys_url":"https://api.github.com/repos/4dn-dcic/fourfront/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4dn-dcic/fourfront/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4dn-dcic/fourfront/teams","hooks_url":"https://api.github.com/repos/4dn-dcic/fourfront/hooks","issue_events_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues/events{/number}","events_url":"https://api.github.com/repos/4dn-dcic/fourfront/events","assignees_url":"https://api.github.com/repos/4dn-dcic/fourfront/assignees{/user}","branches_url":"https://api.github.com/repos/4dn-dcic/fourfront/branches{/branch}","tags_url":"https://api.github.com/repos/4dn-dcic/fourfront/tags","blobs_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/refs{/sha}","trees_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4dn-dcic/fourfront/statuses/{sha}","languages_url":"https://api.github.com/repos/4dn-dcic/fourfront/languages","stargazers_url":"https://api.github.com/repos/4dn-dcic/fourfront/stargazers","contributors_url":"https://api.github.com/repos/4dn-dcic/fourfront/contributors","subscribers_url":"https://api.github.com/repos/4dn-dcic/fourfront/subscribers","subscription_url":"https://api.github.com/repos/4dn-dcic/fourfront/subscription","commits_url":"https://api.github.com/repos/4dn-dcic/fourfront/commits{/sha}","git_commits_url":"https://api.github.com/repos/4dn-dcic/fourfront/git/commits{/sha}","comments_url":"https://api.github.com/repos/4dn-dcic/fourfront/comments{/number}","issue_comment_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues/comments{/number}","contents_url":"https://api.github.com/repos/4dn-dcic/fourfront/contents/{+path}","compare_url":"https://api.github.com/repos/4dn-dcic/fourfront/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4dn-dcic/fourfront/merges","archive_url":"https://api.github.com/repos/4dn-dcic/fourfront/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4dn-dcic/fourfront/downloads","issues_url":"https://api.github.com/repos/4dn-dcic/fourfront/issues{/number}","pulls_url":"https://api.github.com/repos/4dn-dcic/fourfront/pulls{/number}","milestones_url":"https://api.github.com/repos/4dn-dcic/fourfront/milestones{/number}","notifications_url":"https://api.github.com/repos/4dn-dcic/fourfront/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4dn-dcic/fourfront/labels{/name}","releases_url":"https://api.github.com/repos/4dn-dcic/fourfront/releases{/id}","deployments_url":"https://api.github.com/repos/4dn-dcic/fourfront/deployments","created_at":"2016-05-09T18:19:56Z","updated_at":"2017-02-18T19:41:43Z","pushed_at":"2017-03-17T17:04:15Z","git_url":"git://github.com/4dn-dcic/fourfront.git","ssh_url":"git@github.com:4dn-dcic/fourfront.git","clone_url":"https://github.com/4dn-dcic/fourfront.git","svn_url":"https://github.com/4dn-dcic/fourfront","homepage":null,"size":103329,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397"},"html":{"href":"https://github.com/4dn-dcic/fourfront/pull/397"},"issue":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/issues/397"},"comments":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/issues/397/comments"},"review_comments":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397/comments"},"review_comment":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/pulls/397/commits"},"statuses":{"href":"https://api.github.com/repos/4dn-dcic/fourfront/statuses/bce7be9cfeeef9d2389b45c77bc3b1dd2dacb4b4"}}}}
{"actor":{"display_login":"codacy-bot"}}