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
This commit is contained in:
Daniel Lockyer 2022-05-10 13:52:25 +01:00
parent d11cf9e1c7
commit 53c93f7fd7
2 changed files with 12 additions and 5 deletions

View File

@ -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;

View File

@ -51,15 +51,17 @@
<ul class="gh-env-list">
<li><strong>Version:</strong> {{this.config.version}}</li>
{{#if this.showSystemInfo}}
<li><strong>Environment:</strong> <span class="ttc">{{this.config.environment}}</span></li>
<li class="gh-env-list-database-type"><strong>Database:</strong> {{this.config.database}}</li>
<li><strong>Mail:</strong> {{#if this.config.mail}}{{this.config.mail}}{{else}}Native{{/if}}</li>
{{/if}}
{{#if (enable-developer-experiments)}}
<li><strong>Developer experiments:</strong> <span class="gh-badge">Enabled</span></li>
{{/if}}
</ul>
{{#if this.showDatabaseWarning}}
{{#if (and this.showSystemInfo this.showDatabaseWarning)}}
<section class="gh-upgrade-notification">
<p>
<strong>Warning:</strong> 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.