62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
import { createElement, lazy } from "react";
|
|
import { type AdminSectionsUiCapability, type PlatformWebModule } from "@govoplan/core-webui";
|
|
import { generatedTranslations } from "./i18n/generatedTranslations";
|
|
|
|
const AdminAuditPanel = lazy(() => import("./features/audit/AdminAuditPanel"));
|
|
const translations = {
|
|
en: generatedTranslations.en,
|
|
de: generatedTranslations.de
|
|
};
|
|
|
|
const auditAdminSections: AdminSectionsUiCapability = {
|
|
sections: [
|
|
{
|
|
id: "system-audit",
|
|
moduleId: "audit",
|
|
kind: "management",
|
|
surfaceId: "audit.admin.system",
|
|
label: "i18n:govoplan-audit.system_audit.f1a20815",
|
|
group: "SYSTEM",
|
|
order: 90,
|
|
allOf: ["system:audit:read"],
|
|
render: ({ settings, auth }) => createElement(AdminAuditPanel, {
|
|
settings,
|
|
auth,
|
|
systemMode: true
|
|
})
|
|
},
|
|
{
|
|
id: "tenant-audit",
|
|
moduleId: "audit",
|
|
kind: "management",
|
|
surfaceId: "audit.admin.tenant",
|
|
label: "i18n:govoplan-audit.tenant_audit.f1a20817",
|
|
group: "TENANT",
|
|
order: 100,
|
|
allOf: ["audit:read"],
|
|
render: ({ settings, auth }) => createElement(AdminAuditPanel, {
|
|
settings,
|
|
auth,
|
|
systemMode: false
|
|
})
|
|
}
|
|
]
|
|
};
|
|
|
|
export const auditModule: PlatformWebModule = {
|
|
id: "audit",
|
|
label: "Audit",
|
|
version: "0.1.8",
|
|
dependencies: ["access", "admin"],
|
|
viewSurfaces: [
|
|
{ id: "audit.admin.system", moduleId: "audit", kind: "section", label: "System audit", order: 90 },
|
|
{ id: "audit.admin.tenant", moduleId: "audit", kind: "section", label: "Tenant audit", order: 100 }
|
|
],
|
|
translations,
|
|
uiCapabilities: {
|
|
"admin.sections": auditAdminSections
|
|
}
|
|
};
|
|
|
|
export default auditModule;
|