Skip to content

Add validation to modules fields #56

@dtoki

Description

@dtoki

Related to: commitdev/zero#226

Which one of these formats should we pick for passing validation from the modules? leaning towards option 1.

// option1
- field: productionHostRoot
  label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
  fieldValidation:
    - type: regex
    - value: '^\d{3}-\d{2}-\d{4}$'


- field: productionHostRoot
  label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
  fieldValidation:
    - type: function
    - value: function_name_goes_here

VS

// option 2
- field: productionHostRoot
  label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
  pattern: regex_goes_here

- field: productionHostRoot
  label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
  validationFunction: function_name_goes_here

cc @davidcheung cc @bmonkman

Metadata

Metadata

Assignees

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