ZettaKonsult/zetta-workspace

use rules to generate stuff

開放

#73 建立於 2018年1月11日

 (2 則留言) (0 個反應) (2 位負責人)JavaScript (0 個分叉)auto 404
enhancementhelp wanted

倉庫指標

星標
 (0 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南