Files
ApiCore/ApiCore-Frontend/src/lib/bottling/post-save-warnings.ts
T
Nick SzaunigandClaude Opus 5.5 7a1480138d fix: T4 browser-check findings, interval on season state, T6 plan refresh
- Honey batch create omits an empty batch number (was 400); product form
  labels the legacy total weight, detail shows jar weight and shelf life;
  bottling hints next to their fields, values cleared on product change,
  post-save water-content wording; withdraw reason placeholder not
  selectable; honey batch actions offline-disabled with reason, 44 px.
- Offline signal: one slow request no longer flips the app offline; two
  consecutive timeouts do, any HTTP answer clears it, aborts never count.
- Phenology sheet as a side card on desktop with focus return; confirm
  dialogs as alertdialog; step-up texts in du-form ("Das Passwort stimmt
  nicht."); backup import gives its disabled reason; missing event labels
  plus a guard test; profile buttons 44 px.
- GET /phenology/state returns intervalDays via the shared
  inspectionIntervalOf (autopilot, digest, season state use one source).
- T6 plan aligned with the code after T4, plus owner decisions of
  2026-10-15 (Berlin day for restrictions, COMPLIANCE category, override
  without step-up).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-15 12:47:08 +02:00

26 lines
951 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { PlausibilityWarning } from "@/lib/warnings/types";
import { formatWaterContent } from "./format";
import { WATER_CONTENT_ABOVE_LEGAL } from "./types";
/**
* The server words its warnings for the time before saving ("... Abfüllen nur
* mit Bestätigung."). After a confirmed save that text is out of date, so the
* confirmed finding is worded as the fact it now is.
*/
export function postSaveWarnings(
warnings: readonly PlausibilityWarning[],
confirmedWaterContent: number | null,
): PlausibilityWarning[] {
return warnings.map((warning) =>
warning.code === WATER_CONTENT_ABOVE_LEGAL
? {
...warning,
message:
confirmedWaterContent === null
? "Wassergehalt über der Grenze – mit Bestätigung abgefüllt."
: `Wassergehalt ${formatWaterContent(confirmedWaterContent)} über der Grenze – mit Bestätigung abgefüllt.`,
}
: warning,
);
}