feat(campaign): surface aggregate reports
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createElement, lazy, useCallback } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Card, ResourceAccessBoundary, type ApiSettings, type AuthInfo, type PlatformWebModule } from "@govoplan/core-webui";
|
||||
import { ResourceAccessBoundary, type ApiSettings, type AuthInfo, type PlatformWebModule } from "@govoplan/core-webui";
|
||||
import { getCampaign } from "./api/campaigns";
|
||||
import { generatedTranslations } from "./i18n/generatedTranslations";
|
||||
import "./styles/campaign-workspace.css";
|
||||
@@ -8,6 +8,7 @@ import "./styles/campaign-workspace.css";
|
||||
const CampaignListPage = lazy(() => import("./features/campaigns/CampaignListPage"));
|
||||
const CampaignWorkspace = lazy(() => import("./features/campaigns/CampaignWorkspace"));
|
||||
const OperatorQueuePage = lazy(() => import("./features/operator/OperatorQueuePage"));
|
||||
const AggregateReportsPage = lazy(() => import("./features/reports/AggregateReportsPage"));
|
||||
const TemplatesPage = lazy(() => import("./features/templates/TemplatesPage"));
|
||||
|
||||
const campaignRead = ["campaigns:campaign:read"];
|
||||
@@ -41,7 +42,7 @@ export const campaignModule: PlatformWebModule = {
|
||||
{ path: "/campaigns", anyOf: campaignRead, order: 20, render: ({ settings }) => createElement(CampaignListPage, { settings }) },
|
||||
{ path: "/campaigns/:campaignId/*", anyOf: campaignRead, order: 21, render: ({ settings, auth }) => createElement(CampaignResourceRoute, { settings, auth }) },
|
||||
{ path: "/operator", anyOf: operatorScopes, allOf: campaignRead, order: 30, render: ({ settings, auth }) => createElement(OperatorQueuePage, { settings, auth }) },
|
||||
{ path: "/reports", anyOf: ["campaigns:report:read"], order: 70, render: () => createElement(ReportsPage) },
|
||||
{ path: "/reports", anyOf: ["campaigns:report:read"], order: 70, render: ({ settings }) => createElement(AggregateReportsPage, { settings }) },
|
||||
{ path: "/templates", order: 90, render: () => createElement(TemplatesPage) }]
|
||||
|
||||
};
|
||||
@@ -59,18 +60,4 @@ function CampaignResourceRoute({ settings, auth }: {settings: ApiSettings;auth:
|
||||
});
|
||||
}
|
||||
|
||||
function ReportsPage() {
|
||||
return createElement(
|
||||
"div",
|
||||
{ className: "content-pad workspace-data-page" },
|
||||
createElement(
|
||||
"div",
|
||||
{ className: "page-heading workspace-heading" },
|
||||
createElement("h1", null, "i18n:govoplan-campaign.reports"),
|
||||
createElement("p", null, "i18n:govoplan-campaign.reports_module_prepared")
|
||||
),
|
||||
createElement(Card, null, createElement("p", { className: "muted" }, "i18n:govoplan-campaign.next_passes_will_add_functionality_here"))
|
||||
);
|
||||
}
|
||||
|
||||
export default campaignModule;
|
||||
|
||||
Reference in New Issue
Block a user