ZettaKonsult/zetta-workspace

use rules to generate stuff

Open

#73 opened on Jan 11, 2018

 (2 comments) (0 reactions) (2 assignees)JavaScript (0 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (0 stars)
PR merge metrics
 (PR metrics pending)

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.

Contributor guide