Protected Audit Log page behind labs flag

refs https://github.com/TryGhost/Toolbox/issues/356

- even though I was hiding the button, it's better to prevent going to
  the route entirely by redirecting to the homepage if the labs flag is
  not enabled
This commit is contained in:
Daniel Lockyer 2022-08-18 17:03:44 +02:00
parent 7b160493db
commit 7ce6b27772
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD

View File

@ -1,6 +1,16 @@
import AdminRoute from 'ghost-admin/routes/admin';
import {inject as service} from '@ember/service';
export default class AuditLogRoute extends AdminRoute {
@service feature;
beforeModel() {
super.beforeModel(...arguments);
if (!this.feature.auditLog) {
return this.transitionTo('home');
}
}
buildRouteInfoMetadata() {
return {
titleToken: 'Settings - Audit log'