{"action":"created","comment":{"url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/comments/148202043","pull_request_review_id":73407277,"id":148202043,"diff_hunk":"@@ -0,0 +1,162 @@\n+import React from 'react'\n+import { Button } from 'semantic-ui-react';\n+import EditableTable from './common/EditableTable'\n+import Logger from '../js/Logger'\n+import Formatter from '../js/Formatter'\n+\n+import { bindActionCreators } from 'redux';\n+import { connect } from 'react-redux';\n+import * as Actions from '../actions/deviceWatering';\n+\n+class DeviceWateringsSchedule extends React.Component {\n+  constructor(props) {\n+    super(props);\n+    this.logger = new Logger({prefix: 'DeviceWateringsSchedule'});\n+    this.state = {\n+      saveButtonDisabled: true,\n+      loading: false,\n+    };\n+\n+    this.update = this.update.bind(this);\n+    this.debug = this.debug.bind(this);\n+    this.load = this.load.bind(this);\n+    this.save = this.save.bind(this);\n+    this.add = this.add.bind(this);\n+    this.remove = this.remove.bind(this);\n+  }\n+\n+  componentWillMount() {\n+    // マウント時にスケジュール情報をロードする\n+    // this.logger.log('componentWillMount', this.props, this.state);\n+    this.load();","path":"src/components/DeviceWateringsSchedule.js","position":31,"original_position":31,"commit_id":"ac4f772c9afac89aaa9dca8eaab390a6b328a410","original_commit_id":"ac4f772c9afac89aaa9dca8eaab390a6b328a410","user":{"login":"TakuroOnoda","id":1407926,"avatar_url":"https://avatars0.githubusercontent.com/u/1407926?v=4","gravatar_id":"","url":"https://api.github.com/users/TakuroOnoda","html_url":"https://github.com/TakuroOnoda","followers_url":"https://api.github.com/users/TakuroOnoda/followers","following_url":"https://api.github.com/users/TakuroOnoda/following{/other_user}","gists_url":"https://api.github.com/users/TakuroOnoda/gists{/gist_id}","starred_url":"https://api.github.com/users/TakuroOnoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakuroOnoda/subscriptions","organizations_url":"https://api.github.com/users/TakuroOnoda/orgs","repos_url":"https://api.github.com/users/TakuroOnoda/repos","events_url":"https://api.github.com/users/TakuroOnoda/events{/privacy}","received_events_url":"https://api.github.com/users/TakuroOnoda/received_events","type":"User","site_admin":false},"body":"ここでredux使ってデバイススケジュールリストデータを初期化する。","created_at":"2017-11-01T08:16:22Z","updated_at":"2017-11-01T08:16:22Z","html_url":"https://github.com/gitobi/karakuri-farm-web/pull/14#discussion_r148202043","pull_request_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/comments/148202043"},"html":{"href":"https://github.com/gitobi/karakuri-farm-web/pull/14#discussion_r148202043"},"pull_request":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14","id":148795170,"html_url":"https://github.com/gitobi/karakuri-farm-web/pull/14","diff_url":"https://github.com/gitobi/karakuri-farm-web/pull/14.diff","patch_url":"https://github.com/gitobi/karakuri-farm-web/pull/14.patch","issue_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/14","number":14,"state":"open","locked":false,"title":"Add device watering view skelton","user":{"login":"TakuroOnoda","id":1407926,"avatar_url":"https://avatars0.githubusercontent.com/u/1407926?v=4","gravatar_id":"","url":"https://api.github.com/users/TakuroOnoda","html_url":"https://github.com/TakuroOnoda","followers_url":"https://api.github.com/users/TakuroOnoda/followers","following_url":"https://api.github.com/users/TakuroOnoda/following{/other_user}","gists_url":"https://api.github.com/users/TakuroOnoda/gists{/gist_id}","starred_url":"https://api.github.com/users/TakuroOnoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakuroOnoda/subscriptions","organizations_url":"https://api.github.com/users/TakuroOnoda/orgs","repos_url":"https://api.github.com/users/TakuroOnoda/repos","events_url":"https://api.github.com/users/TakuroOnoda/events{/privacy}","received_events_url":"https://api.github.com/users/TakuroOnoda/received_events","type":"User","site_admin":false},"body":"### 追加したページ\r\n1. DeviceWaterings\r\n   1. device1 / device2 っていう、左側のリスト\r\n1. DeviceWateringsTab\r\n   1. 右側のタブ＋コンテンツの枠\r\n1. DeviceWateringsSchedule\r\n   1. 「スケジュール」ってタブの中身\r\n\r\nこれらは、上から順に入れ子状になってる。\r\n\r\n![2017-10-26 7 06 47](https://user-images.githubusercontent.com/1407926/32025783-67522340-ba1c-11e7-96e2-f5de2638df41.png)\r\n\r\n![2017-10-26 7 06 54](https://user-images.githubusercontent.com/1407926/32025784-692a2654-ba1c-11e7-9a4a-e02265d012dd.png)\r\n\r\n### 追加したRedux系\r\n1. src/actions/deviceWatering.js\r\n1. src/constants/deviceWatering.js\r\n1. src/reducers/deviceWatering.js\r\n\r\nbastetのDeviceWateringsとScheduleを保持したり云々したりする。今はbastetと通信しておらず、Loadのタイミングでダミーデータを作成する。\r\n画面からスケジュールの追加/削除/入力による変更をハンドリングするために、add/remove/updateのアクションを追加した。\r\n\r\n### 追加した共通モジュール\r\n1. common/EditableTable.js\r\n   1. スケジュールを描画している部分に「react-table」ってライブラリを追加してるんだけど、カスタマイズしたかったからコレのwrapperを作った。\r\n1. js/Formatter.js\r\n   1. スケジュール画面から値を変更したときにバリデーション＋オートコンプリートをする必要があるはずなので、とりあえずIFだけ作った。\r\n   1. ちゃんとしたライブラリが組み込めるなら、それに置き換える。\r\n1. js/GtbUtils.js\r\n   1. チリメン時代からのおなじみ、GtbUtils。\r\n   1. うわーなんか適当にメソッドつくりてぇ〜〜〜ってなったらここに作る。今回は「絶対被らない一時ID」を作りたかったので、ここに追加した。他のメソッドはたぶん使ってない。\r\n","created_at":"2017-10-25T22:18:28Z","updated_at":"2017-11-01T08:16:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b27c874a86b750bee0e910d8460f7bbd77a6d43","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14/commits","review_comments_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14/comments","review_comment_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/14/comments","statuses_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/statuses/ac4f772c9afac89aaa9dca8eaab390a6b328a410","head":{"label":"gitobi:add_device_watering_view_skelton","ref":"add_device_watering_view_skelton","sha":"ac4f772c9afac89aaa9dca8eaab390a6b328a410","user":{"login":"gitobi","id":8938340,"avatar_url":"https://avatars3.githubusercontent.com/u/8938340?v=4","gravatar_id":"","url":"https://api.github.com/users/gitobi","html_url":"https://github.com/gitobi","followers_url":"https://api.github.com/users/gitobi/followers","following_url":"https://api.github.com/users/gitobi/following{/other_user}","gists_url":"https://api.github.com/users/gitobi/gists{/gist_id}","starred_url":"https://api.github.com/users/gitobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitobi/subscriptions","organizations_url":"https://api.github.com/users/gitobi/orgs","repos_url":"https://api.github.com/users/gitobi/repos","events_url":"https://api.github.com/users/gitobi/events{/privacy}","received_events_url":"https://api.github.com/users/gitobi/received_events","type":"Organization","site_admin":false},"repo":{"id":103122103,"name":"karakuri-farm-web","full_name":"gitobi/karakuri-farm-web","owner":{"login":"gitobi","id":8938340,"avatar_url":"https://avatars3.githubusercontent.com/u/8938340?v=4","gravatar_id":"","url":"https://api.github.com/users/gitobi","html_url":"https://github.com/gitobi","followers_url":"https://api.github.com/users/gitobi/followers","following_url":"https://api.github.com/users/gitobi/following{/other_user}","gists_url":"https://api.github.com/users/gitobi/gists{/gist_id}","starred_url":"https://api.github.com/users/gitobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitobi/subscriptions","organizations_url":"https://api.github.com/users/gitobi/orgs","repos_url":"https://api.github.com/users/gitobi/repos","events_url":"https://api.github.com/users/gitobi/events{/privacy}","received_events_url":"https://api.github.com/users/gitobi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitobi/karakuri-farm-web","description":"Single Page Application for karakuri.farm","fork":false,"url":"https://api.github.com/repos/gitobi/karakuri-farm-web","forks_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/forks","keys_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/teams","hooks_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/hooks","issue_events_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/events{/number}","events_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/events","assignees_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/assignees{/user}","branches_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/branches{/branch}","tags_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/tags","blobs_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/statuses/{sha}","languages_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/languages","stargazers_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/stargazers","contributors_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/contributors","subscribers_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/subscribers","subscription_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/subscription","commits_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/contents/{+path}","compare_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/merges","archive_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/downloads","issues_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues{/number}","pulls_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls{/number}","milestones_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/milestones{/number}","notifications_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/labels{/name}","releases_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/releases{/id}","deployments_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/deployments","created_at":"2017-09-11T10:24:26Z","updated_at":"2017-09-14T08:09:34Z","pushed_at":"2017-11-01T08:11:32Z","git_url":"git://github.com/gitobi/karakuri-farm-web.git","ssh_url":"git@github.com:gitobi/karakuri-farm-web.git","clone_url":"https://github.com/gitobi/karakuri-farm-web.git","svn_url":"https://github.com/gitobi/karakuri-farm-web","homepage":null,"size":257,"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,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"gitobi:master","ref":"master","sha":"c994b35d210a603046f5b0803d663b2b5335ada2","user":{"login":"gitobi","id":8938340,"avatar_url":"https://avatars3.githubusercontent.com/u/8938340?v=4","gravatar_id":"","url":"https://api.github.com/users/gitobi","html_url":"https://github.com/gitobi","followers_url":"https://api.github.com/users/gitobi/followers","following_url":"https://api.github.com/users/gitobi/following{/other_user}","gists_url":"https://api.github.com/users/gitobi/gists{/gist_id}","starred_url":"https://api.github.com/users/gitobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitobi/subscriptions","organizations_url":"https://api.github.com/users/gitobi/orgs","repos_url":"https://api.github.com/users/gitobi/repos","events_url":"https://api.github.com/users/gitobi/events{/privacy}","received_events_url":"https://api.github.com/users/gitobi/received_events","type":"Organization","site_admin":false},"repo":{"id":103122103,"name":"karakuri-farm-web","full_name":"gitobi/karakuri-farm-web","owner":{"login":"gitobi","id":8938340,"avatar_url":"https://avatars3.githubusercontent.com/u/8938340?v=4","gravatar_id":"","url":"https://api.github.com/users/gitobi","html_url":"https://github.com/gitobi","followers_url":"https://api.github.com/users/gitobi/followers","following_url":"https://api.github.com/users/gitobi/following{/other_user}","gists_url":"https://api.github.com/users/gitobi/gists{/gist_id}","starred_url":"https://api.github.com/users/gitobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitobi/subscriptions","organizations_url":"https://api.github.com/users/gitobi/orgs","repos_url":"https://api.github.com/users/gitobi/repos","events_url":"https://api.github.com/users/gitobi/events{/privacy}","received_events_url":"https://api.github.com/users/gitobi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitobi/karakuri-farm-web","description":"Single Page Application for karakuri.farm","fork":false,"url":"https://api.github.com/repos/gitobi/karakuri-farm-web","forks_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/forks","keys_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/teams","hooks_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/hooks","issue_events_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/events{/number}","events_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/events","assignees_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/assignees{/user}","branches_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/branches{/branch}","tags_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/tags","blobs_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/statuses/{sha}","languages_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/languages","stargazers_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/stargazers","contributors_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/contributors","subscribers_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/subscribers","subscription_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/subscription","commits_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/contents/{+path}","compare_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/merges","archive_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/downloads","issues_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues{/number}","pulls_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls{/number}","milestones_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/milestones{/number}","notifications_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/labels{/name}","releases_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/releases{/id}","deployments_url":"https://api.github.com/repos/gitobi/karakuri-farm-web/deployments","created_at":"2017-09-11T10:24:26Z","updated_at":"2017-09-14T08:09:34Z","pushed_at":"2017-11-01T08:11:32Z","git_url":"git://github.com/gitobi/karakuri-farm-web.git","ssh_url":"git@github.com:gitobi/karakuri-farm-web.git","clone_url":"https://github.com/gitobi/karakuri-farm-web.git","svn_url":"https://github.com/gitobi/karakuri-farm-web","homepage":null,"size":257,"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,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14"},"html":{"href":"https://github.com/gitobi/karakuri-farm-web/pull/14"},"issue":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/14"},"comments":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/gitobi/karakuri-farm-web/statuses/ac4f772c9afac89aaa9dca8eaab390a6b328a410"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"TakuroOnoda"}}