Skip to content

Expand form options to support dependent fields #7

@MikeCarbone

Description

@MikeCarbone

We need flexibility to discern whether this field is available only on hidden or dependent.

maybe

form: {
  hidden: true 
  // or
  hidden: {
    on_create: true | false,
    on_update: true | false,
    true_if_key_present: ['key1', 'key2'],
    true_if_values: {
      'key1': {
        equals: 2 // only hide the field if this field is equal to this
      }
   }
  }
}

We also need to be able to support strings:

form: {
  label: true 
  // or
  label: {
    on_create: string,
    on_update: string,
    dependent_keys: {
      'key1': {
        equals: 2 // only hide the field if this field is equal to this,
        value: "when key1 has a value of 2 you must bla bla",
        // also support qualifying fields too
        is_present: true | false,
        is_empty: true | false,
      }
   }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions