{"action":"created","comment":{"url":"https://api.github.com/repos/haiwen/seahub/pulls/comments/228399027","pull_request_review_id":168663801,"id":228399027,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODM5OTAyNw==","diff_hunk":"@@ -0,0 +1,146 @@\n+import React, { Fragment } from 'react';\n+import PropTypes from 'prop-types';\n+import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Input } from 'reactstrap';\n+import { gettext, repoID } from '../../utils/constants';\n+import { seafileAPI } from '../../utils/seafile-api';\n+import Repotag from '../../models/repotag';\n+import DeleteTag from '../dialog/delete-repotag-dialog';\n+\n+const propTypes = {\n+  currentTag: PropTypes.object,\n+  toggleCancel: PropTypes.func.isRequired,\n+};\n+\n+class UpdateTag extends React.Component {\n+  constructor(props) {\n+    super(props);\n+    this.state = {\n+      deleteRepoTag: false,\n+      newName: '',\n+      newColor: '',\n+      newTag: {},\n+      colorList: ['lime', 'teal', 'azure', 'green', 'blue', 'purple', 'pink', 'indigo'],\n+    };\n+    this.newInput = React.createRef();\n+  }\n+\n+  inputNewname = (e) => {\n+    this.setState({\n+      newName: e.target.value,\n+    });\n+  }\n+\n+  selectNewcolor = (e) => {\n+    this.setState({\n+      newColor: e.target.value,\n+    });\n+  }\n+\n+  updateTag = () => {  \n+    let tag_id = this.props.currentTag.id;\n+    let name = this.state.newName;\n+    let color = this.state.newColor;\n+    seafileAPI.updateRepotag(repoID, tag_id, name, color).then(res => {\n+      let newTag = new Repotag(res.data.tag);\n+      this.setState({\n+        newTag: newTag,\n+      });\n+    });\n+    this.props.toggleCancel();\n+  }\n+\n+  handleKeyPress = (e) => {\n+    if (e.key === 'Enter') {\n+      this.updateTag();\n+    } \n+  }\n+\n+  toggle = () => {\n+    this.props.toggleCancel();\n+  }\n+\n+  componentWillMount() {\n+    this.setState({\n+      newName: this.props.currentTag.name,\n+      newColor: this.props.currentTag.color,\n+    });\n+  }\n+\n+  componentDidMount() {\n+    this.changeState();\n+    this.newInput.focus();\n+    this.newInput.setSelectionRange(0, -1);\n+  }\n+\n+  componentWillReceiveProps(nextProps) {\n+    this.changeState(nextProps.currentTag);\n+  }\n+\n+  changeState() {\n+    this.setState({\n+      newName: this.state.newName,\n+      newColor: this.state.newColor,\n+    });\n+  }\n+\n+  deleteTagClick = (item) => {\n+    this.setState({\n+      deleteRepoTag: !this.state.deleteRepoTag,\n+      currentTag: item,\n+    });\n+    this.props.toggleCancel();\n+  }\n+\n+  deleteTagCancel = () => {\n+    this.setState({\n+      deleteRepoTag: !this.state.deleteRepoTag,\n+    });\n+  }\n+\n+  render() {\n+    let colorList = this.state.colorList;\n+    let tag = this.props.currentTag;\n+    return (\n+      <Fragment>\n+      <Modal isOpen={true} toggle={this.toggle}>\n+        <ModalHeader toggle={this.toggle}>{gettext('编辑标签:')}</ModalHeader>","path":"frontend/src/components/dialog/update-repotag-dialog.js","position":106,"original_position":106,"commit_id":"ed86f3ef977e1c3b553811a87340f87cb8e6f35c","original_commit_id":"ed86f3ef977e1c3b553811a87340f87cb8e6f35c","user":{"login":"shuntian","id":18205690,"node_id":"MDQ6VXNlcjE4MjA1Njkw","avatar_url":"https://avatars1.githubusercontent.com/u/18205690?v=4","gravatar_id":"","url":"https://api.github.com/users/shuntian","html_url":"https://github.com/shuntian","followers_url":"https://api.github.com/users/shuntian/followers","following_url":"https://api.github.com/users/shuntian/following{/other_user}","gists_url":"https://api.github.com/users/shuntian/gists{/gist_id}","starred_url":"https://api.github.com/users/shuntian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuntian/subscriptions","organizations_url":"https://api.github.com/users/shuntian/orgs","repos_url":"https://api.github.com/users/shuntian/repos","events_url":"https://api.github.com/users/shuntian/events{/privacy}","received_events_url":"https://api.github.com/users/shuntian/received_events","type":"User","site_admin":false},"body":"中文修改文英文","created_at":"2018-10-26T03:53:15Z","updated_at":"2018-10-26T03:53:15Z","html_url":"https://github.com/haiwen/seahub/pull/2476#discussion_r228399027","pull_request_url":"https://api.github.com/repos/haiwen/seahub/pulls/2476","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/haiwen/seahub/pulls/comments/228399027"},"html":{"href":"https://github.com/haiwen/seahub/pull/2476#discussion_r228399027"},"pull_request":{"href":"https://api.github.com/repos/haiwen/seahub/pulls/2476"}}},"pull_request":{"url":"https://api.github.com/repos/haiwen/seahub/pulls/2476","id":225963975,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1OTYzOTc1","html_url":"https://github.com/haiwen/seahub/pull/2476","diff_url":"https://github.com/haiwen/seahub/pull/2476.diff","patch_url":"https://github.com/haiwen/seahub/pull/2476.patch","issue_url":"https://api.github.com/repos/haiwen/seahub/issues/2476","number":2476,"state":"open","locked":false,"title":"repo-tag-show","user":{"login":"WangJianhui666","id":40563566,"node_id":"MDQ6VXNlcjQwNTYzNTY2","avatar_url":"https://avatars0.githubusercontent.com/u/40563566?v=4","gravatar_id":"","url":"https://api.github.com/users/WangJianhui666","html_url":"https://github.com/WangJianhui666","followers_url":"https://api.github.com/users/WangJianhui666/followers","following_url":"https://api.github.com/users/WangJianhui666/following{/other_user}","gists_url":"https://api.github.com/users/WangJianhui666/gists{/gist_id}","starred_url":"https://api.github.com/users/WangJianhui666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WangJianhui666/subscriptions","organizations_url":"https://api.github.com/users/WangJianhui666/orgs","repos_url":"https://api.github.com/users/WangJianhui666/repos","events_url":"https://api.github.com/users/WangJianhui666/events{/privacy}","received_events_url":"https://api.github.com/users/WangJianhui666/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-26T03:14:37Z","updated_at":"2018-10-26T03:53:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33ebe5eff7513f82f2266c3bdecd299f582f3aae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/haiwen/seahub/pulls/2476/commits","review_comments_url":"https://api.github.com/repos/haiwen/seahub/pulls/2476/comments","review_comment_url":"https://api.github.com/repos/haiwen/seahub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/haiwen/seahub/issues/2476/comments","statuses_url":"https://api.github.com/repos/haiwen/seahub/statuses/ed86f3ef977e1c3b553811a87340f87cb8e6f35c","head":{"label":"haiwen:repo-tag-show","ref":"repo-tag-show","sha":"ed86f3ef977e1c3b553811a87340f87cb8e6f35c","user":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"repo":{"id":6556815,"node_id":"MDEwOlJlcG9zaXRvcnk2NTU2ODE1","name":"seahub","full_name":"haiwen/seahub","private":false,"owner":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/haiwen/seahub","description":"The web end of seafile server.","fork":false,"url":"https://api.github.com/repos/haiwen/seahub","forks_url":"https://api.github.com/repos/haiwen/seahub/forks","keys_url":"https://api.github.com/repos/haiwen/seahub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haiwen/seahub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haiwen/seahub/teams","hooks_url":"https://api.github.com/repos/haiwen/seahub/hooks","issue_events_url":"https://api.github.com/repos/haiwen/seahub/issues/events{/number}","events_url":"https://api.github.com/repos/haiwen/seahub/events","assignees_url":"https://api.github.com/repos/haiwen/seahub/assignees{/user}","branches_url":"https://api.github.com/repos/haiwen/seahub/branches{/branch}","tags_url":"https://api.github.com/repos/haiwen/seahub/tags","blobs_url":"https://api.github.com/repos/haiwen/seahub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haiwen/seahub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haiwen/seahub/git/refs{/sha}","trees_url":"https://api.github.com/repos/haiwen/seahub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haiwen/seahub/statuses/{sha}","languages_url":"https://api.github.com/repos/haiwen/seahub/languages","stargazers_url":"https://api.github.com/repos/haiwen/seahub/stargazers","contributors_url":"https://api.github.com/repos/haiwen/seahub/contributors","subscribers_url":"https://api.github.com/repos/haiwen/seahub/subscribers","subscription_url":"https://api.github.com/repos/haiwen/seahub/subscription","commits_url":"https://api.github.com/repos/haiwen/seahub/commits{/sha}","git_commits_url":"https://api.github.com/repos/haiwen/seahub/git/commits{/sha}","comments_url":"https://api.github.com/repos/haiwen/seahub/comments{/number}","issue_comment_url":"https://api.github.com/repos/haiwen/seahub/issues/comments{/number}","contents_url":"https://api.github.com/repos/haiwen/seahub/contents/{+path}","compare_url":"https://api.github.com/repos/haiwen/seahub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haiwen/seahub/merges","archive_url":"https://api.github.com/repos/haiwen/seahub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haiwen/seahub/downloads","issues_url":"https://api.github.com/repos/haiwen/seahub/issues{/number}","pulls_url":"https://api.github.com/repos/haiwen/seahub/pulls{/number}","milestones_url":"https://api.github.com/repos/haiwen/seahub/milestones{/number}","notifications_url":"https://api.github.com/repos/haiwen/seahub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haiwen/seahub/labels{/name}","releases_url":"https://api.github.com/repos/haiwen/seahub/releases{/id}","deployments_url":"https://api.github.com/repos/haiwen/seahub/deployments","created_at":"2012-11-06T05:07:24Z","updated_at":"2018-10-25T09:50:51Z","pushed_at":"2018-10-26T03:14:37Z","git_url":"git://github.com/haiwen/seahub.git","ssh_url":"git@github.com:haiwen/seahub.git","clone_url":"https://github.com/haiwen/seahub.git","svn_url":"https://github.com/haiwen/seahub","homepage":"seafile.com","size":115323,"stargazers_count":329,"watchers_count":329,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":261,"mirror_url":null,"archived":false,"open_issues_count":122,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":261,"open_issues":122,"watchers":329,"default_branch":"master"}},"base":{"label":"haiwen:master","ref":"master","sha":"d65c775e559ab42cc410a8b758bef786cd9105e8","user":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"repo":{"id":6556815,"node_id":"MDEwOlJlcG9zaXRvcnk2NTU2ODE1","name":"seahub","full_name":"haiwen/seahub","private":false,"owner":{"login":"haiwen","id":1948782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDg3ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/1948782?v=4","gravatar_id":"","url":"https://api.github.com/users/haiwen","html_url":"https://github.com/haiwen","followers_url":"https://api.github.com/users/haiwen/followers","following_url":"https://api.github.com/users/haiwen/following{/other_user}","gists_url":"https://api.github.com/users/haiwen/gists{/gist_id}","starred_url":"https://api.github.com/users/haiwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haiwen/subscriptions","organizations_url":"https://api.github.com/users/haiwen/orgs","repos_url":"https://api.github.com/users/haiwen/repos","events_url":"https://api.github.com/users/haiwen/events{/privacy}","received_events_url":"https://api.github.com/users/haiwen/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/haiwen/seahub","description":"The web end of seafile server.","fork":false,"url":"https://api.github.com/repos/haiwen/seahub","forks_url":"https://api.github.com/repos/haiwen/seahub/forks","keys_url":"https://api.github.com/repos/haiwen/seahub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haiwen/seahub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haiwen/seahub/teams","hooks_url":"https://api.github.com/repos/haiwen/seahub/hooks","issue_events_url":"https://api.github.com/repos/haiwen/seahub/issues/events{/number}","events_url":"https://api.github.com/repos/haiwen/seahub/events","assignees_url":"https://api.github.com/repos/haiwen/seahub/assignees{/user}","branches_url":"https://api.github.com/repos/haiwen/seahub/branches{/branch}","tags_url":"https://api.github.com/repos/haiwen/seahub/tags","blobs_url":"https://api.github.com/repos/haiwen/seahub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haiwen/seahub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haiwen/seahub/git/refs{/sha}","trees_url":"https://api.github.com/repos/haiwen/seahub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haiwen/seahub/statuses/{sha}","languages_url":"https://api.github.com/repos/haiwen/seahub/languages","stargazers_url":"https://api.github.com/repos/haiwen/seahub/stargazers","contributors_url":"https://api.github.com/repos/haiwen/seahub/contributors","subscribers_url":"https://api.github.com/repos/haiwen/seahub/subscribers","subscription_url":"https://api.github.com/repos/haiwen/seahub/subscription","commits_url":"https://api.github.com/repos/haiwen/seahub/commits{/sha}","git_commits_url":"https://api.github.com/repos/haiwen/seahub/git/commits{/sha}","comments_url":"https://api.github.com/repos/haiwen/seahub/comments{/number}","issue_comment_url":"https://api.github.com/repos/haiwen/seahub/issues/comments{/number}","contents_url":"https://api.github.com/repos/haiwen/seahub/contents/{+path}","compare_url":"https://api.github.com/repos/haiwen/seahub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haiwen/seahub/merges","archive_url":"https://api.github.com/repos/haiwen/seahub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haiwen/seahub/downloads","issues_url":"https://api.github.com/repos/haiwen/seahub/issues{/number}","pulls_url":"https://api.github.com/repos/haiwen/seahub/pulls{/number}","milestones_url":"https://api.github.com/repos/haiwen/seahub/milestones{/number}","notifications_url":"https://api.github.com/repos/haiwen/seahub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haiwen/seahub/labels{/name}","releases_url":"https://api.github.com/repos/haiwen/seahub/releases{/id}","deployments_url":"https://api.github.com/repos/haiwen/seahub/deployments","created_at":"2012-11-06T05:07:24Z","updated_at":"2018-10-25T09:50:51Z","pushed_at":"2018-10-26T03:14:37Z","git_url":"git://github.com/haiwen/seahub.git","ssh_url":"git@github.com:haiwen/seahub.git","clone_url":"https://github.com/haiwen/seahub.git","svn_url":"https://github.com/haiwen/seahub","homepage":"seafile.com","size":115323,"stargazers_count":329,"watchers_count":329,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":261,"mirror_url":null,"archived":false,"open_issues_count":122,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":261,"open_issues":122,"watchers":329,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/haiwen/seahub/pulls/2476"},"html":{"href":"https://github.com/haiwen/seahub/pull/2476"},"issue":{"href":"https://api.github.com/repos/haiwen/seahub/issues/2476"},"comments":{"href":"https://api.github.com/repos/haiwen/seahub/issues/2476/comments"},"review_comments":{"href":"https://api.github.com/repos/haiwen/seahub/pulls/2476/comments"},"review_comment":{"href":"https://api.github.com/repos/haiwen/seahub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/haiwen/seahub/pulls/2476/commits"},"statuses":{"href":"https://api.github.com/repos/haiwen/seahub/statuses/ed86f3ef977e1c3b553811a87340f87cb8e6f35c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shuntian"}}