Open JamesPHoughton opened 1 month ago
Will we be able to use the same zod schema to validate the forms as we use to validate the YAML? this would save us the effort of maintaining two schemas if we decide to change the format at all. This may mean that we build up the schema for the whole YAML from smaller schemas. I have started a draft schema for the yaml as a whole here https://github.com/Watts-Lab/deliberation-empirica/blob/main/server/src/preFlight/validateTreatmentFile.ts: , although it is not complete or correct. I can work on that a bit this week.
In the long run, I'd prefer to have one set of zod schemas for validating treatments that lives in the deliberation-empirica repo, that we can import here and reuse. We are already importing some things from that library in Kimberly's code, so once we get that merged, there will be a good example for how to do that.
Also: https://github.com/Watts-Lab/researcher-portal/issues/44
We will touch base wednesday to show this off
The only thing left is to merge everything and test
Description:
The goal of this issue is to refactor our current form implementation in the AddPopup component to use React Hook Form. React Hook Form is a performant, flexible and extensible form solution, which will help us to simplify our form logic and improve the user experience.
Acceptance Criteria:
Tasks: