Add dashboard module
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { createElement, lazy } from "react";
|
||||
import type { DashboardWidgetsUiCapability, PlatformWebModule } from "@govoplan/core-webui";
|
||||
import InstalledModulesWidget from "./features/dashboard/widgets/InstalledModulesWidget";
|
||||
import { generatedTranslations } from "./i18n/generatedTranslations";
|
||||
import "./styles/dashboard.css";
|
||||
|
||||
const DashboardPage = lazy(() => import("./features/dashboard/DashboardPage"));
|
||||
|
||||
const dashboardWidgets: DashboardWidgetsUiCapability = {
|
||||
widgets: [
|
||||
{
|
||||
id: "dashboard.installed-modules",
|
||||
title: "Installed modules",
|
||||
description: "Enabled WebUI modules in this browser session.",
|
||||
moduleId: "dashboard",
|
||||
category: "Platform",
|
||||
order: 10,
|
||||
defaultSize: "medium",
|
||||
render: ({ modules }) => createElement(InstalledModulesWidget, { modules })
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const translations = {
|
||||
en: generatedTranslations.en,
|
||||
de: generatedTranslations.de
|
||||
};
|
||||
|
||||
export const dashboardModule: PlatformWebModule = {
|
||||
id: "dashboard",
|
||||
label: "i18n:govoplan-dashboard.dashboard.3f8b4df2",
|
||||
version: "1.0.0",
|
||||
dependencies: ["access"],
|
||||
optionalDependencies: ["ops", "campaigns", "files", "mail", "tasks", "notifications", "reporting"],
|
||||
translations,
|
||||
navItems: [{ to: "/dashboard", label: "i18n:govoplan-dashboard.dashboard.3f8b4df2", iconName: "dashboard", order: 10 }],
|
||||
routes: [
|
||||
{ path: "/dashboard", order: 10, render: ({ settings, auth }) => createElement(DashboardPage, { settings, auth }) }
|
||||
],
|
||||
uiCapabilities: {
|
||||
"dashboard.widgets": dashboardWidgets
|
||||
}
|
||||
};
|
||||
|
||||
export default dashboardModule;
|
||||
|
||||
Reference in New Issue
Block a user