ZettaKonsult/zetta-workspace

use rules to generate stuff

Aberta

#73 aberto em 11 de jan. de 2018

 (2 comentários) (0 reação) (2 responsáveis)JavaScript (0 fork)auto 404
enhancementhelp wanted

Métricas do repositório

Stars
 (0 estrela)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

rules contain a lot of information from this it should be possible to dynamically generate a form that makes sense for the given case.

{ id: string, name: string, group: string, attribute: enum[label, id], key: string, func: enum[only, lessThan, moreThan, none, atMost, atLeast], value: string, error: string }

a rule like this could return an object like

{ label: "nation", - name of the group if it contains one, not used for singel required plans options: [], - id to the plans that you can choose from obligatory: number, - number of obligatory number of plans if any variable: boolean - to indicate if the ui should account for the user adding or removing plans }

options.length === 1 && obligatory === 1 could then be rendered as a disabled field

label && options > 1 && obligatory > 1 && variable could then be rendered right away as 2 selects with the option to add more but not remove below 2 fields

Don't know if this should be accomplished by just writing a lot of boilerplate or if there is some cool way of doing this.

Guia do colaborador