{"action":"opened","number":7077,"pull_request":{"url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077","id":76649116,"html_url":"https://github.com/TryGhost/Ghost/pull/7077","diff_url":"https://github.com/TryGhost/Ghost/pull/7077.diff","patch_url":"https://github.com/TryGhost/Ghost/pull/7077.patch","issue_url":"https://api.github.com/repos/TryGhost/Ghost/issues/7077","number":7077,"state":"open","locked":false,"title":"Support for custom notifications and suppress seen notifications","user":{"login":"vkandy","id":77166,"avatar_url":"https://avatars.githubusercontent.com/u/77166?v=3","gravatar_id":"","url":"https://api.github.com/users/vkandy","html_url":"https://github.com/vkandy","followers_url":"https://api.github.com/users/vkandy/followers","following_url":"https://api.github.com/users/vkandy/following{/other_user}","gists_url":"https://api.github.com/users/vkandy/gists{/gist_id}","starred_url":"https://api.github.com/users/vkandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkandy/subscriptions","organizations_url":"https://api.github.com/users/vkandy/orgs","repos_url":"https://api.github.com/users/vkandy/repos","events_url":"https://api.github.com/users/vkandy/events{/privacy}","received_events_url":"https://api.github.com/users/vkandy/received_events","type":"User","site_admin":false},"body":"This PR addresses **Add support for custom messages** section described in [#5071](https://github.com/TryGhost/Ghost/issues/5071). \r\n\r\n(NOTE: The section **Move the \"update available\" notification to the about page** is addressed in a [different PR in Ghost-Admin repo](https://github.com/TryGhost/Ghost-Admin/pull/102))\r\n\r\nThe implementation in this PR is as follows:\r\n- `update-check.js` now sends `application/json` POST request to _UpdateCheck_ service.\r\n- a new type called `notifications` was added to `schema.js` to store notifications related properties in Settings table.\r\n- added property `seenNotifications` of type `notifications` to `default-settings.json`\r\n- Previously notification processing logic was spread between `controller/admin.js` and `update-check.js`. This code was condensed to a single function `renderNotifications()` in `update-check.js`. Admin controller simply calls updateCheck() like so:\r\n```\r\nupdateCheck().finally(function noMatterWhat() {\r\n  renderIndex();\r\n}).catch(errors.logError);\r\n```\r\n- The function call above triggers `updateCheck()` in `update-check.js`, which checks if it's time to call _UpdateCheck_ service.\r\n```\r\n        if (tooEarlyToCheckin) {\r\n            return renderNotifications();\r\n        }\r\n\r\n        return updateCheckRequest()\r\n        .then(updateCheckResponse)\r\n        .then(renderNotifications)\r\n        .catch(updateCheckError);\r\n```\r\n\r\nIf it's not time to look for an upgrade, it calls `renderNotifications()`. If it's time to call _UpdateCheck_ service, a new POST request is issued. The response object contains latest release number. If the latest release version is greater than the currently running version, a notification is constructed and passed as a promise to `renderNotifications()`. \r\n\r\nEither way, `renderNotifications()` is called.\r\n\r\n- `renderNotifications()` loads all notifications from notification store, loads `seenNotifications` array from Settings and filters out any notifications whose uuid is in `seenNotifications`. The filtered list is saved.","created_at":"2016-07-07T19:09:49Z","updated_at":"2016-07-07T19:09:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1a0d43a1a575b273d5bb980b2205c66b8c735dc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/commits","review_comments_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/comments","review_comment_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/7077/comments","statuses_url":"https://api.github.com/repos/TryGhost/Ghost/statuses/1de2a727f79db4c3fcb27c95e715e3f34f035116","head":{"label":"vkandy:feature/5670-update-notifications-about-page","ref":"feature/5670-update-notifications-about-page","sha":"1de2a727f79db4c3fcb27c95e715e3f34f035116","user":{"login":"vkandy","id":77166,"avatar_url":"https://avatars.githubusercontent.com/u/77166?v=3","gravatar_id":"","url":"https://api.github.com/users/vkandy","html_url":"https://github.com/vkandy","followers_url":"https://api.github.com/users/vkandy/followers","following_url":"https://api.github.com/users/vkandy/following{/other_user}","gists_url":"https://api.github.com/users/vkandy/gists{/gist_id}","starred_url":"https://api.github.com/users/vkandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkandy/subscriptions","organizations_url":"https://api.github.com/users/vkandy/orgs","repos_url":"https://api.github.com/users/vkandy/repos","events_url":"https://api.github.com/users/vkandy/events{/privacy}","received_events_url":"https://api.github.com/users/vkandy/received_events","type":"User","site_admin":false},"repo":{"id":61318448,"name":"Ghost","full_name":"vkandy/Ghost","owner":{"login":"vkandy","id":77166,"avatar_url":"https://avatars.githubusercontent.com/u/77166?v=3","gravatar_id":"","url":"https://api.github.com/users/vkandy","html_url":"https://github.com/vkandy","followers_url":"https://api.github.com/users/vkandy/followers","following_url":"https://api.github.com/users/vkandy/following{/other_user}","gists_url":"https://api.github.com/users/vkandy/gists{/gist_id}","starred_url":"https://api.github.com/users/vkandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkandy/subscriptions","organizations_url":"https://api.github.com/users/vkandy/orgs","repos_url":"https://api.github.com/users/vkandy/repos","events_url":"https://api.github.com/users/vkandy/events{/privacy}","received_events_url":"https://api.github.com/users/vkandy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vkandy/Ghost","description":"Just a blogging platform","fork":true,"url":"https://api.github.com/repos/vkandy/Ghost","forks_url":"https://api.github.com/repos/vkandy/Ghost/forks","keys_url":"https://api.github.com/repos/vkandy/Ghost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vkandy/Ghost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vkandy/Ghost/teams","hooks_url":"https://api.github.com/repos/vkandy/Ghost/hooks","issue_events_url":"https://api.github.com/repos/vkandy/Ghost/issues/events{/number}","events_url":"https://api.github.com/repos/vkandy/Ghost/events","assignees_url":"https://api.github.com/repos/vkandy/Ghost/assignees{/user}","branches_url":"https://api.github.com/repos/vkandy/Ghost/branches{/branch}","tags_url":"https://api.github.com/repos/vkandy/Ghost/tags","blobs_url":"https://api.github.com/repos/vkandy/Ghost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vkandy/Ghost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vkandy/Ghost/git/refs{/sha}","trees_url":"https://api.github.com/repos/vkandy/Ghost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vkandy/Ghost/statuses/{sha}","languages_url":"https://api.github.com/repos/vkandy/Ghost/languages","stargazers_url":"https://api.github.com/repos/vkandy/Ghost/stargazers","contributors_url":"https://api.github.com/repos/vkandy/Ghost/contributors","subscribers_url":"https://api.github.com/repos/vkandy/Ghost/subscribers","subscription_url":"https://api.github.com/repos/vkandy/Ghost/subscription","commits_url":"https://api.github.com/repos/vkandy/Ghost/commits{/sha}","git_commits_url":"https://api.github.com/repos/vkandy/Ghost/git/commits{/sha}","comments_url":"https://api.github.com/repos/vkandy/Ghost/comments{/number}","issue_comment_url":"https://api.github.com/repos/vkandy/Ghost/issues/comments{/number}","contents_url":"https://api.github.com/repos/vkandy/Ghost/contents/{+path}","compare_url":"https://api.github.com/repos/vkandy/Ghost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vkandy/Ghost/merges","archive_url":"https://api.github.com/repos/vkandy/Ghost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vkandy/Ghost/downloads","issues_url":"https://api.github.com/repos/vkandy/Ghost/issues{/number}","pulls_url":"https://api.github.com/repos/vkandy/Ghost/pulls{/number}","milestones_url":"https://api.github.com/repos/vkandy/Ghost/milestones{/number}","notifications_url":"https://api.github.com/repos/vkandy/Ghost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vkandy/Ghost/labels{/name}","releases_url":"https://api.github.com/repos/vkandy/Ghost/releases{/id}","deployments_url":"https://api.github.com/repos/vkandy/Ghost/deployments","created_at":"2016-06-16T18:58:24Z","updated_at":"2016-06-16T18:58:28Z","pushed_at":"2016-07-07T18:04:45Z","git_url":"git://github.com/vkandy/Ghost.git","ssh_url":"git@github.com:vkandy/Ghost.git","clone_url":"https://github.com/vkandy/Ghost.git","svn_url":"https://github.com/vkandy/Ghost","homepage":"https://ghost.org","size":21164,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TryGhost:master","ref":"master","sha":"a1a5e55bf73419e38190c6e7988718016f06a985","user":{"login":"TryGhost","id":2178663,"avatar_url":"https://avatars.githubusercontent.com/u/2178663?v=3","gravatar_id":"","url":"https://api.github.com/users/TryGhost","html_url":"https://github.com/TryGhost","followers_url":"https://api.github.com/users/TryGhost/followers","following_url":"https://api.github.com/users/TryGhost/following{/other_user}","gists_url":"https://api.github.com/users/TryGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/TryGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TryGhost/subscriptions","organizations_url":"https://api.github.com/users/TryGhost/orgs","repos_url":"https://api.github.com/users/TryGhost/repos","events_url":"https://api.github.com/users/TryGhost/events{/privacy}","received_events_url":"https://api.github.com/users/TryGhost/received_events","type":"Organization","site_admin":false},"repo":{"id":9852918,"name":"Ghost","full_name":"TryGhost/Ghost","owner":{"login":"TryGhost","id":2178663,"avatar_url":"https://avatars.githubusercontent.com/u/2178663?v=3","gravatar_id":"","url":"https://api.github.com/users/TryGhost","html_url":"https://github.com/TryGhost","followers_url":"https://api.github.com/users/TryGhost/followers","following_url":"https://api.github.com/users/TryGhost/following{/other_user}","gists_url":"https://api.github.com/users/TryGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/TryGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TryGhost/subscriptions","organizations_url":"https://api.github.com/users/TryGhost/orgs","repos_url":"https://api.github.com/users/TryGhost/repos","events_url":"https://api.github.com/users/TryGhost/events{/privacy}","received_events_url":"https://api.github.com/users/TryGhost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TryGhost/Ghost","description":"Just a blogging platform","fork":false,"url":"https://api.github.com/repos/TryGhost/Ghost","forks_url":"https://api.github.com/repos/TryGhost/Ghost/forks","keys_url":"https://api.github.com/repos/TryGhost/Ghost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TryGhost/Ghost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TryGhost/Ghost/teams","hooks_url":"https://api.github.com/repos/TryGhost/Ghost/hooks","issue_events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/events{/number}","events_url":"https://api.github.com/repos/TryGhost/Ghost/events","assignees_url":"https://api.github.com/repos/TryGhost/Ghost/assignees{/user}","branches_url":"https://api.github.com/repos/TryGhost/Ghost/branches{/branch}","tags_url":"https://api.github.com/repos/TryGhost/Ghost/tags","blobs_url":"https://api.github.com/repos/TryGhost/Ghost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TryGhost/Ghost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TryGhost/Ghost/git/refs{/sha}","trees_url":"https://api.github.com/repos/TryGhost/Ghost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TryGhost/Ghost/statuses/{sha}","languages_url":"https://api.github.com/repos/TryGhost/Ghost/languages","stargazers_url":"https://api.github.com/repos/TryGhost/Ghost/stargazers","contributors_url":"https://api.github.com/repos/TryGhost/Ghost/contributors","subscribers_url":"https://api.github.com/repos/TryGhost/Ghost/subscribers","subscription_url":"https://api.github.com/repos/TryGhost/Ghost/subscription","commits_url":"https://api.github.com/repos/TryGhost/Ghost/commits{/sha}","git_commits_url":"https://api.github.com/repos/TryGhost/Ghost/git/commits{/sha}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/comments{/number}","issue_comment_url":"https://api.github.com/repos/TryGhost/Ghost/issues/comments{/number}","contents_url":"https://api.github.com/repos/TryGhost/Ghost/contents/{+path}","compare_url":"https://api.github.com/repos/TryGhost/Ghost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TryGhost/Ghost/merges","archive_url":"https://api.github.com/repos/TryGhost/Ghost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TryGhost/Ghost/downloads","issues_url":"https://api.github.com/repos/TryGhost/Ghost/issues{/number}","pulls_url":"https://api.github.com/repos/TryGhost/Ghost/pulls{/number}","milestones_url":"https://api.github.com/repos/TryGhost/Ghost/milestones{/number}","notifications_url":"https://api.github.com/repos/TryGhost/Ghost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TryGhost/Ghost/labels{/name}","releases_url":"https://api.github.com/repos/TryGhost/Ghost/releases{/id}","deployments_url":"https://api.github.com/repos/TryGhost/Ghost/deployments","created_at":"2013-05-04T11:09:13Z","updated_at":"2016-07-07T17:30:02Z","pushed_at":"2016-07-07T19:09:49Z","git_url":"git://github.com/TryGhost/Ghost.git","ssh_url":"git@github.com:TryGhost/Ghost.git","clone_url":"https://github.com/TryGhost/Ghost.git","svn_url":"https://github.com/TryGhost/Ghost","homepage":"https://ghost.org","size":52519,"stargazers_count":19963,"watchers_count":19963,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4866,"mirror_url":null,"open_issues_count":223,"forks":4866,"open_issues":223,"watchers":19963,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077"},"html":{"href":"https://github.com/TryGhost/Ghost/pull/7077"},"issue":{"href":"https://api.github.com/repos/TryGhost/Ghost/issues/7077"},"comments":{"href":"https://api.github.com/repos/TryGhost/Ghost/issues/7077/comments"},"review_comments":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/comments"},"review_comment":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/commits"},"statuses":{"href":"https://api.github.com/repos/TryGhost/Ghost/statuses/1de2a727f79db4c3fcb27c95e715e3f34f035116"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":155,"deletions":105,"changed_files":5}}
{"actor":{"display_login":"vkandy"}}