From c3ab2d322f8d28688fe00c76b520672edf307f64 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Mon, 9 Oct 2023 17:05:10 +0700 Subject: [PATCH] Removed Admin X labs flags in email service (#18536) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - Removed redundant Admin X flags from the email service since we are preparing for release. - updated snapshots --- ### 🤖 Generated by Copilot at fb0df07 Simplified staff URL generation for emails by removing unused feature flag and code. This affects the `StaffServiceEmails.js` file and the `adminXSettings` flag. --- .../recommendation-emails.test.js.snap | 6 ++--- ghost/staff-service/lib/StaffServiceEmails.js | 23 +------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/ghost/core/test/e2e-server/services/__snapshots__/recommendation-emails.test.js.snap b/ghost/core/test/e2e-server/services/__snapshots__/recommendation-emails.test.js.snap index e6def3503a..b295947b8b 100644 --- a/ghost/core/test/e2e-server/services/__snapshots__/recommendation-emails.test.js.snap +++ b/ghost/core/test/e2e-server/services/__snapshots__/recommendation-emails.test.js.snap @@ -197,7 +197,7 @@ exports[`Incoming Recommendation Emails Sends an email if we receive a recommend -

Don’t want to receive these emails? Manage your preferences here.

+

Don’t want to receive these emails? Manage your preferences here.

@@ -418,7 +418,7 @@ exports[`Incoming Recommendation Emails Sends an email if we receive a recommend -

Don’t want to receive these emails? Manage your preferences here.

+

Don’t want to receive these emails? Manage your preferences here.

@@ -449,7 +449,7 @@ You have been recommended by Other Ghost Site. --- Sent to jbloggs@example.com from 127.0.0.1. -If you would no longer like to receive these notifications you can adjust your settings at http://127.0.0.1:2369/ghost/#/settings-x/users/show/joe-bloggs. +If you would no longer like to receive these notifications you can adjust your settings at http://127.0.0.1:2369/ghost/#/settings/staff/joe-bloggs. " `; diff --git a/ghost/staff-service/lib/StaffServiceEmails.js b/ghost/staff-service/lib/StaffServiceEmails.js index 685e8affd7..19d3da73a7 100644 --- a/ghost/staff-service/lib/StaffServiceEmails.js +++ b/ghost/staff-service/lib/StaffServiceEmails.js @@ -37,10 +37,6 @@ class StaffServiceEmails { let staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${user.slug}`); - if (this.labs.isSet('adminXSettings')) { - staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings-x/users/show/${user.slug}`); - } - const templateData = { memberData, attributionTitle, @@ -97,10 +93,6 @@ class StaffServiceEmails { let staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${user.slug}`); - if (this.labs.isSet('adminXSettings')) { - staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings-x/users/show/${user.slug}`); - } - const templateData = { memberData, attributionTitle, @@ -154,10 +146,6 @@ class StaffServiceEmails { let staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${user.slug}`); - if (this.labs.isSet('adminXSettings')) { - staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings-x/users/show/${user.slug}`); - } - const templateData = { memberData, tierData, @@ -190,10 +178,6 @@ class StaffServiceEmails { async getSharedData(recipient) { let staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${recipient.slug}`); - if (this.labs.isSet('adminXSettings')) { - staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings-x/users/show/${recipient.slug}`); - } - return { siteTitle: this.settingsCache.get('title'), siteUrl: this.urlUtils.getSiteUrl(), @@ -237,9 +221,7 @@ class StaffServiceEmails { const to = user.email; let staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${user.slug}`); - if (this.labs.isSet('adminXSettings')) { - staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings-x/users/show/${user.slug}`); - } + const templateData = { siteTitle: this.settingsCache.get('title'), siteUrl: this.urlUtils.getSiteUrl(), @@ -294,9 +276,6 @@ class StaffServiceEmails { const to = user.email; let staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${user.slug}`); - if (this.labs.isSet('adminXSettings')) { - staffUrl = this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings-x/users/show/${user.slug}`); - } const templateData = { siteTitle: this.settingsCache.get('title'),