mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
Add check for audit-logs feature enabled
This commit is contained in:
parent
c5c20a3ce0
commit
1961ae6cc0
@ -12,6 +12,7 @@ window.strapi = {
|
||||
telemetryDisabled: process.env.STRAPI_TELEMETRY_DISABLED ?? false,
|
||||
features: {
|
||||
SSO: 'sso',
|
||||
auditLogs: 'audit-logs',
|
||||
},
|
||||
projectType: 'Community',
|
||||
};
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
import adminPermissions from '../../../../../admin/src/permissions';
|
||||
|
||||
const auditLogsRoutes = [
|
||||
// TODO check if feature enabled
|
||||
{
|
||||
intlLabel: { id: 'global.auditLogs', defaultMessage: 'Audit Logs' },
|
||||
to: '/settings/audit-logs?pageSize=50&page=1&sort=date:DESC',
|
||||
id: 'auditLogs',
|
||||
isDisplayed: false,
|
||||
permissions: adminPermissions.settings.auditLogs.main,
|
||||
},
|
||||
];
|
||||
const auditLogsRoutes = strapi.features.isEnabled(strapi.features.auditLogs)
|
||||
? [
|
||||
{
|
||||
intlLabel: { id: 'global.auditLogs', defaultMessage: 'Audit Logs' },
|
||||
to: '/settings/audit-logs?pageSize=50&page=1&sort=date:DESC',
|
||||
id: 'auditLogs',
|
||||
isDisplayed: false,
|
||||
permissions: adminPermissions.settings.auditLogs.main,
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
||||
const customAdminLinks = [...auditLogsRoutes];
|
||||
|
||||
|
||||
@ -1,17 +1,4 @@
|
||||
const routes = [
|
||||
// TODO check if feature enabled
|
||||
{
|
||||
async Component() {
|
||||
const component = await import(
|
||||
/* webpackChunkName: "admin-audit-logs" */ '../pages/AuditLogs/ProtectedListPage'
|
||||
);
|
||||
|
||||
return component;
|
||||
},
|
||||
to: '/settings/audit-logs',
|
||||
exact: true,
|
||||
},
|
||||
];
|
||||
const routes = [];
|
||||
|
||||
if (strapi.features.isEnabled(strapi.features.SSO)) {
|
||||
routes.push({
|
||||
@ -27,4 +14,18 @@ if (strapi.features.isEnabled(strapi.features.SSO)) {
|
||||
});
|
||||
}
|
||||
|
||||
if (strapi.features.isEnabled(strapi.features.auditLogs)) {
|
||||
routes.push({
|
||||
async Component() {
|
||||
const component = await import(
|
||||
/* webpackChunkName: "audit-logs-settings-page" */ '../pages/AuditLogs/ProtectedListPage'
|
||||
);
|
||||
|
||||
return component;
|
||||
},
|
||||
to: '/settings/audit-logs',
|
||||
exact: true,
|
||||
});
|
||||
}
|
||||
|
||||
export default routes;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user