Refactor Experiment components to support new experiment book structure

- Updated ExperimentForm to handle additional phase parameters and improved initial state management.
- Modified ExperimentModal to fetch experiment data with phase configuration and ensure unique experiment numbers within the same phase.
- Renamed references from "phases" to "books" across ExperimentPhases, PhaseExperiments, and related components for consistency with the new terminology.
- Enhanced error handling and validation for new shelling parameters in ExperimentForm.
- Updated Supabase interface definitions to reflect changes in experiment and phase data structures.
This commit is contained in:
salirezav
2026-03-09 12:43:23 -04:00
parent 38a7846e7b
commit 0a2b24fdbf
14 changed files with 899 additions and 92 deletions

View File

@@ -0,0 +1,9 @@
-- Add experiment-level shelling parameters (defaults for repetitions)
-- These match the shelling table attributes: ring_gap_inches, drum_rpm
ALTER TABLE public.experiments
ADD COLUMN IF NOT EXISTS ring_gap_inches NUMERIC(6,2) CHECK (ring_gap_inches IS NULL OR ring_gap_inches > 0),
ADD COLUMN IF NOT EXISTS drum_rpm INTEGER CHECK (drum_rpm IS NULL OR drum_rpm > 0);
COMMENT ON COLUMN public.experiments.ring_gap_inches IS 'Default space (inches) between sheller rings for this experiment';
COMMENT ON COLUMN public.experiments.drum_rpm IS 'Default sheller drum revolutions per minute for this experiment';