From 0f2faed20c401e2e060a53f7eb673eda80c914c6 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 18 Jan 2022 11:05:53 +0000 Subject: [PATCH] Updated database warning wording refs https://github.com/TryGhost/Toolbox/issues/175 - both cases now show the same message so I've reverted back to returning a boolean indicating whether it should be shown - also pulls out the check for Pro so the if-statements are easier to read --- ghost/admin/app/controllers/whatsnew.js | 15 ++++++++++----- ghost/admin/app/templates/whatsnew.hbs | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ghost/admin/app/controllers/whatsnew.js b/ghost/admin/app/controllers/whatsnew.js index 9f1fb4d5b5..120e4aaad0 100644 --- a/ghost/admin/app/controllers/whatsnew.js +++ b/ghost/admin/app/controllers/whatsnew.js @@ -13,19 +13,24 @@ export default class WhatsNewController extends Controller { return date.getFullYear(); } - get databaseWarning() { + get showDatabaseWarning() { const isProduction = !!this.config.get('environment').match?.(/production/i); const isPro = !!this.config.get('hostSettings')?.siteId; const database = this.config.get('database'); + // Don't show any warnings for Pro + if (isPro) { + return false; + } + // Show a warning if we're in production and not using MySQL 8 - if (isProduction && !isPro && database !== 'mysql8') { - return 'MySQL 8 will be the required database in the next major release of Ghost.'; + if (isProduction && database !== 'mysql8') { + return true; } // Show a warning if we're in development and using MySQL 5 - if (!isProduction && !isPro && database === 'mysql5') { - return 'MySQL 5 will no longer be supported in the next major release of Ghost.'; + if (!isProduction && database === 'mysql5') { + return true; } return false; diff --git a/ghost/admin/app/templates/whatsnew.hbs b/ghost/admin/app/templates/whatsnew.hbs index b2897b5a71..7494d38b3f 100644 --- a/ghost/admin/app/templates/whatsnew.hbs +++ b/ghost/admin/app/templates/whatsnew.hbs @@ -59,10 +59,10 @@ {{/if}} - {{#if this.databaseWarning}} + {{#if this.showDatabaseWarning}}

- Warning: {{this.databaseWarning}} Make sure your database is up to date to ensure forwards compatibility. + 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.

{{/if}}