2017-08-22 10:53:26 +03:00
|
|
|
import Controller from '@ember/controller';
|
2018-01-09 17:23:36 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2022-01-14 16:27:32 +03:00
|
|
|
export default class WhatsNewController extends Controller {
|
|
|
|
@service config;
|
|
|
|
@service upgradeStatus;
|
|
|
|
@service whatsNew;
|
2021-09-08 15:00:24 +03:00
|
|
|
|
2022-01-14 16:27:32 +03:00
|
|
|
queryParams = ['entry'];
|
2016-01-23 20:14:12 +03:00
|
|
|
|
2022-01-14 16:27:32 +03:00
|
|
|
get copyrightYear() {
|
|
|
|
const date = new Date();
|
2016-01-23 20:14:12 +03:00
|
|
|
return date.getFullYear();
|
2022-01-14 16:27:32 +03:00
|
|
|
}
|
|
|
|
|
2022-01-17 20:50:19 +03:00
|
|
|
get databaseWarning() {
|
2022-01-14 16:27:32 +03:00
|
|
|
const isProduction = !!this.config.get('environment').match?.(/production/i);
|
|
|
|
const isPro = !!this.config.get('hostSettings')?.siteId;
|
2022-01-17 20:50:19 +03:00
|
|
|
const database = this.config.get('database');
|
2022-01-14 16:27:32 +03:00
|
|
|
|
2022-01-17 20:50:19 +03:00
|
|
|
// 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.';
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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.';
|
2022-01-14 16:27:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|