mitai-jinkendo/frontend/src/widgetSystem/bodyChartDays.js
Lars c0c512e942
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
feat: Revamp KPI board configuration and validation
- 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.
2026-04-07 12:46:18 +02:00

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