Add approval template revision administration
This commit is contained in:
+27
-3
@@ -1,9 +1,29 @@
|
||||
import { createElement, lazy } from "react";
|
||||
import type { PlatformWebModule } from "@govoplan/core-webui";
|
||||
import { hasScope, type AdminSectionsUiCapability, type PlatformWebModule } from "@govoplan/core-webui";
|
||||
import { generatedTranslations } from "./i18n/generatedTranslations";
|
||||
import "./styles/approvals.css";
|
||||
|
||||
const ApprovalsPage = lazy(() => import("./features/approvals/ApprovalsPage"));
|
||||
const ApprovalTemplatesPanel = lazy(() => import("./features/approvals/ApprovalTemplatesPanel"));
|
||||
|
||||
const approvalsAdminSections: AdminSectionsUiCapability = {
|
||||
sections: [
|
||||
{
|
||||
id: "tenant-approval-templates",
|
||||
moduleId: "approvals",
|
||||
kind: "management",
|
||||
surfaceId: "approvals.admin.templates",
|
||||
label: "Approval templates",
|
||||
group: "TENANT",
|
||||
order: 55,
|
||||
anyOf: ["approvals:workspace:read", "approvals:workspace:admin"],
|
||||
render: ({ settings, auth }) => createElement(ApprovalTemplatesPanel, {
|
||||
settings,
|
||||
canAdmin: hasScope(auth, "approvals:workspace:admin")
|
||||
})
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const approvalsModule: PlatformWebModule = {
|
||||
id: "approvals",
|
||||
@@ -16,8 +36,12 @@ export const approvalsModule: PlatformWebModule = {
|
||||
navItems: [{ to: "/approvals", label: "i18n:govoplan-approvals.approvals", iconName: "list-checks", anyOf: ["approvals:workspace:read"], order: 37, surfaceId: "approvals.navigation" }],
|
||||
viewSurfaces: [
|
||||
{ id: "approvals.navigation", moduleId: "approvals", kind: "navigation", label: "Approvals navigation", order: 10 },
|
||||
{ id: "approvals.workspace", moduleId: "approvals", kind: "route", label: "Approval request workspace", order: 20 }
|
||||
]
|
||||
{ id: "approvals.workspace", moduleId: "approvals", kind: "route", label: "Approval request workspace", order: 20 },
|
||||
{ id: "approvals.admin.templates", moduleId: "approvals", kind: "section", label: "Approval templates", order: 30 }
|
||||
],
|
||||
uiCapabilities: {
|
||||
"admin.sections": approvalsAdminSections
|
||||
}
|
||||
};
|
||||
|
||||
export default approvalsModule;
|
||||
|
||||
Reference in New Issue
Block a user