holos-run / holos

Holos - The Holistic platform manager
https://holos.run
Apache License 2.0
1 stars 0 forks source link

Fix FormGroup #161

Closed jeffmccune closed 4 months ago

jeffmccune commented 4 months ago

In #150 we added multiple form sections. The way we did this breaks Formly validation.

We must tie only one <form> to one formGroup as all of the formly examples do.

Refactor to use fieldGroup

jeffmccune commented 4 months ago

This is the correct way to do it: https://formly.dev/docs/examples/other/nested-formly-forms

  fields: FormlyFieldConfig[] = [
    {
      key: 'firstName',
      type: 'input',
      props: {
        required: true,
        type: 'text',
        label: 'First Name',
      },
    },
    {
      key: 'address',
      wrappers: ['panel'],
      props: { label: 'Address' },
      fieldGroup: [
        {
          key: 'town',
          type: 'input',
          props: {
            required: true,
            type: 'text',
            label: 'Town',
          },
        },
      ],
    },
  ];