show that hiding nested fields works as well

This commit is contained in:
burnettk 2023-02-03 15:47:35 -05:00
parent c3cb288875
commit 408759d122
3 changed files with 15 additions and 2 deletions

View File

@ -17,6 +17,14 @@
"veryImportantFieldButOnlySometimes": {
"title": "Very important field",
"type": "string"
},
"building": {
"properties": {
"floor": {
"title": "Floor",
"type": "number"
}
}
}
}
}

View File

@ -14,7 +14,7 @@
<bpmn:incoming>Flow_1my9ag5</bpmn:incoming>
<bpmn:outgoing>Flow_0b04rbg</bpmn:outgoing>
<bpmn:script>awesome_color_options = [{"value": "blue", "label": "Blue"}, {"value": "green", "label": "Green"}]
form_ui_hidden_fields = ["veryImportantFieldButOnlySometimes"]
form_ui_hidden_fields = ["veryImportantFieldButOnlySometimes", "building.floor"]
</bpmn:script>
</bpmn:scriptTask>
<bpmn:userTask id="Activity_1gqykqt" name="ask user for color">

View File

@ -1686,8 +1686,13 @@ class TestProcessApi(BaseTest):
response.json["form_schema"]["definitions"]["Color"]["anyOf"][1]["title"]
== "Green"
)
# if you set this in task data:
# form_ui_hidden_fields = ["veryImportantFieldButOnlySometimes", "building.floor"]
# you will get this ui schema:
assert response.json["form_ui_schema"] == {
"veryImportantFieldButOnlySometimes": {"ui:widget": "hidden"}
"building": {"floor": {"ui:widget": "hidden"}},
"veryImportantFieldButOnlySometimes": {"ui:widget": "hidden"},
}
def test_process_instance_list_with_default_list(