From 4a07e857e236ebd4ff1660a14ed3dab50377d5ad Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Mon, 10 Jul 2023 13:53:42 +0200 Subject: [PATCH] Added Header Card V2 feature flags (#17263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Product/issues/3508 - added a feature flag for Header Cards that's being upgraded. --- ### 🤖 Generated by Copilot at 10ac1e4 This pull request adds a new feature flag `headerUpgrade` to the server and the admin settings, which allows the user to opt-in to a new header design. The feature flag is only available if the labs toggle is enabled. --- .../admin/app/components/koenig-lexical-editor.js | 3 ++- ghost/admin/app/services/feature.js | 1 + ghost/admin/app/templates/settings/labs.hbs | 14 ++++++++++++++ ghost/core/core/shared/labs.js | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/koenig-lexical-editor.js b/ghost/admin/app/components/koenig-lexical-editor.js index dbac3ea539..9ebf3ca2ce 100644 --- a/ghost/admin/app/components/koenig-lexical-editor.js +++ b/ghost/admin/app/components/koenig-lexical-editor.js @@ -277,7 +277,8 @@ export default class KoenigLexicalEditor extends Component { fetchAutocompleteLinks, fetchLabels, feature: { - signupCard: true + signupCard: true, + headerV2: this.feature.get('headerUpgrade') }, membersEnabled: this.settings.get('membersSignupAccess') === 'all', siteTitle: this.settings.title, diff --git a/ghost/admin/app/services/feature.js b/ghost/admin/app/services/feature.js index 44532ca5cf..0f486913bf 100644 --- a/ghost/admin/app/services/feature.js +++ b/ghost/admin/app/services/feature.js @@ -76,6 +76,7 @@ export default class FeatureService extends Service { @feature('pageImprovements') pageImprovements; @feature('flatUrls') flatUrls; @feature('mailEvents') mailEvents; + @feature('headerUpgrade') headerUpgrade; _user = null; diff --git a/ghost/admin/app/templates/settings/labs.hbs b/ghost/admin/app/templates/settings/labs.hbs index 6cb6e4f79b..29613f4618 100644 --- a/ghost/admin/app/templates/settings/labs.hbs +++ b/ghost/admin/app/templates/settings/labs.hbs @@ -338,6 +338,20 @@ + +
+
+
+

Header Card v2

+

+ A new enhanced version of the header card +

+
+
+ +
+
+
{{/if}} diff --git a/ghost/core/core/shared/labs.js b/ghost/core/core/shared/labs.js index a4da42903c..ca20fe71a0 100644 --- a/ghost/core/core/shared/labs.js +++ b/ghost/core/core/shared/labs.js @@ -41,7 +41,8 @@ const ALPHA_FEATURES = [ 'adminXSettings', 'pageImprovements', 'flatUrls', - 'mailEvents' + 'mailEvents', + 'headerUpgrade' ]; module.exports.GA_KEYS = [...GA_FEATURES];