feat: add governed postbox delivery and report hardening
This commit is contained in:
+65
-2
@@ -1,7 +1,14 @@
|
||||
import { createElement, lazy, useCallback } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { ResourceAccessBoundary, type ApiSettings, type AuthInfo, type PlatformWebModule } from "@govoplan/core-webui";
|
||||
import {
|
||||
ResourceAccessBoundary,
|
||||
type ApiSettings,
|
||||
type AuthInfo,
|
||||
type DashboardWidgetsUiCapability,
|
||||
type PlatformWebModule
|
||||
} from "@govoplan/core-webui";
|
||||
import { getCampaign } from "./api/campaigns";
|
||||
import CampaignActivityWidget from "./features/campaigns/CampaignActivityWidget";
|
||||
import { generatedTranslations } from "./i18n/generatedTranslations";
|
||||
import "./styles/campaign-workspace.css";
|
||||
|
||||
@@ -17,6 +24,50 @@ const translations = {
|
||||
en: generatedTranslations.en,
|
||||
de: generatedTranslations.de
|
||||
};
|
||||
const campaignDashboardWidgets: DashboardWidgetsUiCapability = {
|
||||
widgets: [
|
||||
{
|
||||
id: "campaigns.activity",
|
||||
surfaceId: "campaigns.widget.activity",
|
||||
title: "Campaign activity",
|
||||
description: "Recently changed campaigns and delivery state.",
|
||||
moduleId: "campaigns",
|
||||
category: "Communication",
|
||||
order: 50,
|
||||
defaultVisible: false,
|
||||
defaultSize: "medium",
|
||||
supportedSizes: ["medium", "wide"],
|
||||
anyOf: campaignRead,
|
||||
refreshIntervalMs: 30_000,
|
||||
defaultConfiguration: {
|
||||
maxItems: 5,
|
||||
showCompleted: false
|
||||
},
|
||||
configurationFields: [
|
||||
{
|
||||
id: "maxItems",
|
||||
label: "Maximum campaigns",
|
||||
kind: "number",
|
||||
min: 1,
|
||||
max: 12,
|
||||
step: 1,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
id: "showCompleted",
|
||||
label: "Include completed campaigns",
|
||||
kind: "boolean"
|
||||
}
|
||||
],
|
||||
render: ({ settings, refreshKey, configuration }) =>
|
||||
createElement(CampaignActivityWidget, {
|
||||
settings,
|
||||
refreshKey,
|
||||
configuration
|
||||
})
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const campaignModule: PlatformWebModule = {
|
||||
id: "campaigns",
|
||||
@@ -25,6 +76,15 @@ export const campaignModule: PlatformWebModule = {
|
||||
dependencies: ["access"],
|
||||
optionalDependencies: ["files", "mail"],
|
||||
translations,
|
||||
viewSurfaces: [
|
||||
{
|
||||
id: "campaigns.widget.activity",
|
||||
moduleId: "campaigns",
|
||||
kind: "section",
|
||||
label: "Campaign activity widget",
|
||||
order: 50
|
||||
}
|
||||
],
|
||||
navItems: [
|
||||
{ to: "/campaigns", label: "i18n:govoplan-campaign.campaigns.01a23a28", iconName: "campaign", anyOf: campaignRead, order: 20 },
|
||||
{
|
||||
@@ -43,7 +103,10 @@ export const campaignModule: PlatformWebModule = {
|
||||
{ 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: ({ settings }) => createElement(AggregateReportsPage, { settings }) },
|
||||
{ path: "/templates", order: 90, render: () => createElement(TemplatesPage) }]
|
||||
{ path: "/templates", order: 90, render: () => createElement(TemplatesPage) }],
|
||||
uiCapabilities: {
|
||||
"dashboard.widgets": campaignDashboardWidgets
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user