48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
|
|
/**
|
||
|
|
* Pilot/Lab-Widgets registrieren. IDs müssen zu backend/widget_catalog.WIDGET_CATALOG passen.
|
||
|
|
*/
|
||
|
|
import PilotWelcome from '../components/pilot/PilotWelcome'
|
||
|
|
import PilotQuickCapture from '../components/pilot/PilotQuickCapture'
|
||
|
|
import PilotKpiBoard from '../components/pilot/PilotKpiBoard'
|
||
|
|
import PilotBodySection from '../components/pilot/PilotBodySection'
|
||
|
|
import PilotActivitySection from '../components/pilot/PilotActivitySection'
|
||
|
|
import { registerDashboardWidget } from './dashboardWidgetRegistry'
|
||
|
|
|
||
|
|
let _registered = false
|
||
|
|
|
||
|
|
export function ensurePilotLabWidgetsRegistered() {
|
||
|
|
if (_registered) return
|
||
|
|
_registered = true
|
||
|
|
|
||
|
|
registerDashboardWidget({
|
||
|
|
id: 'welcome',
|
||
|
|
Component: PilotWelcome,
|
||
|
|
mapProps: () => ({}),
|
||
|
|
})
|
||
|
|
registerDashboardWidget({
|
||
|
|
id: 'quick_capture',
|
||
|
|
Component: PilotQuickCapture,
|
||
|
|
mapProps: (ctx) => ({ onSaved: ctx.requestRefresh }),
|
||
|
|
})
|
||
|
|
registerDashboardWidget({
|
||
|
|
id: 'kpi_board',
|
||
|
|
Component: PilotKpiBoard,
|
||
|
|
mapProps: (ctx) => ({ refreshTick: ctx.refreshTick }),
|
||
|
|
})
|
||
|
|
registerDashboardWidget({
|
||
|
|
id: 'body_overview',
|
||
|
|
Component: PilotBodySection,
|
||
|
|
mapProps: (ctx) => ({ refreshTick: ctx.refreshTick }),
|
||
|
|
})
|
||
|
|
registerDashboardWidget({
|
||
|
|
id: 'activity_overview',
|
||
|
|
Component: PilotActivitySection,
|
||
|
|
mapProps: (ctx) => ({ refreshTick: ctx.refreshTick }),
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
/** @internal Nur für Tests */
|
||
|
|
export function __resetPilotLabRegistrationForTests() {
|
||
|
|
_registered = false
|
||
|
|
}
|