All checks were successful
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m13s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 15s
Workspace beantwortet die Leitfrage mit prominenten Next-Action- und Heute-Widgets sowie erweitertem Steuerungszustand pro Vorhaben. Co-authored-by: Cursor <cursoragent@cursor.com>
112 lines
3.4 KiB
JavaScript
112 lines
3.4 KiB
JavaScript
import { MyOpenActionsWidget } from '../widgets/MyOpenActionsWidget.jsx'
|
|
import { InitiativesWidget } from '../widgets/InitiativesWidget.jsx'
|
|
import { BlockedActionsWidget } from '../widgets/BlockedActionsWidget.jsx'
|
|
import { TenantContextWidget } from '../widgets/TenantContextWidget.jsx'
|
|
import { WorkspaceSummaryWidget } from '../widgets/WorkspaceSummaryWidget.jsx'
|
|
import { AttentionWidget } from '../widgets/AttentionWidget.jsx'
|
|
import { NextActionWidget } from '../widgets/NextActionWidget.jsx'
|
|
import { WorkspaceTodayWidget } from '../widgets/WorkspaceTodayWidget.jsx'
|
|
|
|
/** @typedef {import('react').ComponentType<any>} WidgetComponent */
|
|
|
|
/**
|
|
* @typedef {Object} WidgetDefinition
|
|
* @property {string} key
|
|
* @property {string} title
|
|
* @property {string} [description]
|
|
* @property {string} area
|
|
* @property {string} [requiredCapability]
|
|
* @property {number} defaultOrder
|
|
* @property {WidgetComponent} component
|
|
*/
|
|
|
|
/** @type {WidgetDefinition[]} */
|
|
export const WIDGETS = [
|
|
{
|
|
key: 'kairo.tenant_context',
|
|
title: 'Kontext',
|
|
description: 'Aktiver Tenant und Actor',
|
|
area: 'workspace',
|
|
defaultOrder: 0,
|
|
component: TenantContextWidget,
|
|
},
|
|
{
|
|
key: 'kairo.next_actions',
|
|
title: 'Nächste Schritte',
|
|
description: 'Regelbasierte NextAction-Empfehlungen',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.workspace.read',
|
|
defaultOrder: 2,
|
|
component: NextActionWidget,
|
|
},
|
|
{
|
|
key: 'kairo.workspace_today',
|
|
title: 'Heute',
|
|
description: 'Meine Maßnahmen — überfällig zuerst',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.workspace.read',
|
|
defaultOrder: 4,
|
|
component: WorkspaceTodayWidget,
|
|
},
|
|
{
|
|
key: 'kairo.workspace_summary',
|
|
title: 'Überblick',
|
|
description: 'Workspace-Kennzahlen aus Data Layer',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.workspace.read',
|
|
defaultOrder: 5,
|
|
component: WorkspaceSummaryWidget,
|
|
},
|
|
{
|
|
key: 'kairo.attention',
|
|
title: 'Aufmerksamkeit',
|
|
description: 'Regelbasierte Attention-Items',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.workspace.read',
|
|
defaultOrder: 8,
|
|
component: AttentionWidget,
|
|
},
|
|
{
|
|
key: 'kairo.my_open_actions',
|
|
title: 'Meine offenen Maßnahmen',
|
|
description: 'Offene Maßnahmen, die mir zugewiesen sind',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.action.read',
|
|
defaultOrder: 25,
|
|
component: MyOpenActionsWidget,
|
|
},
|
|
{
|
|
key: 'kairo.blocked_actions',
|
|
title: 'Blockierte Maßnahmen',
|
|
description: 'Mir zugewiesene blockierte Maßnahmen',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.action.read',
|
|
defaultOrder: 35,
|
|
component: BlockedActionsWidget,
|
|
},
|
|
{
|
|
key: 'kairo.active_initiatives',
|
|
title: 'Aktive Vorhaben',
|
|
description: 'Aktive und pausierte Vorhaben im Tenant',
|
|
area: 'workspace',
|
|
requiredCapability: 'kairo.initiative.read',
|
|
defaultOrder: 40,
|
|
component: InitiativesWidget,
|
|
},
|
|
]
|
|
|
|
/**
|
|
* @param {string} area
|
|
* @param {Set<string>|string[]} capabilities
|
|
*/
|
|
export function getWidgetsForArea(area, capabilities) {
|
|
const capSet = capabilities instanceof Set ? capabilities : new Set(capabilities)
|
|
return WIDGETS.filter((w) => w.area === area)
|
|
.filter((w) => !w.requiredCapability || capSet.has(w.requiredCapability))
|
|
.sort((a, b) => a.defaultOrder - b.defaultOrder)
|
|
}
|
|
|
|
export function getWidgetByKey(key) {
|
|
return WIDGETS.find((w) => w.key === key)
|
|
}
|