Follow-up from "fix: add dynamic validationSchema for FieldCode component"

The following discussions from !84 should be addressed:

  • @cedric.dupuis started a discussion: (+1 comment)

    NB: It's the first time we do field level validation.

    To me there are two levels of validation:

    • the form level, which is supposed to check data model
    • the field level, which is supposed to check basic consistency

    You clearly implemented a field level consistency validation here, so I'd recommend you just use it on your field instead of exporting it.

    Maybe just add a prop to your component to disable this field validation (noValidate for example) if it seems useful, but I think we always want to do this check as that's the point of your component

    see https://jaredpalmer.com/formik/docs/guides/validation#field-level-validation

  • @cedric.dupuis started a discussion:

    You have a length parameter inside your component but you only really handle layout with 6 elements.

    You could a prop gapIndex which is by default length / 2 ?

    Capture_du_2019-10-15_10-04-08

    That's defo a follow-up feature