From 58fda5bad2e59ab5436184758e73a81ef65f3d75 Mon Sep 17 00:00:00 2001 From: Rish Date: Fri, 2 Oct 2020 15:30:54 +0530 Subject: [PATCH] Allowed accent color setting for site with portal flag no issue - We had previously allowed accent_color setting for member site settings behind portal flag, but Ghost Admin also needs the public site setting with accent color to correctly reflect the accent color when flag is switched on - Removes deletion of accent color setting when behind the Portal flag OR dev experiment flag --- core/server/api/canary/site.js | 2 +- .../api/canary/utils/serializers/output/utils/mapper.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/server/api/canary/site.js b/core/server/api/canary/site.js index e61469b0e8..f38740ba59 100644 --- a/core/server/api/canary/site.js +++ b/core/server/api/canary/site.js @@ -19,7 +19,7 @@ const site = { }; // accent_color is currently an experimental feature - if (!config.get('enableDeveloperExperiments')) { + if (!config.get('enableDeveloperExperiments') && !config.get('portal')) { delete response.accent_color; } diff --git a/core/server/api/canary/utils/serializers/output/utils/mapper.js b/core/server/api/canary/utils/serializers/output/utils/mapper.js index 181d50d6d2..977ca591dc 100644 --- a/core/server/api/canary/utils/serializers/output/utils/mapper.js +++ b/core/server/api/canary/utils/serializers/output/utils/mapper.js @@ -104,13 +104,13 @@ const mapSettings = (attrs, frame) => { // fields completely. if (_.isArray(attrs)) { attrs = _.filter(attrs, (o) => { - if (o.key === 'accent_color' && !config.get('enableDeveloperExperiments')) { + if (o.key === 'accent_color' && !config.get('enableDeveloperExperiments') && !config.get('portal')) { return false; } return o.key !== 'ghost_head' && o.key !== 'ghost_foot'; }); } else { - if (!config.get('enableDeveloperExperiments')) { + if (!config.get('enableDeveloperExperiments') && !config.get('portal')) { delete attrs.accent_color; } }