{"action":"created","comment":{"url":"https://api.github.com/repos/open-company/open-company-storage/pulls/comments/151510158","pull_request_review_id":77230902,"id":151510158,"diff_hunk":"@@ -267,15 +285,73 @@\n   ;; Responses\n   :handle-ok (fn [ctx] (entry-rep/render-entry-list org-slug board-slug\n                           (:existing-entries ctx) (:access-level ctx) (-> ctx :user :user-id)))\n-  :handle-created (fn [ctx] (let [new-entry (:created-entry ctx)]\n+  :handle-created (fn [ctx] (let [new-entry (:created-entry ctx)\n+                                  existing-board (:existing-board ctx)]\n                               (api-common/location-response\n                                 (entry-rep/url org-slug board-slug (:uuid new-entry))\n-                                (entry-rep/render-entry org-slug board-slug new-entry [] []\n+                                (entry-rep/render-entry org-slug existing-board new-entry [] []\n                                   :author (-> ctx :user :user-id))\n                                 mt/entry-media-type)))\n   :handle-unprocessable-entity (fn [ctx]\n     (api-common/unprocessable-entity-response (:reason ctx))))\n \n+;; A resource for operations to publish a particular entry\n+(defresource publish [conn org-slug board-slug entry-uuid]\n+  (api-common/open-company-authenticated-resource config/passphrase) ; verify validity and presence of required JWToken\n+\n+  :allowed-methods [:options :post]\n+\n+  ;; Authorization\n+  :allowed? (by-method {\n+    :options true\n+    :post (fn [ctx] (access/allow-authors conn org-slug (:user ctx)))})\n+\n+  ;; Media type client accepts\n+  :available-media-types (by-method {\n+                            :post [mt/entry-media-type]})\n+  :handle-not-acceptable (by-method {\n+                            :post (api-common/only-accept 406 mt/entry-media-type)})\n+\n+  ;; Possibly no data to handle\n+  :malformed? (by-method {\n+    :options false\n+    :post (fn [ctx] (api-common/malformed-json? ctx true))}) ; allow nil\n+  :processable? (by-method {\n+    :options true\n+    :post (fn [ctx] (let [entry-props (:data ctx)]\n+                      (or (nil? entry-props) ; no share is fine","path":"src/oc/storage/api/entries.clj","position":null,"original_position":106,"commit_id":"6752d984c7bd7103a5e61d2c8fbd3a036df3e3d4","original_commit_id":"9c04698726a4e91542b48f876c78dfeeeef86381","user":{"login":"belucid","id":12163,"avatar_url":"https://avatars1.githubusercontent.com/u/12163?v=4","gravatar_id":"","url":"https://api.github.com/users/belucid","html_url":"https://github.com/belucid","followers_url":"https://api.github.com/users/belucid/followers","following_url":"https://api.github.com/users/belucid/following{/other_user}","gists_url":"https://api.github.com/users/belucid/gists{/gist_id}","starred_url":"https://api.github.com/users/belucid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belucid/subscriptions","organizations_url":"https://api.github.com/users/belucid/orgs","repos_url":"https://api.github.com/users/belucid/repos","events_url":"https://api.github.com/users/belucid/events{/privacy}","received_events_url":"https://api.github.com/users/belucid/received_events","type":"User","site_admin":false},"body":"agree on the comment, it's updated","created_at":"2017-11-16T19:13:41Z","updated_at":"2017-11-16T19:13:41Z","html_url":"https://github.com/open-company/open-company-storage/pull/97#discussion_r151510158","pull_request_url":"https://api.github.com/repos/open-company/open-company-storage/pulls/97","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/open-company/open-company-storage/pulls/comments/151510158"},"html":{"href":"https://github.com/open-company/open-company-storage/pull/97#discussion_r151510158"},"pull_request":{"href":"https://api.github.com/repos/open-company/open-company-storage/pulls/97"}},"in_reply_to_id":151470268},"pull_request":{"url":"https://api.github.com/repos/open-company/open-company-storage/pulls/97","id":151421730,"html_url":"https://github.com/open-company/open-company-storage/pull/97","diff_url":"https://github.com/open-company/open-company-storage/pull/97.diff","patch_url":"https://github.com/open-company/open-company-storage/pull/97.patch","issue_url":"https://api.github.com/repos/open-company/open-company-storage/issues/97","number":97,"state":"open","locked":false,"title":"Drafts","user":{"login":"belucid","id":12163,"avatar_url":"https://avatars1.githubusercontent.com/u/12163?v=4","gravatar_id":"","url":"https://api.github.com/users/belucid","html_url":"https://github.com/belucid","followers_url":"https://api.github.com/users/belucid/followers","following_url":"https://api.github.com/users/belucid/following{/other_user}","gists_url":"https://api.github.com/users/belucid/gists{/gist_id}","starred_url":"https://api.github.com/users/belucid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belucid/subscriptions","organizations_url":"https://api.github.com/users/belucid/orgs","repos_url":"https://api.github.com/users/belucid/repos","events_url":"https://api.github.com/users/belucid/events{/privacy}","received_events_url":"https://api.github.com/users/belucid/received_events","type":"User","site_admin":false},"body":"https://trello.com/c/4ptAIHYc\r\n\r\nBack end changes that repurpose old story draft support for entry drafts. \r\n\r\nSupports the Web UI work here: https://github.com/open-company/open-company-web/pull/282\r\n\r\n- [x] Review the code\r\n- [ ] Follow the tests steps on https://github.com/open-company/open-company-web/pull/282\r\n\r\nBe sure to have a 2nd user logged into the org during your tests and watch when they get change notifications:\r\n\r\n- [ ] No change when the other user creates a draft?\r\n- [ ] No change when the other user updates a draft?\r\n- [ ] No change when the other user deletes a draft?\r\n- [ ] Do get a change when the other user publishes a draft?\r\n- [ ] Still get a change when the other user goes straight to a published entry with no draft (no regression)?\r\n- [ ] Still get a change when the other user updates a published entry (no regression)?\r\n- [ ] Still get a change when the other user deletes a published entry (no regression)?","created_at":"2017-11-08T15:58:30Z","updated_at":"2017-11-16T19:13:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e4f5b69dcbc6dcc88cb26274746865e4529e680","assignee":{"login":"bago2k4","id":642704,"avatar_url":"https://avatars3.githubusercontent.com/u/642704?v=4","gravatar_id":"","url":"https://api.github.com/users/bago2k4","html_url":"https://github.com/bago2k4","followers_url":"https://api.github.com/users/bago2k4/followers","following_url":"https://api.github.com/users/bago2k4/following{/other_user}","gists_url":"https://api.github.com/users/bago2k4/gists{/gist_id}","starred_url":"https://api.github.com/users/bago2k4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bago2k4/subscriptions","organizations_url":"https://api.github.com/users/bago2k4/orgs","repos_url":"https://api.github.com/users/bago2k4/repos","events_url":"https://api.github.com/users/bago2k4/events{/privacy}","received_events_url":"https://api.github.com/users/bago2k4/received_events","type":"User","site_admin":false},"assignees":[{"login":"bago2k4","id":642704,"avatar_url":"https://avatars3.githubusercontent.com/u/642704?v=4","gravatar_id":"","url":"https://api.github.com/users/bago2k4","html_url":"https://github.com/bago2k4","followers_url":"https://api.github.com/users/bago2k4/followers","following_url":"https://api.github.com/users/bago2k4/following{/other_user}","gists_url":"https://api.github.com/users/bago2k4/gists{/gist_id}","starred_url":"https://api.github.com/users/bago2k4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bago2k4/subscriptions","organizations_url":"https://api.github.com/users/bago2k4/orgs","repos_url":"https://api.github.com/users/bago2k4/repos","events_url":"https://api.github.com/users/bago2k4/events{/privacy}","received_events_url":"https://api.github.com/users/bago2k4/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-company/open-company-storage/pulls/97/commits","review_comments_url":"https://api.github.com/repos/open-company/open-company-storage/pulls/97/comments","review_comment_url":"https://api.github.com/repos/open-company/open-company-storage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-company/open-company-storage/issues/97/comments","statuses_url":"https://api.github.com/repos/open-company/open-company-storage/statuses/6752d984c7bd7103a5e61d2c8fbd3a036df3e3d4","head":{"label":"open-company:drafts","ref":"drafts","sha":"6752d984c7bd7103a5e61d2c8fbd3a036df3e3d4","user":{"login":"open-company","id":13063090,"avatar_url":"https://avatars3.githubusercontent.com/u/13063090?v=4","gravatar_id":"","url":"https://api.github.com/users/open-company","html_url":"https://github.com/open-company","followers_url":"https://api.github.com/users/open-company/followers","following_url":"https://api.github.com/users/open-company/following{/other_user}","gists_url":"https://api.github.com/users/open-company/gists{/gist_id}","starred_url":"https://api.github.com/users/open-company/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-company/subscriptions","organizations_url":"https://api.github.com/users/open-company/orgs","repos_url":"https://api.github.com/users/open-company/repos","events_url":"https://api.github.com/users/open-company/events{/privacy}","received_events_url":"https://api.github.com/users/open-company/received_events","type":"Organization","site_admin":false},"repo":{"id":38429476,"name":"open-company-storage","full_name":"open-company/open-company-storage","owner":{"login":"open-company","id":13063090,"avatar_url":"https://avatars3.githubusercontent.com/u/13063090?v=4","gravatar_id":"","url":"https://api.github.com/users/open-company","html_url":"https://github.com/open-company","followers_url":"https://api.github.com/users/open-company/followers","following_url":"https://api.github.com/users/open-company/following{/other_user}","gists_url":"https://api.github.com/users/open-company/gists{/gist_id}","starred_url":"https://api.github.com/users/open-company/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-company/subscriptions","organizations_url":"https://api.github.com/users/open-company/orgs","repos_url":"https://api.github.com/users/open-company/repos","events_url":"https://api.github.com/users/open-company/events{/privacy}","received_events_url":"https://api.github.com/users/open-company/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-company/open-company-storage","description":"OpenCompany Storage Service","fork":false,"url":"https://api.github.com/repos/open-company/open-company-storage","forks_url":"https://api.github.com/repos/open-company/open-company-storage/forks","keys_url":"https://api.github.com/repos/open-company/open-company-storage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-company/open-company-storage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-company/open-company-storage/teams","hooks_url":"https://api.github.com/repos/open-company/open-company-storage/hooks","issue_events_url":"https://api.github.com/repos/open-company/open-company-storage/issues/events{/number}","events_url":"https://api.github.com/repos/open-company/open-company-storage/events","assignees_url":"https://api.github.com/repos/open-company/open-company-storage/assignees{/user}","branches_url":"https://api.github.com/repos/open-company/open-company-storage/branches{/branch}","tags_url":"https://api.github.com/repos/open-company/open-company-storage/tags","blobs_url":"https://api.github.com/repos/open-company/open-company-storage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-company/open-company-storage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-company/open-company-storage/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-company/open-company-storage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-company/open-company-storage/statuses/{sha}","languages_url":"https://api.github.com/repos/open-company/open-company-storage/languages","stargazers_url":"https://api.github.com/repos/open-company/open-company-storage/stargazers","contributors_url":"https://api.github.com/repos/open-company/open-company-storage/contributors","subscribers_url":"https://api.github.com/repos/open-company/open-company-storage/subscribers","subscription_url":"https://api.github.com/repos/open-company/open-company-storage/subscription","commits_url":"https://api.github.com/repos/open-company/open-company-storage/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-company/open-company-storage/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-company/open-company-storage/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-company/open-company-storage/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-company/open-company-storage/contents/{+path}","compare_url":"https://api.github.com/repos/open-company/open-company-storage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-company/open-company-storage/merges","archive_url":"https://api.github.com/repos/open-company/open-company-storage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-company/open-company-storage/downloads","issues_url":"https://api.github.com/repos/open-company/open-company-storage/issues{/number}","pulls_url":"https://api.github.com/repos/open-company/open-company-storage/pulls{/number}","milestones_url":"https://api.github.com/repos/open-company/open-company-storage/milestones{/number}","notifications_url":"https://api.github.com/repos/open-company/open-company-storage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-company/open-company-storage/labels{/name}","releases_url":"https://api.github.com/repos/open-company/open-company-storage/releases{/id}","deployments_url":"https://api.github.com/repos/open-company/open-company-storage/deployments","created_at":"2015-07-02T11:40:24Z","updated_at":"2017-07-11T13:25:48Z","pushed_at":"2017-11-16T19:13:40Z","git_url":"git://github.com/open-company/open-company-storage.git","ssh_url":"git@github.com:open-company/open-company-storage.git","clone_url":"https://github.com/open-company/open-company-storage.git","svn_url":"https://github.com/open-company/open-company-storage","homepage":"https://github.com/open-company","size":3778,"stargazers_count":12,"watchers_count":12,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":12,"default_branch":"mainline"}},"base":{"label":"open-company:mainline","ref":"mainline","sha":"882cf1a5665a66de93c7dc1e552a6ddea0d004ee","user":{"login":"open-company","id":13063090,"avatar_url":"https://avatars3.githubusercontent.com/u/13063090?v=4","gravatar_id":"","url":"https://api.github.com/users/open-company","html_url":"https://github.com/open-company","followers_url":"https://api.github.com/users/open-company/followers","following_url":"https://api.github.com/users/open-company/following{/other_user}","gists_url":"https://api.github.com/users/open-company/gists{/gist_id}","starred_url":"https://api.github.com/users/open-company/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-company/subscriptions","organizations_url":"https://api.github.com/users/open-company/orgs","repos_url":"https://api.github.com/users/open-company/repos","events_url":"https://api.github.com/users/open-company/events{/privacy}","received_events_url":"https://api.github.com/users/open-company/received_events","type":"Organization","site_admin":false},"repo":{"id":38429476,"name":"open-company-storage","full_name":"open-company/open-company-storage","owner":{"login":"open-company","id":13063090,"avatar_url":"https://avatars3.githubusercontent.com/u/13063090?v=4","gravatar_id":"","url":"https://api.github.com/users/open-company","html_url":"https://github.com/open-company","followers_url":"https://api.github.com/users/open-company/followers","following_url":"https://api.github.com/users/open-company/following{/other_user}","gists_url":"https://api.github.com/users/open-company/gists{/gist_id}","starred_url":"https://api.github.com/users/open-company/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-company/subscriptions","organizations_url":"https://api.github.com/users/open-company/orgs","repos_url":"https://api.github.com/users/open-company/repos","events_url":"https://api.github.com/users/open-company/events{/privacy}","received_events_url":"https://api.github.com/users/open-company/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-company/open-company-storage","description":"OpenCompany Storage Service","fork":false,"url":"https://api.github.com/repos/open-company/open-company-storage","forks_url":"https://api.github.com/repos/open-company/open-company-storage/forks","keys_url":"https://api.github.com/repos/open-company/open-company-storage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-company/open-company-storage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-company/open-company-storage/teams","hooks_url":"https://api.github.com/repos/open-company/open-company-storage/hooks","issue_events_url":"https://api.github.com/repos/open-company/open-company-storage/issues/events{/number}","events_url":"https://api.github.com/repos/open-company/open-company-storage/events","assignees_url":"https://api.github.com/repos/open-company/open-company-storage/assignees{/user}","branches_url":"https://api.github.com/repos/open-company/open-company-storage/branches{/branch}","tags_url":"https://api.github.com/repos/open-company/open-company-storage/tags","blobs_url":"https://api.github.com/repos/open-company/open-company-storage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-company/open-company-storage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-company/open-company-storage/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-company/open-company-storage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-company/open-company-storage/statuses/{sha}","languages_url":"https://api.github.com/repos/open-company/open-company-storage/languages","stargazers_url":"https://api.github.com/repos/open-company/open-company-storage/stargazers","contributors_url":"https://api.github.com/repos/open-company/open-company-storage/contributors","subscribers_url":"https://api.github.com/repos/open-company/open-company-storage/subscribers","subscription_url":"https://api.github.com/repos/open-company/open-company-storage/subscription","commits_url":"https://api.github.com/repos/open-company/open-company-storage/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-company/open-company-storage/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-company/open-company-storage/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-company/open-company-storage/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-company/open-company-storage/contents/{+path}","compare_url":"https://api.github.com/repos/open-company/open-company-storage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-company/open-company-storage/merges","archive_url":"https://api.github.com/repos/open-company/open-company-storage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-company/open-company-storage/downloads","issues_url":"https://api.github.com/repos/open-company/open-company-storage/issues{/number}","pulls_url":"https://api.github.com/repos/open-company/open-company-storage/pulls{/number}","milestones_url":"https://api.github.com/repos/open-company/open-company-storage/milestones{/number}","notifications_url":"https://api.github.com/repos/open-company/open-company-storage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-company/open-company-storage/labels{/name}","releases_url":"https://api.github.com/repos/open-company/open-company-storage/releases{/id}","deployments_url":"https://api.github.com/repos/open-company/open-company-storage/deployments","created_at":"2015-07-02T11:40:24Z","updated_at":"2017-07-11T13:25:48Z","pushed_at":"2017-11-16T19:13:40Z","git_url":"git://github.com/open-company/open-company-storage.git","ssh_url":"git@github.com:open-company/open-company-storage.git","clone_url":"https://github.com/open-company/open-company-storage.git","svn_url":"https://github.com/open-company/open-company-storage","homepage":"https://github.com/open-company","size":3778,"stargazers_count":12,"watchers_count":12,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":12,"default_branch":"mainline"}},"_links":{"self":{"href":"https://api.github.com/repos/open-company/open-company-storage/pulls/97"},"html":{"href":"https://github.com/open-company/open-company-storage/pull/97"},"issue":{"href":"https://api.github.com/repos/open-company/open-company-storage/issues/97"},"comments":{"href":"https://api.github.com/repos/open-company/open-company-storage/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/open-company/open-company-storage/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/open-company/open-company-storage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-company/open-company-storage/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/open-company/open-company-storage/statuses/6752d984c7bd7103a5e61d2c8fbd3a036df3e3d4"}},"author_association":"OWNER"}}
{"actor":{"display_login":"belucid"}}