From e6df014f848f0440fb47f17054e7d906ee27812b Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 3 Jul 2024 17:59:57 +0100 Subject: [PATCH] Cleaned up newsletterExcerpt flag no issue - feature is GA so the flag and related conditionals are no longer required --- .../settings/advanced/labs/AlphaFeatures.tsx | 4 ---- .../email/newsletters/NewsletterDetailModal.tsx | 3 +-- .../newsletters/NewsletterPreviewContent.tsx | 3 +-- ghost/admin/app/services/feature.js | 1 - ghost/core/core/shared/labs.js | 1 - .../admin/__snapshots__/settings.test.js.snap | 2 +- .../lib/email-templates/template.hbs | 16 +++++++--------- ghost/email-service/test/email-renderer.test.js | 6 ------ 8 files changed, 10 insertions(+), 26 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx b/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx index 1d6c8e2f09..9226aa0a7e 100644 --- a/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx +++ b/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx @@ -60,10 +60,6 @@ const features = [{ description: '(Highly) Experimental support for ActivityPub.', flag: 'ActivityPub' },{ - title: 'Excerpt in newsletter', - description: 'Showing excerpt in newsletter', - flag: 'newsletterExcerpt' -}, { title: 'Content Visibility', description: 'Enables content visibility in Emails', flag: 'contentVisibility' diff --git a/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx b/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx index 74da1d7e4d..831c1bc43e 100644 --- a/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx +++ b/apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx @@ -103,7 +103,6 @@ const Sidebar: React.FC<{ const {mutateAsync: uploadImage} = useUploadImage(); const [selectedTab, setSelectedTab] = useState('generalSettings'); const hasEmailCustomization = useFeatureFlag('emailCustomization'); - const hasNewsletterExcerpt = useFeatureFlag('newsletterExcerpt'); const {localSettings} = useSettingGroup(); const [siteTitle] = getSettingValues(localSettings, ['title']) as string[]; const handleError = useHandleError(); @@ -418,7 +417,7 @@ const Sidebar: React.FC<{ onChange={color => updateNewsletter({title_color: color})} />} - {(hasNewsletterExcerpt && newsletter.show_post_title_section) && + {newsletter.show_post_title_section && Your email newsletter - {(hasNewsletterExcerpt && showExcerpt) && ( + {showExcerpt && (

A subtitle to highlight key points and engage your readers

)}
{{post.title}} - {{#hasFeature 'newsletterExcerpt'}} - {{#if (and newsletter.showExcerpt post.customExcerpt)}} - - -

{{post.customExcerpt}}

- - - {{/if}} - {{/hasFeature}} + {{#if (and newsletter.showExcerpt post.customExcerpt)}} + + +

{{post.customExcerpt}}

+ + + {{/if}} diff --git a/ghost/email-service/test/email-renderer.test.js b/ghost/email-service/test/email-renderer.test.js index 677a36bfaf..8a17bef600 100644 --- a/ghost/email-service/test/email-renderer.test.js +++ b/ghost/email-service/test/email-renderer.test.js @@ -1770,12 +1770,6 @@ describe('Email renderer', function () { }); describe('show excerpt', function () { - beforeEach(function () { - labsEnabled = { - newsletterExcerpt: true - }; - }); - it('is rendered when enabled and customExcerpt is present', async function () { const post = createModel(Object.assign({}, basePost, {custom_excerpt: 'This is an excerpt'})); const newsletter = createModel({