From 30dc2a82289667a9e7d5c1f2eac325c4d22e73d4 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Thu, 9 Feb 2023 16:15:54 +0800 Subject: [PATCH] Added `mention_notifications` column (#16242) refs https://github.com/TryGhost/Team/issues/2526 - created a migration for a new boolean column in users that would determine if the staff user gets an email when the publication receive a new mention. --- .../utils/serializers/output/utils/clean.js | 1 + ...03-08-add-mentions-notifications-column.js | 7 +++++++ ghost/core/core/server/data/schema/schema.js | 1 + ghost/core/core/server/models/user.js | 3 ++- .../admin/__snapshots__/members.test.js.snap | 2 +- .../admin/__snapshots__/posts.test.js.snap | 16 +++++++------- .../admin/__snapshots__/session.test.js.snap | 3 ++- .../__snapshots__/pages.test.js.snap | 21 +++++++++++++++++++ .../__snapshots__/posts.test.js.snap | 21 +++++++++++++++++++ .../__snapshots__/authentication.test.js.snap | 9 +++++--- .../unit/server/data/schema/integrity.test.js | 2 +- ghost/core/test/utils/fixtures/fixtures.json | 2 ++ 12 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 ghost/core/core/server/data/migrations/versions/5.34/2023-02-08-03-08-add-mentions-notifications-column.js diff --git a/ghost/core/core/server/api/endpoints/utils/serializers/output/utils/clean.js b/ghost/core/core/server/api/endpoints/utils/serializers/output/utils/clean.js index 76667f4b55..d4b06765f7 100644 --- a/ghost/core/core/server/api/endpoints/utils/serializers/output/utils/clean.js +++ b/ghost/core/core/server/api/endpoints/utils/serializers/output/utils/clean.js @@ -35,6 +35,7 @@ const author = (attrs, frame) => { delete attrs.free_member_signup_notification; delete attrs.paid_subscription_started_notification; delete attrs.paid_subscription_canceled_notification; + delete attrs.mention_notifications; // @NOTE: used for night shift delete attrs.accessibility; diff --git a/ghost/core/core/server/data/migrations/versions/5.34/2023-02-08-03-08-add-mentions-notifications-column.js b/ghost/core/core/server/data/migrations/versions/5.34/2023-02-08-03-08-add-mentions-notifications-column.js new file mode 100644 index 0000000000..6e9d6705b5 --- /dev/null +++ b/ghost/core/core/server/data/migrations/versions/5.34/2023-02-08-03-08-add-mentions-notifications-column.js @@ -0,0 +1,7 @@ +const {createAddColumnMigration} = require('../../utils'); + +module.exports = createAddColumnMigration('users', 'mention_notifications', { + type: 'boolean', + nullable: false, + defaultTo: true +}); diff --git a/ghost/core/core/server/data/schema/schema.js b/ghost/core/core/server/data/schema/schema.js index 9a25e3c53f..defc24d528 100644 --- a/ghost/core/core/server/data/schema/schema.js +++ b/ghost/core/core/server/data/schema/schema.js @@ -154,6 +154,7 @@ module.exports = { free_member_signup_notification: {type: 'boolean', nullable: false, defaultTo: true}, paid_subscription_started_notification: {type: 'boolean', nullable: false, defaultTo: true}, paid_subscription_canceled_notification: {type: 'boolean', nullable: false, defaultTo: false}, + mention_notifications: {type: 'boolean', nullable: false, defaultTo: true}, created_at: {type: 'dateTime', nullable: false}, created_by: {type: 'string', maxlength: 24, nullable: false}, updated_at: {type: 'dateTime', nullable: true}, diff --git a/ghost/core/core/server/models/user.js b/ghost/core/core/server/models/user.js index 8424993624..1f3230ea88 100644 --- a/ghost/core/core/server/models/user.js +++ b/ghost/core/core/server/models/user.js @@ -68,7 +68,8 @@ User = ghostBookshelf.Model.extend({ comment_notifications: true, free_member_signup_notification: true, paid_subscription_started_notification: true, - paid_subscription_canceled_notification: false + paid_subscription_canceled_notification: false, + mention_notifications: true }; }, diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/members.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/members.test.js.snap index 3b3960d38f..e2d4f1beb0 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/members.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/members.test.js.snap @@ -361,7 +361,7 @@ exports[`Members API - member attribution Returns sign up attributions of all ty Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "9295", + "content-length": "9324", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/posts.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/posts.test.js.snap index 74f4065109..96e50e47e8 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/posts.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/posts.test.js.snap @@ -193,7 +193,7 @@ exports[`Posts API Can browse 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "10176", + "content-length": "10292", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -421,7 +421,7 @@ exports[`Posts API Can browse with formats 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "13042", + "content-length": "13158", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -529,7 +529,7 @@ exports[`Posts API Create Can create a post with lexical 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "3884", + "content-length": "3942", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -638,7 +638,7 @@ exports[`Posts API Create Can create a post with mobiledoc 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "3700", + "content-length": "3758", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -852,7 +852,7 @@ exports[`Posts API Update Can update a post with lexical 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "3835", + "content-length": "3893", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -961,7 +961,7 @@ exports[`Posts API Update Can update a post with lexical 4: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "3832", + "content-length": "3890", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -1070,7 +1070,7 @@ exports[`Posts API Update Can update a post with mobiledoc 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "3645", + "content-length": "3703", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -1179,7 +1179,7 @@ exports[`Posts API Update Can update a post with mobiledoc 4: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "3642", + "content-length": "3700", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/session.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/session.test.js.snap index 40046ac693..bd4a5404a9 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/session.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/session.test.js.snap @@ -42,6 +42,7 @@ Object { "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "locale": null, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -63,7 +64,7 @@ exports[`Sessions API can read session now the owner is logged in 2: [headers] 1 Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "677", + "content-length": "706", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, diff --git a/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap b/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap index ffaf120c3f..c171f4f217 100644 --- a/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap +++ b/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap @@ -27,6 +27,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -76,6 +77,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -175,6 +177,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -250,6 +253,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -313,6 +317,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -462,6 +467,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -525,6 +531,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -674,6 +681,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -737,6 +745,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -885,6 +894,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -948,6 +958,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1096,6 +1107,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1159,6 +1171,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1308,6 +1321,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1371,6 +1385,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1564,6 +1579,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1627,6 +1643,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1760,6 +1777,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1826,6 +1844,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1974,6 +1993,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -2040,6 +2060,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", diff --git a/ghost/core/test/e2e-webhooks/__snapshots__/posts.test.js.snap b/ghost/core/test/e2e-webhooks/__snapshots__/posts.test.js.snap index a745d41d70..c84a74cf07 100644 --- a/ghost/core/test/e2e-webhooks/__snapshots__/posts.test.js.snap +++ b/ghost/core/test/e2e-webhooks/__snapshots__/posts.test.js.snap @@ -27,6 +27,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -79,6 +80,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -178,6 +180,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -253,6 +256,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -318,6 +322,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -466,6 +471,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -552,6 +558,7 @@ Header Level 3 "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -702,6 +709,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -767,6 +775,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -915,6 +924,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -980,6 +990,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1128,6 +1139,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1193,6 +1205,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1342,6 +1355,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1428,6 +1442,7 @@ Header Level 3 "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1622,6 +1637,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1708,6 +1724,7 @@ Header Level 3 "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1842,6 +1859,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -1931,6 +1949,7 @@ Header Level 3 "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -2080,6 +2099,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", @@ -2148,6 +2168,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "Joe Bloggs", diff --git a/ghost/core/test/regression/api/admin/__snapshots__/authentication.test.js.snap b/ghost/core/test/regression/api/admin/__snapshots__/authentication.test.js.snap index 122068f58b..c7863379c4 100644 --- a/ghost/core/test/regression/api/admin/__snapshots__/authentication.test.js.snap +++ b/ghost/core/test/regression/api/admin/__snapshots__/authentication.test.js.snap @@ -15,6 +15,7 @@ Object { "id": "1", "last_seen": null, "location": null, + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "test user", @@ -37,7 +38,7 @@ exports[`Authentication API Blog setup complete setup 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "596", + "content-length": "625", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -283,6 +284,7 @@ Object { "id": "1", "last_seen": null, "location": null, + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "test user", @@ -305,7 +307,7 @@ exports[`Authentication API Blog setup complete setup with default theme 2: [hea Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "596", + "content-length": "625", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -566,6 +568,7 @@ Object { "id": "1", "last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "location": "location", + "mention_notifications": true, "meta_description": null, "meta_title": null, "name": "test user edit", @@ -588,7 +591,7 @@ exports[`Authentication API Blog setup update setup 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "668", + "content-length": "697", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, diff --git a/ghost/core/test/unit/server/data/schema/integrity.test.js b/ghost/core/test/unit/server/data/schema/integrity.test.js index 5dd534d626..0aed8ba727 100644 --- a/ghost/core/test/unit/server/data/schema/integrity.test.js +++ b/ghost/core/test/unit/server/data/schema/integrity.test.js @@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route */ describe('DB version integrity', function () { // Only these variables should need updating - const currentSchemaHash = '8eab51dd80562c92215283df89b0200b'; + const currentSchemaHash = 'ed7bdd04b868b94c5b4c8e7da484c405'; const currentFixturesHash = 'd99d3c2891e79b8662ed6a312490d2fd'; const currentSettingsHash = 'b0c8359b7482e39112e7c5739d43f11b'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01'; diff --git a/ghost/core/test/utils/fixtures/fixtures.json b/ghost/core/test/utils/fixtures/fixtures.json index 929044850e..276722e8ea 100644 --- a/ghost/core/test/utils/fixtures/fixtures.json +++ b/ghost/core/test/utils/fixtures/fixtures.json @@ -651,6 +651,7 @@ "free_member_signup_notification": true, "paid_subscription_started_notificaton": true, "paid_subscription_canceled_notification": false, + "mention_notifications": true, "status": "inactive", "roles": [] }, @@ -665,6 +666,7 @@ "free_member_signup_notification": true, "paid_subscription_started_notification": true, "paid_subscription_canceled_notification": false, + "mention_notifications": true, "location": "The Internet", "website": "https://ghost.org", "bio": "You can delete this user to remove all the welcome posts",