44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { buildAdminDashboardVM } from "@hivegrid/view-models";
|
|
import { createInstance } from "i18next";
|
|
import { I18nextProvider, initReactI18next } from "react-i18next";
|
|
import { MemoryRouter } from "react-router";
|
|
|
|
import deTranslations from "../../../../public/locales/de/translations.json";
|
|
import { AdminPersonalizedDashboard } from "./AdminPersonalizedDashboard";
|
|
|
|
const visualI18n = createInstance();
|
|
void visualI18n.use(initReactI18next).init({
|
|
lng: "de",
|
|
fallbackLng: "de",
|
|
defaultNS: "translation",
|
|
resources: { de: { translation: deTranslations } },
|
|
interpolation: { escapeValue: false },
|
|
initImmediate: false,
|
|
});
|
|
|
|
export function createPersonalizedDashboardVisualVM() {
|
|
return buildAdminDashboardVM({
|
|
roles: ["sales", "engineering"],
|
|
widgets: [
|
|
{ id: "sales_own_pipeline", value: "128.000 €", href: "/sales/deals" },
|
|
{ id: "sales_today", value: "6", href: "/sales/tasks/today", tone: "warning" },
|
|
{ id: "sales_appointments", value: "4", href: "/sales/bookings" },
|
|
{ id: "sales_followups", value: "9", href: "/sales/tasks/today" },
|
|
{ id: "engineering_health", value: "OK", href: "/system", tone: "positive" },
|
|
{ id: "engineering_queues", value: "0", href: "/system/jobs", tone: "positive" },
|
|
{ id: "engineering_errors", value: "2", href: "/events", tone: "critical" },
|
|
{ id: "engineering_deploy", value: "a12bc34", href: "/system/deploys" },
|
|
],
|
|
});
|
|
}
|
|
|
|
export function AdminPersonalizedDashboardVisualFixture(): React.JSX.Element {
|
|
return (
|
|
<MemoryRouter>
|
|
<I18nextProvider i18n={visualI18n}>
|
|
<AdminPersonalizedDashboard vm={createPersonalizedDashboardVisualVM()} />
|
|
</I18nextProvider>
|
|
</MemoryRouter>
|
|
);
|
|
}
|