From 10f83ebd4592bf4f236230548535496baf4f0b84 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 20 Jul 2021 10:48:12 +0100 Subject: [PATCH] Added support for feature-gated editor cards refs https://github.com/TryGhost/Team/issues/910 - added `card-is-available` helper that handles the previous `card.developerExperiment` and the new `card.feature` options - updated `` to use the `card-is-available` helper in the conditional when adding cards to the list Cards can be gated by feature when specifying them in `cards.js`, in the card definition object you can add `feature: 'flagName'` which will mean the card is only available when that feature is enabled. --- .../addon/components/koenig-menu-content.hbs | 2 +- .../addon/helpers/card-is-available.js | 22 +++++++++++++++++++ .../app/helpers/card-is-available.js | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 ghost/admin/lib/koenig-editor/addon/helpers/card-is-available.js create mode 100644 ghost/admin/lib/koenig-editor/app/helpers/card-is-available.js diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-menu-content.hbs b/ghost/admin/lib/koenig-editor/addon/components/koenig-menu-content.hbs index 03241e0d01..542ffbeed4 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-menu-content.hbs +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-menu-content.hbs @@ -5,7 +5,7 @@ {{section.title}} {{#each section.items as |item|}} - {{#if (or (not item.developerExperiment) (enable-developer-experiments))}} + {{#if (card-is-available item)}}