Lunatic icon indicating copy to clipboard operation
Lunatic copied to clipboard

DRAFT: add conditionFilter on lists

Open Grafikart opened this issue 1 year ago • 1 comments

This is a DRAFT that serves as a proof of concept on how to handle filter in list for various component in Lunatic

Bowie Issue https://github.com/InseeFr/Bowie/issues/52

CheckboxGroup

For checkbox group we could add a new conditionFilter for every response in responses

{
	"id": "new_id_4",
	"label": {
		"value": "\"Vous étiez à la retraite ou proche de la retraite\"",
		"type": "VTL"
	},
+	"conditionFilter": { "value": "cast(AGE, number) >= 50", "type": "VTL" },
	"response": { "name": "CHECK6" }
},

CheckboxOne / Radio / Dropdown

For unique checkbox / radio we could add a new conditionFilter for every option in options

{
  "id": "check6",
  "label": {
    "value": "\"Vous étiez à la retraite ou proche de la retraite\"",
    "type": "VTL"
  },
+ "conditionFilter": {
+   "value": "cast(AGE, number) >= 50",
+   "type": "VTL"
+ },
  "value": "CHECK6"
},

Grafikart avatar Nov 09 '23 20:11 Grafikart