Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3313

Improve validation capabilities of the multi fields

XMLWordPrintable

    • Basel 20
    • 8

      Quoting awedermp on cloned ticket:

      I see some need to make it easier to make all fields of a composite field required, though I'm not sure this goes in the right direction.

      Below I'm looking at these questions:

      • What does it mean, if we mark a composite field as required?
      • How do we indicate, if validation fails of at least one of its fields?
      • How do we visually mark a composite field as "required"?

      I see three possible interpretations for it could mean to mark a composite field as "required":

      1. if a composite field is marked as "required", all its fields must have a value
      2. if a composite field is marked as "required", at least one of its fields requires a value
      3. if a composite field is marked as "required", at exactly one of its fields requires a value

      We don't have to necessarily build all these cases, but we should make sure they remain possible, if we implement a shortcut.

      As for showing a message on validation failure, I agree with @Topher: yes, we absolutely need that. In all cases, we should be fine by showing an error message on composite field level. I'd prefer if we could also show a message on the field level, if I have to indicate that one or several fields are missing. However, I would expect such a solution to become rather complex, as the good placement of this largely on form layout and field types.

      Visually, we don't have a design for that, but I'd show such a messages on composite field level the same way as we currently do it for any other field. Just show it below the composite field with an arrow pointing towards it, but make sure we can show multiple lines:

         First name is required. 
         Last name is required.
      

      As for how we should indicate if all fields of a composite fields are required, we could set the mark on either the composite field itself or on all its fields. We should be fine for both cases mentioned above if we just mark the composite field as "required", though. Again - and strictly speaking -, this actually depends a lot on the form layout and the complexity of the composite field. If a composite field spreads its field across multiple lines, it would be clearer to mark each individual field as "required". But I think we'll be fine if we just mark the composite as "required".

        Acceptance criteria

          1. composite-error.png
            33 kB
            Federico Grilli
          2. CompositeField-Required.jpg
            185 kB
            Mikaël Geljić
          3. Design - Field with error.png
            304 kB
            Andreas Weder
          4. no-validation-indicator-on-required-composite-field.png
            278 kB
            Mikaël Geljić
          5. switchable-validation-error.png
            446 kB
            Federico Grilli

              fgrilli Federico Grilli
              mgeljic Mikaël Geljić
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 1.25d
                    1.25d