{"action":"created","comment":{"url":"https://api.github.com/repos/dataloom/gallery/pulls/comments/175611399","pull_request_review_id":105151696,"id":175611399,"diff_hunk":"@@ -0,0 +1,150 @@\n+import React from 'react';\n+import PropTypes from 'prop-types';\n+\n+import { FormControl, FormGroup, ControlLabel, Button, Alert } from 'react-bootstrap';\n+import { connect } from 'react-redux';\n+import { bindActionCreators } from 'redux';\n+\n+import AsyncContent, { AsyncStatePropType } from '../../components/asynccontent/AsyncContent';\n+import { editAppRequest } from './AppActionFactory';\n+\n+\n+class EditApp extends React.Component {\n+\n+  static propTypes = {\n+    actions: PropTypes.shape({\n+      onEditApp: PropTypes.func.isRequired\n+    }).isRequired,\n+    editAppAsyncState: AsyncStatePropType.isRequired,\n+    id: PropTypes.string.isRequired,\n+    name: PropTypes.string.isRequired,\n+    title: PropTypes.string.isRequired,\n+    description: PropTypes.string.isRequired,\n+    url: PropTypes.string.isRequired\n+  }\n+\n+  constructor(props) {\n+    super(props);\n+    this.state = {\n+      title: '',\n+      description: '',\n+      name: '',\n+      url: ''\n+    };\n+  }\n+\n+  componentDidMount() {\n+  }\n+\n+  onTitleChange = (event) => {\n+    this.setState({\n+      title: event.target.value\n+    });\n+  };\n+\n+  onNameChange = (event) => {\n+    this.setState({\n+      name: event.target.value\n+    });\n+  };\n+\n+  onDescriptionChange = (event) => {\n+    this.setState({\n+      description: event.target.value\n+    });\n+  };\n+\n+  onUrlChange = (event) => {\n+    this.setState({\n+      url: event.target.value\n+    });\n+  };\n+\n+  onSubmit = () => {\n+    const { title, description, name, url } = this.state;\n+\n+    // We need to collect only items that have been changed. AKA NOT an empty string.\n+    // Having issues with this because of js and iterables.\n+    // Collect the items, check each for change, add changed to appData object.\n+    const tempMap = new Map([['title', title], ['description', description], ['name', name], ['url', url]]);\n+    const keys = tempMap.keys();\n+    const appData = {};\n+\n+    for (const item of keys) {\n+      if (tempMap.get(item) !== '') {\n+        appData[item] = tempMap.get(item);\n+      }\n+    }\n+\n+    const appId = this.props.id;\n+    this.props.actions.onEditApp(appId, appData);\n+  }\n+\n+  renderPending = () => {\n+    return (\n+      <form onSubmit={this.onSubmit}>\n+        <FormGroup>\n+          <ControlLabel>Name</ControlLabel>\n+          <FormControl type=\"text\" onChange={this.onNameChange} placeholder={this.props.name} />\n+        </FormGroup>\n+\n+        <FormGroup>\n+          <ControlLabel>Title</ControlLabel>\n+          <FormControl type=\"text\" onChange={this.onTitleChange} placeholder={this.props.title} />\n+        </FormGroup>\n+\n+        <FormGroup>\n+          <ControlLabel>Description</ControlLabel>\n+          <FormControl componentClass=\"textarea\" onChange={this.onDescriptionChange} placeholder={this.props.description} />\n+        </FormGroup>\n+\n+        <FormGroup>\n+          <ControlLabel>Url</ControlLabel>\n+          <FormControl type=\"text\" onChange={this.onUrlChange} placeholder={this.props.url} />\n+        </FormGroup>\n+\n+        <br />\n+        <Button type=\"submit\" bsStyle=\"primary\">Update App</Button>\n+      </form>\n+    );\n+  };\n+\n+  renderSuccess = () => {\n+    return (\n+      <Alert bsStyle=\"success\">\n+        Successfully saved changes\n+      </Alert>\n+    );\n+  };\n+\n+  render() {\n+    return (\n+      <AsyncContent\n+          {...this.props.editAppAsyncState}\n+          pendingContent={this.renderPending()}\n+          content={this.renderSuccess} />\n+    );\n+  }\n+\n+}\n+\n+function mapStateToProps(state) {\n+  const editAppState = state.get('editApp').toJS();\n+\n+  return {\n+    editAppAsyncState: editAppState.editAppAsyncState\n+  };\n+}\n+\n+function mapDispatchToProps(dispatch) {\n+\n+  const actions = {\n+    onEditApp: editAppRequest","path":"src/containers/app/EditApp.js","position":142,"original_position":142,"commit_id":"f56d7dbf05d8d735b7a3ced90832778abb65ae6b","original_commit_id":"f56d7dbf05d8d735b7a3ced90832778abb65ae6b","user":{"login":"UnsungHero97","id":440299,"avatar_url":"https://avatars1.githubusercontent.com/u/440299?v=4","gravatar_id":"","url":"https://api.github.com/users/UnsungHero97","html_url":"https://github.com/UnsungHero97","followers_url":"https://api.github.com/users/UnsungHero97/followers","following_url":"https://api.github.com/users/UnsungHero97/following{/other_user}","gists_url":"https://api.github.com/users/UnsungHero97/gists{/gist_id}","starred_url":"https://api.github.com/users/UnsungHero97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnsungHero97/subscriptions","organizations_url":"https://api.github.com/users/UnsungHero97/orgs","repos_url":"https://api.github.com/users/UnsungHero97/repos","events_url":"https://api.github.com/users/UnsungHero97/events{/privacy}","received_events_url":"https://api.github.com/users/UnsungHero97/received_events","type":"User","site_admin":false},"body":"I don't recommend renaming the action.","created_at":"2018-03-19T22:56:15Z","updated_at":"2018-03-19T22:56:24Z","html_url":"https://github.com/dataloom/gallery/pull/522#discussion_r175611399","pull_request_url":"https://api.github.com/repos/dataloom/gallery/pulls/522","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dataloom/gallery/pulls/comments/175611399"},"html":{"href":"https://github.com/dataloom/gallery/pull/522#discussion_r175611399"},"pull_request":{"href":"https://api.github.com/repos/dataloom/gallery/pulls/522"}}},"pull_request":{"url":"https://api.github.com/repos/dataloom/gallery/pulls/522","id":176023027,"html_url":"https://github.com/dataloom/gallery/pull/522","diff_url":"https://github.com/dataloom/gallery/pull/522.diff","patch_url":"https://github.com/dataloom/gallery/pull/522.patch","issue_url":"https://api.github.com/repos/dataloom/gallery/issues/522","number":522,"state":"open","locked":false,"title":"Feature/gallery apps","user":{"login":"mariereed","id":32525631,"avatar_url":"https://avatars3.githubusercontent.com/u/32525631?v=4","gravatar_id":"","url":"https://api.github.com/users/mariereed","html_url":"https://github.com/mariereed","followers_url":"https://api.github.com/users/mariereed/followers","following_url":"https://api.github.com/users/mariereed/following{/other_user}","gists_url":"https://api.github.com/users/mariereed/gists{/gist_id}","starred_url":"https://api.github.com/users/mariereed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariereed/subscriptions","organizations_url":"https://api.github.com/users/mariereed/orgs","repos_url":"https://api.github.com/users/mariereed/repos","events_url":"https://api.github.com/users/mariereed/events{/privacy}","received_events_url":"https://api.github.com/users/mariereed/received_events","type":"User","site_admin":false},"body":"Built up the app page in gallery. Also added apps to the side nav bar (no picture yet).\r\n\r\nFunctionality includes:\r\n\r\nCreate an App\r\nCreate an App Type\r\nEdit metadata for an App\r\nEdit metadata for an App Type\r\nInstall an App\r\nDelete an App\r\nAdd App Type to an App\r\nDelete App Type from an App","created_at":"2018-03-19T20:55:47Z","updated_at":"2018-03-19T22:56:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"033d8585311188c77bfd1ba2ce982a5cf0a370ca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dataloom/gallery/pulls/522/commits","review_comments_url":"https://api.github.com/repos/dataloom/gallery/pulls/522/comments","review_comment_url":"https://api.github.com/repos/dataloom/gallery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dataloom/gallery/issues/522/comments","statuses_url":"https://api.github.com/repos/dataloom/gallery/statuses/f56d7dbf05d8d735b7a3ced90832778abb65ae6b","head":{"label":"dataloom:feature/gallery-apps","ref":"feature/gallery-apps","sha":"f56d7dbf05d8d735b7a3ced90832778abb65ae6b","user":{"login":"dataloom","id":23568223,"avatar_url":"https://avatars3.githubusercontent.com/u/23568223?v=4","gravatar_id":"","url":"https://api.github.com/users/dataloom","html_url":"https://github.com/dataloom","followers_url":"https://api.github.com/users/dataloom/followers","following_url":"https://api.github.com/users/dataloom/following{/other_user}","gists_url":"https://api.github.com/users/dataloom/gists{/gist_id}","starred_url":"https://api.github.com/users/dataloom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataloom/subscriptions","organizations_url":"https://api.github.com/users/dataloom/orgs","repos_url":"https://api.github.com/users/dataloom/repos","events_url":"https://api.github.com/users/dataloom/events{/privacy}","received_events_url":"https://api.github.com/users/dataloom/received_events","type":"Organization","site_admin":false},"repo":{"id":68751663,"name":"gallery","full_name":"dataloom/gallery","owner":{"login":"dataloom","id":23568223,"avatar_url":"https://avatars3.githubusercontent.com/u/23568223?v=4","gravatar_id":"","url":"https://api.github.com/users/dataloom","html_url":"https://github.com/dataloom","followers_url":"https://api.github.com/users/dataloom/followers","following_url":"https://api.github.com/users/dataloom/following{/other_user}","gists_url":"https://api.github.com/users/dataloom/gists{/gist_id}","starred_url":"https://api.github.com/users/dataloom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataloom/subscriptions","organizations_url":"https://api.github.com/users/dataloom/orgs","repos_url":"https://api.github.com/users/dataloom/repos","events_url":"https://api.github.com/users/dataloom/events{/privacy}","received_events_url":"https://api.github.com/users/dataloom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dataloom/gallery","description":null,"fork":false,"url":"https://api.github.com/repos/dataloom/gallery","forks_url":"https://api.github.com/repos/dataloom/gallery/forks","keys_url":"https://api.github.com/repos/dataloom/gallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dataloom/gallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dataloom/gallery/teams","hooks_url":"https://api.github.com/repos/dataloom/gallery/hooks","issue_events_url":"https://api.github.com/repos/dataloom/gallery/issues/events{/number}","events_url":"https://api.github.com/repos/dataloom/gallery/events","assignees_url":"https://api.github.com/repos/dataloom/gallery/assignees{/user}","branches_url":"https://api.github.com/repos/dataloom/gallery/branches{/branch}","tags_url":"https://api.github.com/repos/dataloom/gallery/tags","blobs_url":"https://api.github.com/repos/dataloom/gallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dataloom/gallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dataloom/gallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/dataloom/gallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dataloom/gallery/statuses/{sha}","languages_url":"https://api.github.com/repos/dataloom/gallery/languages","stargazers_url":"https://api.github.com/repos/dataloom/gallery/stargazers","contributors_url":"https://api.github.com/repos/dataloom/gallery/contributors","subscribers_url":"https://api.github.com/repos/dataloom/gallery/subscribers","subscription_url":"https://api.github.com/repos/dataloom/gallery/subscription","commits_url":"https://api.github.com/repos/dataloom/gallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/dataloom/gallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/dataloom/gallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/dataloom/gallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/dataloom/gallery/contents/{+path}","compare_url":"https://api.github.com/repos/dataloom/gallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dataloom/gallery/merges","archive_url":"https://api.github.com/repos/dataloom/gallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dataloom/gallery/downloads","issues_url":"https://api.github.com/repos/dataloom/gallery/issues{/number}","pulls_url":"https://api.github.com/repos/dataloom/gallery/pulls{/number}","milestones_url":"https://api.github.com/repos/dataloom/gallery/milestones{/number}","notifications_url":"https://api.github.com/repos/dataloom/gallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dataloom/gallery/labels{/name}","releases_url":"https://api.github.com/repos/dataloom/gallery/releases{/id}","deployments_url":"https://api.github.com/repos/dataloom/gallery/deployments","created_at":"2016-09-20T20:42:10Z","updated_at":"2017-05-11T00:07:50Z","pushed_at":"2018-03-19T22:31:12Z","git_url":"git://github.com/dataloom/gallery.git","ssh_url":"git@github.com:dataloom/gallery.git","clone_url":"https://github.com/dataloom/gallery.git","svn_url":"https://github.com/dataloom/gallery","homepage":null,"size":2952,"stargazers_count":1,"watchers_count":1,"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":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"dataloom:develop","ref":"develop","sha":"fd06fb21ae495111cf2ff2d7347590f53ddfa4ee","user":{"login":"dataloom","id":23568223,"avatar_url":"https://avatars3.githubusercontent.com/u/23568223?v=4","gravatar_id":"","url":"https://api.github.com/users/dataloom","html_url":"https://github.com/dataloom","followers_url":"https://api.github.com/users/dataloom/followers","following_url":"https://api.github.com/users/dataloom/following{/other_user}","gists_url":"https://api.github.com/users/dataloom/gists{/gist_id}","starred_url":"https://api.github.com/users/dataloom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataloom/subscriptions","organizations_url":"https://api.github.com/users/dataloom/orgs","repos_url":"https://api.github.com/users/dataloom/repos","events_url":"https://api.github.com/users/dataloom/events{/privacy}","received_events_url":"https://api.github.com/users/dataloom/received_events","type":"Organization","site_admin":false},"repo":{"id":68751663,"name":"gallery","full_name":"dataloom/gallery","owner":{"login":"dataloom","id":23568223,"avatar_url":"https://avatars3.githubusercontent.com/u/23568223?v=4","gravatar_id":"","url":"https://api.github.com/users/dataloom","html_url":"https://github.com/dataloom","followers_url":"https://api.github.com/users/dataloom/followers","following_url":"https://api.github.com/users/dataloom/following{/other_user}","gists_url":"https://api.github.com/users/dataloom/gists{/gist_id}","starred_url":"https://api.github.com/users/dataloom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataloom/subscriptions","organizations_url":"https://api.github.com/users/dataloom/orgs","repos_url":"https://api.github.com/users/dataloom/repos","events_url":"https://api.github.com/users/dataloom/events{/privacy}","received_events_url":"https://api.github.com/users/dataloom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dataloom/gallery","description":null,"fork":false,"url":"https://api.github.com/repos/dataloom/gallery","forks_url":"https://api.github.com/repos/dataloom/gallery/forks","keys_url":"https://api.github.com/repos/dataloom/gallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dataloom/gallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dataloom/gallery/teams","hooks_url":"https://api.github.com/repos/dataloom/gallery/hooks","issue_events_url":"https://api.github.com/repos/dataloom/gallery/issues/events{/number}","events_url":"https://api.github.com/repos/dataloom/gallery/events","assignees_url":"https://api.github.com/repos/dataloom/gallery/assignees{/user}","branches_url":"https://api.github.com/repos/dataloom/gallery/branches{/branch}","tags_url":"https://api.github.com/repos/dataloom/gallery/tags","blobs_url":"https://api.github.com/repos/dataloom/gallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dataloom/gallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dataloom/gallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/dataloom/gallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dataloom/gallery/statuses/{sha}","languages_url":"https://api.github.com/repos/dataloom/gallery/languages","stargazers_url":"https://api.github.com/repos/dataloom/gallery/stargazers","contributors_url":"https://api.github.com/repos/dataloom/gallery/contributors","subscribers_url":"https://api.github.com/repos/dataloom/gallery/subscribers","subscription_url":"https://api.github.com/repos/dataloom/gallery/subscription","commits_url":"https://api.github.com/repos/dataloom/gallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/dataloom/gallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/dataloom/gallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/dataloom/gallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/dataloom/gallery/contents/{+path}","compare_url":"https://api.github.com/repos/dataloom/gallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dataloom/gallery/merges","archive_url":"https://api.github.com/repos/dataloom/gallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dataloom/gallery/downloads","issues_url":"https://api.github.com/repos/dataloom/gallery/issues{/number}","pulls_url":"https://api.github.com/repos/dataloom/gallery/pulls{/number}","milestones_url":"https://api.github.com/repos/dataloom/gallery/milestones{/number}","notifications_url":"https://api.github.com/repos/dataloom/gallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dataloom/gallery/labels{/name}","releases_url":"https://api.github.com/repos/dataloom/gallery/releases{/id}","deployments_url":"https://api.github.com/repos/dataloom/gallery/deployments","created_at":"2016-09-20T20:42:10Z","updated_at":"2017-05-11T00:07:50Z","pushed_at":"2018-03-19T22:31:12Z","git_url":"git://github.com/dataloom/gallery.git","ssh_url":"git@github.com:dataloom/gallery.git","clone_url":"https://github.com/dataloom/gallery.git","svn_url":"https://github.com/dataloom/gallery","homepage":null,"size":2952,"stargazers_count":1,"watchers_count":1,"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":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dataloom/gallery/pulls/522"},"html":{"href":"https://github.com/dataloom/gallery/pull/522"},"issue":{"href":"https://api.github.com/repos/dataloom/gallery/issues/522"},"comments":{"href":"https://api.github.com/repos/dataloom/gallery/issues/522/comments"},"review_comments":{"href":"https://api.github.com/repos/dataloom/gallery/pulls/522/comments"},"review_comment":{"href":"https://api.github.com/repos/dataloom/gallery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dataloom/gallery/pulls/522/commits"},"statuses":{"href":"https://api.github.com/repos/dataloom/gallery/statuses/f56d7dbf05d8d735b7a3ced90832778abb65ae6b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"UnsungHero97"}}