- Enhanced the KPI board widget to support tile configuration, allowing users to select and order tiles. - Updated validation logic to ensure proper handling of tile IDs and configuration fields. - Removed legacy chart_days support, transitioning to a fixed analysis window for KPI metrics. - Improved the DashboardLabPage to integrate the new KpiBoardConfigEditor for managing tile selections. - Bumped app_dashboard version to 1.5.0 to reflect these significant changes.
14 lines
558 B
JavaScript
14 lines
558 B
JavaScript
/** Körper-/Aktivitäts-Chart: gültiger Bereich (sync mit backend dashboard_widget_config). */
|
|
export const BODY_CHART_DAYS_MIN = 7
|
|
export const BODY_CHART_DAYS_MAX = 90
|
|
export const BODY_CHART_DAYS_DEFAULT = 30
|
|
|
|
export function normalizeBodyChartDays(raw) {
|
|
const n = Number(raw)
|
|
if (!Number.isFinite(n)) return BODY_CHART_DAYS_DEFAULT
|
|
return Math.min(BODY_CHART_DAYS_MAX, Math.max(BODY_CHART_DAYS_MIN, Math.round(n)))
|
|
}
|
|
|
|
/** KPI-Board Ø-Kalorien: festes Analysefenster (nicht mehr über Layout-Config). */
|
|
export const KPI_KCAL_WINDOW_DEFAULT = 7
|