Description
Re-skin the instrument form to create a new experiment form that includes a new variants fieldset and excludes unneeded fields. The experiment form should be clearly branded as an experiment (i.e. remove references to "instrument").
Field to include:
- A
multi-valuesingle fieldset called Variants that includes the following fields:- Name - text input
- Type - select dropdown (string, number, boolean) << this can be removed from the frontend form if it saves time and just hardcode boolean but it's still sent in the api response
- Values - multi-value chip input
The variants fieldset should be saved to the database as a json value with the following structure:
{ "name": "color", "type": "string", "values": [ "red", "blue", "green ] }
For an example, see how this is done for sample rates in the instrument store.
Fields to exclude from the frontend form:
- Type
- Schema type/stream name
- Contextual Attributes
As noted in T373467#10125438, we should make these frontend excluded fields optional in the database since for now instruments and experiments live in the same table.
Acceptance Criteria
- New fieldset is created from existing Codex components
- Experiment form saves data correctly to the database
- Ensure variants json value is serialized correctly when saving to database
- Make excluded fields optional in the database (Done in T373465: MPIC: Update instruments table to include variants json column)
Required
- Unit/Integration tests?
- Documentation?
- Passed QA?