type in a name only (or alternatively type in a description only)
result: the [ save ] button is enabled
expected result: the [ save ] button should be disabled
NOTES:
a sample type requires a name a description.
the line of code: (see SampeTypeDefinitionForm.jsx => line 105)
==> setDisableSubmit(!(!!sampleTypeName || !!sampleTypeDescription));
should at minimum be
==> setDisableSubmit(!sampleTypeName || !sampleTypeDescription); // if either is 'false' then disable submit
HOWEVER, Note that the backend also removes leading and trailing spaces in the name and description, so we should also check
==> setDisableSubmit(!sampleTypeName.trim() || !sampleTypeDescription.trim()); // if the trimmed value of either is false then disable submit
repro:
go to http://localhost:3000
login
go to http://localhost:3000/sample_types/new result: the [ save ] button is grayed out
type in a name only (or alternatively type in a description only) result: the [ save ] button is enabled expected result: the [ save ] button should be disabled
NOTES: a sample type requires a name a description.
the line of code: (see SampeTypeDefinitionForm.jsx => line 105) ==> setDisableSubmit(!(!!sampleTypeName || !!sampleTypeDescription));
should at minimum be ==> setDisableSubmit(!sampleTypeName || !sampleTypeDescription); // if either is 'false' then disable submit
HOWEVER, Note that the backend also removes leading and trailing spaces in the name and description, so we should also check ==> setDisableSubmit(!sampleTypeName.trim() || !sampleTypeDescription.trim()); // if the trimmed value of either is false then disable submit