From 53c93f7fd727d9c48834750cbd952376e6f8334c Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 10 May 2022 13:52:25 +0100 Subject: [PATCH] Hide system info when running in hosted environments refs https://github.com/TryGhost/Toolbox/issues/326 - we want to simplify the What's New screen to hide the fields that are irrelevant for users in hosted environments - this should still show the database warning for self-hosters --- ghost/admin/app/controllers/whatsnew.js | 13 +++++++++---- ghost/admin/app/templates/whatsnew.hbs | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ghost/admin/app/controllers/whatsnew.js b/ghost/admin/app/controllers/whatsnew.js index 120e4aaad0..087c904533 100644 --- a/ghost/admin/app/controllers/whatsnew.js +++ b/ghost/admin/app/controllers/whatsnew.js @@ -13,16 +13,21 @@ export default class WhatsNewController extends Controller { return date.getFullYear(); } - get showDatabaseWarning() { - const isProduction = !!this.config.get('environment').match?.(/production/i); + get showSystemInfo() { const isPro = !!this.config.get('hostSettings')?.siteId; - const database = this.config.get('database'); - // Don't show any warnings for Pro + // Don't show any system info for Pro if (isPro) { return false; } + return true; + } + + get showDatabaseWarning() { + const isProduction = !!this.config.get('environment').match?.(/production/i); + const database = this.config.get('database'); + // Show a warning if we're in production and not using MySQL 8 if (isProduction && database !== 'mysql8') { return true; diff --git a/ghost/admin/app/templates/whatsnew.hbs b/ghost/admin/app/templates/whatsnew.hbs index 8df206f751..83c611c3c8 100644 --- a/ghost/admin/app/templates/whatsnew.hbs +++ b/ghost/admin/app/templates/whatsnew.hbs @@ -51,15 +51,17 @@ - {{#if this.showDatabaseWarning}} + {{#if (and this.showSystemInfo this.showDatabaseWarning)}}

Warning: MySQL 8 will be the required database in the next major release of Ghost. Make sure your database is up to date to ensure forwards compatibility.