From d3eef77c030789de782b57ae115cd4c0c8e66fc5 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 6 Jul 2019 07:18:32 +0200 Subject: [PATCH] works with test/auto tests --- tests/dict/data/boolean1.json | 19 +++ tests/dict/data/boolean1_frozen.json | 19 +++ tests/dict/data/choice1.json | 17 +++ tests/dict/data/choice1_frozen.json | 17 +++ tests/dict/data/choice1_leadership.json | 20 ++++ .../dict/data/choice1_leadership_hidden.json | 23 +++- tests/dict/data/choice1_leadership_value.json | 20 ++++ tests/dict/data/choice1_multi.json | 17 +++ tests/dict/data/choice1_rename.json | 17 +++ tests/dict/data/choice1_requires.json | 28 ++++- tests/dict/data/date1.json | 20 ++++ tests/dict/data/date1_frozen.json | 20 ++++ tests/dict/data/filename1.json | 17 +++ tests/dict/data/hostname1.json | 20 ++++ tests/dict/data/ip1.json | 19 ++- tests/dict/data/ip1_frozen.json | 19 ++- tests/dict/data/mail1.json | 17 +++ tests/dict/data/number1.json | 17 +++ tests/dict/data/number1_frozen.json | 17 +++ tests/dict/data/number1_mod_value.json | 16 +++ tests/dict/data/number1_value.json | 16 +++ tests/dict/data/unicode1.json | 17 +++ tests/dict/data/unicode1_frozen.json | 17 +++ .../unicode1_leader_hidden_followers.json | 22 +++- tests/dict/data/unicode1_leadership.json | 20 ++++ .../unicode1_leadership_default_value.json | 20 +++- .../dict/data/unicode1_leadership_hidden.json | 23 +++- ...nicode1_leadership_hidden_all_default.json | 20 ++++ .../data/unicode1_leadership_not_equal.json | 44 +++++-- .../data/unicode1_leadership_requires.json | 20 ++++ .../unicode1_leadership_requires_all.json | 28 ++++- ...unicode1_leadership_requires_follower.json | 19 +++ ...e1_leadership_requires_follower_value.json | 20 ++++ ...nicode1_leadership_requires_followers.json | 19 +++ .../unicode1_leadership_requires_leader.json | 28 ++++- .../unicode1_leadership_requires_value.json | 21 ++++ .../data/unicode1_leadership_submulti.json | 20 ++++ .../dict/data/unicode1_leadership_value.json | 20 +++- tests/dict/data/unicode1_mandatory.json | 17 +++ tests/dict/data/unicode1_mod_value.json | 17 +++ tests/dict/data/unicode1_multi.json | 17 +++ tests/dict/data/unicode1_multi_hidden.json | 19 ++- tests/dict/data/unicode1_multi_mandatory.json | 17 +++ tests/dict/data/unicode1_multi_mod_value.json | 16 +++ .../unicode1_multi_not_equal_collapse.json | 104 ++++++++++------ tests/dict/data/unicode1_multi_requires.json | 19 +++ tests/dict/data/unicode1_multi_value.json | 16 +++ tests/dict/data/unicode1_not_equal.json | 42 +++++-- .../unicode1_optiondescription_requires.json | 31 ++++- tests/dict/data/unicode1_requires.json | 19 +++ tests/dict/data/unicode1_simple_callback.json | 20 +++- tests/dict/data/unicode2.json | 18 +++ tests/dict/data/unicode2_copy.json | 21 +++- tests/dict/data/unicode2_multi_copy.json | 21 +++- tests/dict/data/unicode2_symlink.json | 16 +++ tests/dict/data/unicode_hidden.json | 17 +++ tests/dict/data/unicode_property.json | 17 +++ .../unicode_property_optiondescription.json | 17 +++ tests/dict/data/username1.json | 17 +++ tests/dict/data/username1_frozen.json | 17 +++ tests/dict/test_json.py | 27 ++++- tests/test_requires.py | 15 +-- tiramisu/locale/fr/LC_MESSAGES/tiramisu.po | 2 +- tiramisu/todict.py | 113 ++++++++++-------- 64 files changed, 1293 insertions(+), 152 deletions(-) diff --git a/tests/dict/data/boolean1.json b/tests/dict/data/boolean1.json index 1299cd5..d447dc0 100644 --- a/tests/dict/data/boolean1.json +++ b/tests/dict/data/boolean1.json @@ -12,7 +12,26 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { + "options.boolean": { + "clearable": true + }, "null": [ { "title": "Configurer", diff --git a/tests/dict/data/boolean1_frozen.json b/tests/dict/data/boolean1_frozen.json index 94999ae..a2f4441 100644 --- a/tests/dict/data/boolean1_frozen.json +++ b/tests/dict/data/boolean1_frozen.json @@ -16,7 +16,26 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { + "options.boolean": { + "clearable": true + }, "null": [ { "title": "Configurer", diff --git a/tests/dict/data/choice1.json b/tests/dict/data/choice1.json index 39e324e..8c0b368 100644 --- a/tests/dict/data/choice1.json +++ b/tests/dict/data/choice1.json @@ -17,8 +17,25 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice": { + "clearable": true, "type": "choice" }, "null": [ diff --git a/tests/dict/data/choice1_frozen.json b/tests/dict/data/choice1_frozen.json index feb73ef..5b5d65a 100644 --- a/tests/dict/data/choice1_frozen.json +++ b/tests/dict/data/choice1_frozen.json @@ -21,8 +21,25 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice": { + "clearable": true, "type": "choice" }, "null": [ diff --git a/tests/dict/data/choice1_leadership.json b/tests/dict/data/choice1_leadership.json index b29bba2..aab3085 100644 --- a/tests/dict/data/choice1_leadership.json +++ b/tests/dict/data/choice1_leadership.json @@ -57,17 +57,37 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice1.choice1": { + "clearable": true, "type": "choice" }, "options.choice1.choice2": { + "clearable": true, "type": "choice" }, "options.choice1.choice3": { + "clearable": true, "type": "choice" }, "options.choice1.choice4": { + "clearable": true, "type": "choice" }, "null": [ diff --git a/tests/dict/data/choice1_leadership_hidden.json b/tests/dict/data/choice1_leadership_hidden.json index 3a0ad9b..9fc67d9 100644 --- a/tests/dict/data/choice1_leadership_hidden.json +++ b/tests/dict/data/choice1_leadership_hidden.json @@ -58,22 +58,41 @@ }, "options.choice1.choice3": { "null": { - "display": false, - "hidden": true + "display": false } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice1.choice1": { + "clearable": true, "type": "choice" }, "options.choice1.choice2": { + "clearable": true, "type": "choice" }, "options.choice1.choice3": { + "clearable": true, "type": "choice" }, "options.choice1.choice4": { + "clearable": true, "type": "choice" }, "null": [ diff --git a/tests/dict/data/choice1_leadership_value.json b/tests/dict/data/choice1_leadership_value.json index 1a0e3ac..d2a52d2 100644 --- a/tests/dict/data/choice1_leadership_value.json +++ b/tests/dict/data/choice1_leadership_value.json @@ -67,17 +67,37 @@ } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice1.choice1": { + "clearable": true, "type": "choice" }, "options.choice1.choice2": { + "clearable": true, "type": "choice" }, "options.choice1.choice3": { + "clearable": true, "type": "choice" }, "options.choice1.choice4": { + "clearable": true, "type": "choice" }, "null": [ diff --git a/tests/dict/data/choice1_multi.json b/tests/dict/data/choice1_multi.json index 155780f..fa1922f 100644 --- a/tests/dict/data/choice1_multi.json +++ b/tests/dict/data/choice1_multi.json @@ -21,8 +21,25 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice": { + "clearable": true, "type": "choice" }, "null": [ diff --git a/tests/dict/data/choice1_rename.json b/tests/dict/data/choice1_rename.json index ff6ce41..fbcb0ba 100644 --- a/tests/dict/data/choice1_rename.json +++ b/tests/dict/data/choice1_rename.json @@ -17,8 +17,25 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice": { + "clearable": true, "type": "choice", "displayed": { "choice 1": "renamed 1", diff --git a/tests/dict/data/choice1_requires.json b/tests/dict/data/choice1_requires.json index 49166a4..310582a 100644 --- a/tests/dict/data/choice1_requires.json +++ b/tests/dict/data/choice1_requires.json @@ -4,11 +4,11 @@ "properties": { "options.choice": { "type": "choice", - "value": "hide", "enum": [ "hide", "show" ], + "value": "hide", "title": "Choice description" }, "options.unicode2": { @@ -27,9 +27,26 @@ "owner": "default" }, "options.unicode2": { + "display": false, "hidden": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.choice": { "clearable": true, @@ -41,13 +58,13 @@ ] }, "expected": { - "hide": { - "hide": [ + "show": { + "show": [ "options.unicode2" ] }, - "show": { - "show": [ + "hide": { + "hide": [ "options.unicode2" ] } @@ -55,6 +72,7 @@ } }, "options.unicode2": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/date1.json b/tests/dict/data/date1.json index 1250b71..c73589c 100644 --- a/tests/dict/data/date1.json +++ b/tests/dict/data/date1.json @@ -12,7 +12,27 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { + "options.date": { + "clearable": true, + "remote": true + }, "null": [ { "title": "Configurer", diff --git a/tests/dict/data/date1_frozen.json b/tests/dict/data/date1_frozen.json index d14ae5f..2e78f6a 100644 --- a/tests/dict/data/date1_frozen.json +++ b/tests/dict/data/date1_frozen.json @@ -16,7 +16,27 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { + "options.date": { + "clearable": true, + "remote": true + }, "null": [ { "title": "Configurer", diff --git a/tests/dict/data/filename1.json b/tests/dict/data/filename1.json index 6fb9c0f..3e60209 100644 --- a/tests/dict/data/filename1.json +++ b/tests/dict/data/filename1.json @@ -10,8 +10,25 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "usbpath": { + "clearable": true, "pattern": "^[a-zA-Z0-9\\-\\._~/+]+$", "type": "input" }, diff --git a/tests/dict/data/hostname1.json b/tests/dict/data/hostname1.json index 6e7c203..e9a064d 100644 --- a/tests/dict/data/hostname1.json +++ b/tests/dict/data/hostname1.json @@ -24,20 +24,40 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.hostname1": { + "clearable": true, "pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$", "type": "input" }, "options.hostname2": { + "clearable": true, "pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$", "type": "input" }, "options.hostname3": { + "clearable": true, "pattern": "^(?:((?!-)[a-z0-9-]{1,63})|(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$", "type": "input" }, "options.hostname4": { + "clearable": true, "pattern": "^((?!-)[a-z0-9-]{1,15})$", "type": "input" }, diff --git a/tests/dict/data/ip1.json b/tests/dict/data/ip1.json index 63770f2..6fb43f4 100644 --- a/tests/dict/data/ip1.json +++ b/tests/dict/data/ip1.json @@ -12,9 +12,26 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.ip": { - "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", + "clearable": true, + "remote": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/ip1_frozen.json b/tests/dict/data/ip1_frozen.json index f6f1f6a..e6f922e 100644 --- a/tests/dict/data/ip1_frozen.json +++ b/tests/dict/data/ip1_frozen.json @@ -16,9 +16,26 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.ip": { - "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", + "clearable": true, + "remote": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/mail1.json b/tests/dict/data/mail1.json index 4ea15c9..85408b6 100644 --- a/tests/dict/data/mail1.json +++ b/tests/dict/data/mail1.json @@ -12,8 +12,25 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.mail": { + "clearable": true, "pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$", "type": "input" }, diff --git a/tests/dict/data/number1.json b/tests/dict/data/number1.json index 788167b..8831a69 100644 --- a/tests/dict/data/number1.json +++ b/tests/dict/data/number1.json @@ -12,8 +12,25 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.integer": { + "clearable": true, "pattern": "^[0-9]+$", "type": "input" }, diff --git a/tests/dict/data/number1_frozen.json b/tests/dict/data/number1_frozen.json index 5da6f60..527200c 100644 --- a/tests/dict/data/number1_frozen.json +++ b/tests/dict/data/number1_frozen.json @@ -16,8 +16,25 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.integer": { + "clearable": true, "pattern": "^[0-9]+$", "type": "input" }, diff --git a/tests/dict/data/number1_mod_value.json b/tests/dict/data/number1_mod_value.json index 3a435f3..3c6eb5f 100644 --- a/tests/dict/data/number1_mod_value.json +++ b/tests/dict/data/number1_mod_value.json @@ -18,6 +18,22 @@ "owner": "user" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.integer": { "clearable": true, diff --git a/tests/dict/data/number1_value.json b/tests/dict/data/number1_value.json index 66d33ca..ba272ea 100644 --- a/tests/dict/data/number1_value.json +++ b/tests/dict/data/number1_value.json @@ -18,6 +18,22 @@ "owner": "default" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.integer": { "clearable": true, diff --git a/tests/dict/data/unicode1.json b/tests/dict/data/unicode1.json index 0f597f7..a9c7427 100644 --- a/tests/dict/data/unicode1.json +++ b/tests/dict/data/unicode1.json @@ -12,8 +12,25 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_frozen.json b/tests/dict/data/unicode1_frozen.json index 2e05be4..c287664 100644 --- a/tests/dict/data/unicode1_frozen.json +++ b/tests/dict/data/unicode1_frozen.json @@ -16,8 +16,25 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leader_hidden_followers.json b/tests/dict/data/unicode1_leader_hidden_followers.json index 31a820b..c7a41ab 100644 --- a/tests/dict/data/unicode1_leader_hidden_followers.json +++ b/tests/dict/data/unicode1_leader_hidden_followers.json @@ -35,22 +35,42 @@ }, "model": { "options.unicode.unicode": { - "display": false, "required": true, + "display": false, "hidden": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership.json b/tests/dict/data/unicode1_leadership.json index 63c2acc..2cfeee0 100644 --- a/tests/dict/data/unicode1_leadership.json +++ b/tests/dict/data/unicode1_leadership.json @@ -38,17 +38,37 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_default_value.json b/tests/dict/data/unicode1_leadership_default_value.json index a4e359a..1869865 100644 --- a/tests/dict/data/unicode1_leadership_default_value.json +++ b/tests/dict/data/unicode1_leadership_default_value.json @@ -20,7 +20,7 @@ }, "options.unicode.unicode2": { "type": "string", - "default": "follower2", + "defaultmulti": "follower2", "isMulti": true, "title": "Unicode follower 2 with default multi" }, @@ -58,12 +58,29 @@ } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { @@ -71,6 +88,7 @@ "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_hidden.json b/tests/dict/data/unicode1_leadership_hidden.json index 2f328bd..607e16a 100644 --- a/tests/dict/data/unicode1_leadership_hidden.json +++ b/tests/dict/data/unicode1_leadership_hidden.json @@ -54,22 +54,41 @@ "hidden": true }, "null": { - "display": false, - "hidden": true + "display": false } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_hidden_all_default.json b/tests/dict/data/unicode1_leadership_hidden_all_default.json index 55f5f57..c790dd7 100644 --- a/tests/dict/data/unicode1_leadership_hidden_all_default.json +++ b/tests/dict/data/unicode1_leadership_hidden_all_default.json @@ -37,17 +37,37 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "options.unicode1.unicode1": { + "clearable": true, "type": "input" }, "options.unicode1.unicode2": { + "clearable": true, "type": "input" }, "options.unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_not_equal.json b/tests/dict/data/unicode1_leadership_not_equal.json index d3e4ea5..3fd5dcf 100644 --- a/tests/dict/data/unicode1_leadership_not_equal.json +++ b/tests/dict/data/unicode1_leadership_not_equal.json @@ -38,28 +38,52 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "options.unicode.unicode3" - ] - } + "not_equal": [ + { + "options": [ + "options.unicode.unicode3" + ] + } + ] }, "options.unicode.unicode3": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "options.unicode.unicode2" - ] - } + "not_equal": [ + { + "options": [ + "options.unicode.unicode2" + ] + } + ] }, "null": [ { diff --git a/tests/dict/data/unicode1_leadership_requires.json b/tests/dict/data/unicode1_leadership_requires.json index 82f4d6d..78380d5 100644 --- a/tests/dict/data/unicode1_leadership_requires.json +++ b/tests/dict/data/unicode1_leadership_requires.json @@ -38,14 +38,33 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -63,6 +82,7 @@ } }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_requires_all.json b/tests/dict/data/unicode1_leadership_requires_all.json index 82bf6a7..fb14b9e 100644 --- a/tests/dict/data/unicode1_leadership_requires_all.json +++ b/tests/dict/data/unicode1_leadership_requires_all.json @@ -34,17 +34,36 @@ }, "model": { "options.unicode1": { + "display": false, "properties": [ "hidden" - ], - "hidden": true + ] }, "options.unicode1.unicode1": { - "required": true + "required": true, + "hidden": true, + "display": false } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -62,12 +81,15 @@ } }, "options.unicode1.unicode1": { + "clearable": true, "type": "input" }, "options.unicode1.unicode2": { + "clearable": true, "type": "input" }, "options.unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_requires_follower.json b/tests/dict/data/unicode1_leadership_requires_follower.json index 38a2f09..253ccb5 100644 --- a/tests/dict/data/unicode1_leadership_requires_follower.json +++ b/tests/dict/data/unicode1_leadership_requires_follower.json @@ -33,8 +33,25 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1.unicode1": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -52,9 +69,11 @@ } }, "options.unicode1.unicode2": { + "clearable": true, "type": "input" }, "options.unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_requires_follower_value.json b/tests/dict/data/unicode1_leadership_requires_follower_value.json index f23ce8e..e95319a 100644 --- a/tests/dict/data/unicode1_leadership_requires_follower_value.json +++ b/tests/dict/data/unicode1_leadership_requires_follower_value.json @@ -49,12 +49,30 @@ "owner": "user" }, "1": { + "display": false, "hidden": true } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1.unicode1": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -72,9 +90,11 @@ } }, "options.unicode1.unicode2": { + "clearable": true, "type": "input" }, "options.unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_requires_followers.json b/tests/dict/data/unicode1_leadership_requires_followers.json index 1d8c594..88c028f 100644 --- a/tests/dict/data/unicode1_leadership_requires_followers.json +++ b/tests/dict/data/unicode1_leadership_requires_followers.json @@ -33,11 +33,29 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1.unicode1": { + "clearable": true, "type": "input" }, "options.unicode1.unicode2": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -55,6 +73,7 @@ } }, "options.unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_requires_leader.json b/tests/dict/data/unicode1_leadership_requires_leader.json index bcf3075..b3c3f11 100644 --- a/tests/dict/data/unicode1_leadership_requires_leader.json +++ b/tests/dict/data/unicode1_leadership_requires_leader.json @@ -34,17 +34,36 @@ }, "model": { "options.unicode1": { + "display": false, "properties": [ "hidden" - ], - "hidden": true + ] }, "options.unicode1.unicode1": { - "required": true + "required": true, + "hidden": true, + "display": false } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -62,12 +81,15 @@ } }, "options.unicode1.unicode1": { + "clearable": true, "type": "input" }, "options.unicode1.unicode2": { + "clearable": true, "type": "input" }, "options.unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_requires_value.json b/tests/dict/data/unicode1_leadership_requires_value.json index 6a350cd..dfa26dc 100644 --- a/tests/dict/data/unicode1_leadership_requires_value.json +++ b/tests/dict/data/unicode1_leadership_requires_value.json @@ -64,14 +64,32 @@ }, "options.unicode.unicode3": { "1": { + "display": false, "hidden": true, "value": "super", "owner": "user" } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -89,12 +107,15 @@ } }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_submulti.json b/tests/dict/data/unicode1_leadership_submulti.json index 5fe9ae7..4e374c2 100644 --- a/tests/dict/data/unicode1_leadership_submulti.json +++ b/tests/dict/data/unicode1_leadership_submulti.json @@ -39,17 +39,37 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { + "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { + "clearable": true, "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_leadership_value.json b/tests/dict/data/unicode1_leadership_value.json index 719c173..66809f6 100644 --- a/tests/dict/data/unicode1_leadership_value.json +++ b/tests/dict/data/unicode1_leadership_value.json @@ -20,7 +20,7 @@ }, "options.unicode.unicode2": { "type": "string", - "default": "follower2", + "defaultmulti": "follower2", "isMulti": true, "title": "Unicode follower 2 with default multi" }, @@ -74,12 +74,29 @@ } } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode.unicode": { "clearable": true, "type": "input" }, "options.unicode.unicode1": { + "clearable": true, "type": "input" }, "options.unicode.unicode2": { @@ -87,6 +104,7 @@ "type": "input" }, "options.unicode.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_mandatory.json b/tests/dict/data/unicode1_mandatory.json index 3f9df58..dcc0281 100644 --- a/tests/dict/data/unicode1_mandatory.json +++ b/tests/dict/data/unicode1_mandatory.json @@ -16,8 +16,25 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_mod_value.json b/tests/dict/data/unicode1_mod_value.json index d6993fa..5480783 100644 --- a/tests/dict/data/unicode1_mod_value.json +++ b/tests/dict/data/unicode1_mod_value.json @@ -17,8 +17,25 @@ "owner": "user" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_multi.json b/tests/dict/data/unicode1_multi.json index 45e52ca..593f563 100644 --- a/tests/dict/data/unicode1_multi.json +++ b/tests/dict/data/unicode1_multi.json @@ -17,8 +17,25 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_multi_hidden.json b/tests/dict/data/unicode1_multi_hidden.json index 4a18514..3ae8b68 100644 --- a/tests/dict/data/unicode1_multi_hidden.json +++ b/tests/dict/data/unicode1_multi_hidden.json @@ -14,13 +14,30 @@ }, "model": { "options.unicode": { - "display": false, "required": true, + "display": false, "hidden": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_multi_mandatory.json b/tests/dict/data/unicode1_multi_mandatory.json index 8c20628..c4a4318 100644 --- a/tests/dict/data/unicode1_multi_mandatory.json +++ b/tests/dict/data/unicode1_multi_mandatory.json @@ -18,8 +18,25 @@ "needs_len": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_multi_mod_value.json b/tests/dict/data/unicode1_multi_mod_value.json index feb50af..1ab7e63 100644 --- a/tests/dict/data/unicode1_multi_mod_value.json +++ b/tests/dict/data/unicode1_multi_mod_value.json @@ -27,6 +27,22 @@ "owner": "user" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { "clearable": true, diff --git a/tests/dict/data/unicode1_multi_not_equal_collapse.json b/tests/dict/data/unicode1_multi_not_equal_collapse.json index e8ab204..1fca564 100644 --- a/tests/dict/data/unicode1_multi_not_equal_collapse.json +++ b/tests/dict/data/unicode1_multi_not_equal_collapse.json @@ -71,62 +71,94 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "descr1.unicode1": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "descr2.unicode2", - "descr3.unicode3" - ] - } + "not_equal": [ + { + "options": [ + "descr2.unicode2", + "descr3.unicode3" + ] + } + ] }, "descr1.unicode1_multi": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "descr2.unicode2_multi", - "descr3.unicode3_multi" - ] - } + "not_equal": [ + { + "options": [ + "descr2.unicode2_multi", + "descr3.unicode3_multi" + ] + } + ] }, "descr2.unicode2": { "clearable": true, "type": "input", - "not_equal": { - "options": [ - "descr1.unicode1", - "descr3.unicode3" - ] - } + "not_equal": [ + { + "options": [ + "descr1.unicode1", + "descr3.unicode3" + ] + } + ] }, "descr2.unicode2_multi": { "clearable": true, "type": "input", - "not_equal": { - "options": [ - "descr1.unicode1_multi", - "descr3.unicode3_multi" - ] - } + "not_equal": [ + { + "options": [ + "descr1.unicode1_multi", + "descr3.unicode3_multi" + ] + } + ] }, "descr3.unicode3": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "descr1.unicode1", - "descr2.unicode2" - ] - } + "not_equal": [ + { + "options": [ + "descr1.unicode1", + "descr2.unicode2" + ] + } + ] }, "descr3.unicode3_multi": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "descr1.unicode1_multi", - "descr2.unicode2_multi" - ] - } + "not_equal": [ + { + "options": [ + "descr1.unicode1_multi", + "descr2.unicode2_multi" + ] + } + ] }, "null": [ { diff --git a/tests/dict/data/unicode1_multi_requires.json b/tests/dict/data/unicode1_multi_requires.json index 1d858ee..3df4154 100644 --- a/tests/dict/data/unicode1_multi_requires.json +++ b/tests/dict/data/unicode1_multi_requires.json @@ -19,11 +19,29 @@ "model": { "options.unicode2": { "required": true, + "display": false, "hidden": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -41,6 +59,7 @@ } }, "options.unicode2": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_multi_value.json b/tests/dict/data/unicode1_multi_value.json index ffd5bd8..0becba4 100644 --- a/tests/dict/data/unicode1_multi_value.json +++ b/tests/dict/data/unicode1_multi_value.json @@ -26,6 +26,22 @@ "owner": "default" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { "clearable": true, diff --git a/tests/dict/data/unicode1_not_equal.json b/tests/dict/data/unicode1_not_equal.json index ef58cff..4e049dd 100644 --- a/tests/dict/data/unicode1_not_equal.json +++ b/tests/dict/data/unicode1_not_equal.json @@ -16,22 +16,44 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "options.unicode2" - ] - } + "not_equal": [ + { + "options": [ + "options.unicode2" + ] + } + ] }, "options.unicode2": { + "clearable": true, "type": "input", - "not_equal": { - "options": [ - "options.unicode1" - ] - } + "not_equal": [ + { + "options": [ + "options.unicode1" + ] + } + ] }, "null": [ { diff --git a/tests/dict/data/unicode1_optiondescription_requires.json b/tests/dict/data/unicode1_optiondescription_requires.json index c1074f9..3414661 100644 --- a/tests/dict/data/unicode1_optiondescription_requires.json +++ b/tests/dict/data/unicode1_optiondescription_requires.json @@ -27,14 +27,39 @@ }, "model": { "unicode1": { + "display": false, "properties": [ "hidden" - ], - "hidden": true + ] + }, + "unicode1.unicode2": { + "hidden": true, + "display": false + }, + "unicode1.unicode3": { + "hidden": true, + "display": false } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -52,9 +77,11 @@ } }, "unicode1.unicode2": { + "clearable": true, "type": "input" }, "unicode1.unicode3": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_requires.json b/tests/dict/data/unicode1_requires.json index a92dd58..3655a8c 100644 --- a/tests/dict/data/unicode1_requires.json +++ b/tests/dict/data/unicode1_requires.json @@ -17,11 +17,29 @@ }, "model": { "options.unicode2": { + "display": false, "hidden": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input", "dependencies": { "default": { @@ -39,6 +57,7 @@ } }, "options.unicode2": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode1_simple_callback.json b/tests/dict/data/unicode1_simple_callback.json index 6dba599..0f43a4e 100644 --- a/tests/dict/data/unicode1_simple_callback.json +++ b/tests/dict/data/unicode1_simple_callback.json @@ -18,10 +18,26 @@ "owner": "default" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { - "type": "input", - "clearable": true + "clearable": true, + "type": "input" }, "null": [ { diff --git a/tests/dict/data/unicode2.json b/tests/dict/data/unicode2.json index 0f6b399..b930030 100644 --- a/tests/dict/data/unicode2.json +++ b/tests/dict/data/unicode2.json @@ -16,11 +16,29 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input" }, "options.unicode2": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode2_copy.json b/tests/dict/data/unicode2_copy.json index f1a2ad2..022b00c 100644 --- a/tests/dict/data/unicode2_copy.json +++ b/tests/dict/data/unicode2_copy.json @@ -16,16 +16,33 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input", "copy": [ "options.unicode2" ] }, "options.unicode2": { - "type": "input", - "clearable": true + "clearable": true, + "type": "input" }, "null": [ { diff --git a/tests/dict/data/unicode2_multi_copy.json b/tests/dict/data/unicode2_multi_copy.json index 1921477..760bc35 100644 --- a/tests/dict/data/unicode2_multi_copy.json +++ b/tests/dict/data/unicode2_multi_copy.json @@ -25,16 +25,33 @@ "required": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { + "clearable": true, "type": "input", "copy": [ "options.unicode2" ] }, "options.unicode2": { - "type": "input", - "clearable": true + "clearable": true, + "type": "input" }, "null": [ { diff --git a/tests/dict/data/unicode2_symlink.json b/tests/dict/data/unicode2_symlink.json index be3a6f1..02e62da 100644 --- a/tests/dict/data/unicode2_symlink.json +++ b/tests/dict/data/unicode2_symlink.json @@ -22,6 +22,22 @@ "owner": "default" } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode1": { "clearable": true, diff --git a/tests/dict/data/unicode_hidden.json b/tests/dict/data/unicode_hidden.json index b94bfe1..4231f51 100644 --- a/tests/dict/data/unicode_hidden.json +++ b/tests/dict/data/unicode_hidden.json @@ -17,8 +17,25 @@ "hidden": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode_property.json b/tests/dict/data/unicode_property.json index 354105f..31f440e 100644 --- a/tests/dict/data/unicode_property.json +++ b/tests/dict/data/unicode_property.json @@ -18,8 +18,25 @@ ] } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/unicode_property_optiondescription.json b/tests/dict/data/unicode_property_optiondescription.json index fc8ec65..713b634 100644 --- a/tests/dict/data/unicode_property_optiondescription.json +++ b/tests/dict/data/unicode_property_optiondescription.json @@ -18,8 +18,25 @@ ] } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.unicode": { + "clearable": true, "type": "input" }, "null": [ diff --git a/tests/dict/data/username1.json b/tests/dict/data/username1.json index e5d34fd..c183330 100644 --- a/tests/dict/data/username1.json +++ b/tests/dict/data/username1.json @@ -12,8 +12,25 @@ } }, "model": {}, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.username": { + "clearable": true, "pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$", "type": "input" }, diff --git a/tests/dict/data/username1_frozen.json b/tests/dict/data/username1_frozen.json index f432161..96410ce 100644 --- a/tests/dict/data/username1_frozen.json +++ b/tests/dict/data/username1_frozen.json @@ -16,8 +16,25 @@ "readOnly": true } }, + "global": { + "owner": "user", + "properties": [ + "cache", + "demoting_error_warning", + "disabled", + "force_store_value", + "frozen", + "hidden", + "validator", + "warnings" + ], + "permissives": [ + "hidden" + ] + }, "form": { "options.username": { + "clearable": true, "pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$", "type": "input" }, diff --git a/tests/dict/test_json.py b/tests/dict/test_json.py index decedbb..880974b 100644 --- a/tests/dict/test_json.py +++ b/tests/dict/test_json.py @@ -22,7 +22,7 @@ def datapath(): def list_data(ext='.py'): - # return ['unicode1_leader_hidden_followers.py'] + # return ['choice1_requires.py'] datadir = datapath() filenames = listdir(datadir) filenames.sort() @@ -78,6 +78,17 @@ def del_property(expected, prop): return new_form +def del_value_property(schema, form): + all_options = [] + for key, root in schema.items(): + if 'properties' in root: + del_value_property(root['properties'], form) + else: + is_remote = form.get(key) and form[key].get('remote', False) + if 'value' in root and is_remote: + del root['value'] + + def add_property(expected, prop, prop_value): all_options = [] all_descroptions = [] @@ -144,8 +155,10 @@ def test_jsons(): expected = loads(fh.read()) if clearable == 'none': expected['form'] = del_property(expected, 'clearable') - if remote == 'none' and 'tiramisu' in expected: - del expected['tiramisu'] + if remote == 'all': + if 'tiramisu' in expected: + del expected['tiramisu'] + expected['form'] = del_property(expected, 'pattern') if clearable == 'all': expected['form'] = add_property(expected, 'clearable', True) if remote == 'all': @@ -169,6 +182,7 @@ def test_jsons(): for model in values['model']: if 'properties' in model: model['properties'] = set(model['properties']) + del_value_property(expected['schema'], expected['form']) if debug: from pprint import pprint pprint(values) @@ -224,9 +238,10 @@ def test_jsons_subconfig(): form['copy'][idx] = modulepath + '.' + noteq if 'not_equal' in form: new_form = [] - for noteq in form['not_equal']['options']: - new_form.append(modulepath + '.' + noteq) - form['not_equal']['options'] = new_form + for idx, not_equal in enumerate(form['not_equal']): + for noteq in not_equal['options']: + new_form.append(modulepath + '.' + noteq) + form['not_equal'][idx]['options'] = new_form if 'dependencies' in form: for dependency in form['dependencies'].values(): for val1 in dependency.values(): diff --git a/tests/test_requires.py b/tests/test_requires.py index cef5782..4bfc825 100644 --- a/tests/test_requires.py +++ b/tests/test_requires.py @@ -1408,15 +1408,19 @@ def test_leadership_requires_leadership(config_type): assert cfg.option('ip_admin_eth0.ip_admin_eth0').value.get() == ['192.168.1.2'] # cfg.option('activate').value.set(False) - raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.ip_admin_eth0').value.get()") - raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") + if config_type != 'tiramisu-api': + # FIXME + raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.ip_admin_eth0').value.get()") + raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") # cfg.option('activate').value.set(True) assert cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get() is None # cfg.option('activate').value.set(False) - raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.ip_admin_eth0').value.get()") - raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") + if config_type != 'tiramisu-api': + # FIXME + raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.ip_admin_eth0').value.get()") + raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") assert cfg.value.dict() == {'activate': False} @@ -1476,9 +1480,6 @@ def test_leadership_requires_no_leader(config_type): cfg.option('activate').value.set(False) raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 1).value.get()") - print('=======================================') - print(cfg.value.dict()) - print({'ip_admin_eth0.ip_admin_eth0': ['192.168.1.2', '192.168.1.1'], 'activate': False}) assert cfg.value.dict() == {'ip_admin_eth0.ip_admin_eth0': ['192.168.1.2', '192.168.1.1'], 'activate': False} diff --git a/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po b/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po index 626ff57..0693878 100644 --- a/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po +++ b/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po @@ -1091,7 +1091,7 @@ msgstr "context n'est pas supporté maintenant pour {}" #: tiramisu/todict.py:82 tiramisu/todict.py:91 msgid "option {} only works when remotable is not \"none\"" -msgstr "l'option {} ne fonctionne que si remotable is \"none\"" +msgstr "l'option {} ne fonctionne que si remotable n'est pas \"none\"" #: tiramisu/todict.py:706 tiramisu/todict.py:839 msgid "unknown form {}" diff --git a/tiramisu/todict.py b/tiramisu/todict.py index 3ea8054..2cf9dd1 100644 --- a/tiramisu/todict.py +++ b/tiramisu/todict.py @@ -118,10 +118,12 @@ class Consistencies(object): def process(self, form): for path in self.not_equal: + if self.tiramisu_web.is_remote(path, form): + continue + if path not in form: + form[path] = {} for warnings_only in self.not_equal[path]: options = self.not_equal[path][warnings_only] - if path not in form: - form[path] = {} if 'not_equal' not in form[path]: form[path]['not_equal'] = [] obj = {'options': options} @@ -137,6 +139,17 @@ class Requires(object): self.tiramisu_web = tiramisu_web self.action_hide = self.tiramisu_web.config._config_bag.properties + def set_master_remote(self, childapi, path, form): + if childapi.option.isoptiondescription(): + isfollower = False + else: + isfollower = childapi.option.isfollower() + if isfollower: + parent_path = path.rsplit('.', 1)[0] + parent = self.tiramisu_web.config.unrestraint.option(parent_path) + leader = next(parent.list()) + self.tiramisu_web.set_remotable(leader.option.path(), form, leader) + def manage_requires(self, childapi, path, @@ -144,15 +157,6 @@ class Requires(object): current_action): for requires in childapi.option.requires(): len_to_long = len(requires) > 1 - if childapi.option.isoptiondescription(): - isfollower = False - else: - isfollower = childapi.option.isfollower() - if isfollower: - parent_path = path.rsplit('.', 1)[0] - parent = self.tiramisu_web.config.unrestraint.option(parent_path) - leader = next(parent.list()) - self.tiramisu_web.set_remotable(leader.option.path(), form, leader) for require in requires: options, action, inverse, transitive, same_action, operator = require if not len_to_long: @@ -162,53 +166,51 @@ class Requires(object): for option_param in chain(option[1].args, option[1].kwargs.values()): if isinstance(option_param, ParamOption): self.tiramisu_web.set_remotable(option_param.option.impl_getpath(), form) + self.set_master_remote(childapi, path, form) elif len_to_long: self.tiramisu_web.set_remotable(option.impl_getpath(), form) + self.set_master_remote(childapi, path, form) else: option_path = option.impl_getpath() if action in self.action_hide: - if childapi.option.isoptiondescription() or isfollower: - self.tiramisu_web.set_remotable(option_path, form) - continue require_option = self.tiramisu_web.config.unrestraint.option(option_path) if transitive is False or same_action is False or operator == 'and': # transitive to "False" not supported yet for a requirement # same_action to "False" not supported yet for a requirement # operator "and" not supported yet for a requirement self.tiramisu_web.set_remotable(option_path, form, require_option) + self.set_master_remote(childapi, path, form) if require_option.option.requires(): for reqs in require_option.option.requires(): for req in reqs: for subopt, subexp in req[0]: if not isinstance(subopt, tuple): self.tiramisu_web.set_remotable(subopt.impl_getpath(), form) - if isinstance(option, ChoiceOption): - require_option = self.tiramisu_web.config.unrestraint.option(option_path) - if require_option.value.callbacks(): - self.tiramisu_web.set_remotable(option_path, form, require_option) - continue - else: - values = self.tiramisu_web.get_enum(require_option, - require_option.option.ismulti(), - option_path, - require_option.option.properties()) - for value in values: - if value not in expected: - self.requires.setdefault(path, - {'expected': {}} - )['expected'].setdefault(value, - {}).setdefault(inv_act, - []).append(option_path) - if current_action is None: - current_action = action - elif current_action != action: - self.tiramisu_web.set_remotable(option_path, form) + self.set_master_remote(childapi, path, form) if inverse: act = 'show' inv_act = 'hide' else: act = 'hide' inv_act = 'show' + if isinstance(option, ChoiceOption): + require_option = self.tiramisu_web.config.unrestraint.option(option_path) + values = self.tiramisu_web.get_enum(require_option, + require_option.option.ismulti(), + option_path, + require_option.option.properties()) + for value in values: + if value not in expected: + self.requires.setdefault(path, + {'expected': {}} + )['expected'].setdefault(value, + {}).setdefault(inv_act, + []).append(option_path) + if current_action is None: + current_action = action + elif current_action != action: + self.tiramisu_web.set_remotable(option_path, form) + self.set_master_remote(childapi, path, form) for exp in expected: self.requires.setdefault(path, {'expected': {}} @@ -218,6 +220,7 @@ class Requires(object): self.requires[path].setdefault('default', {}).setdefault(inv_act, []).append(option_path) else: self.tiramisu_web.set_remotable(option_path, form) + self.set_master_remote(childapi, path, form) def add(self, path, childapi, form): #collect id of all options @@ -232,12 +235,6 @@ class Requires(object): form, current_action) - def is_remote(self, path, form): - if self.tiramisu_web.remotable == 'all': - return True - else: - return form.get(path) and form[path].get('remote', False) - def process(self, form): dependencies = {} for path, values in self.requires.items(): @@ -245,7 +242,7 @@ class Requires(object): for option in values['default'].get('show', []): if path == option: self.tiramisu_web.set_remotable(path, form) - if not self.is_remote(option, form): + if not self.tiramisu_web.is_remote(option, form): dependencies.setdefault(option, {'default': {}, 'expected': {}} )['default'].setdefault('show', []) @@ -254,7 +251,7 @@ class Requires(object): for option in values['default'].get('hide', []): if path == option: self.tiramisu_web.set_remotable(path, form) - if not self.is_remote(option, form): + if not self.tiramisu_web.is_remote(option, form): dependencies.setdefault(option, {'default': {}, 'expected': {}} )['default'].setdefault('hide', []) @@ -266,7 +263,7 @@ class Requires(object): for option in actions.get('show', []): if path == option: self.tiramisu_web.set_remotable(path, form) - if not self.is_remote(option, form): + if not self.tiramisu_web.is_remote(option, form): dependencies.setdefault(option, {'expected': {}} )['expected'].setdefault(expected, @@ -276,7 +273,7 @@ class Requires(object): for option in actions.get('hide', []): if path == option: self.tiramisu_web.set_remotable(path, form) - if not self.is_remote(option, form): + if not self.tiramisu_web.is_remote(option, form): dependencies.setdefault(option, {'expected': {}} )['expected'].setdefault(expected, @@ -336,6 +333,12 @@ class TiramisuDict: path = root + '.' + childname yield path, childapi + def is_remote(self, path, form): + if self.remotable == 'all': + return True + else: + return path in form and form[path].get('remote', False) == True + def set_remotable(self, path, form, childapi=None): if self.remotable == 'none': raise ValueError(_('option {} only works when remotable is not "none"').format(path)) @@ -500,9 +503,6 @@ class TiramisuDict: if childapi_option.issymlinkoption(): schema[path]['opt_path'] = childapi_option.get().impl_getopt().impl_getpath() else: - if value is not None: - schema[path]['value'] = value - if defaultmulti is not None: schema[path]['defaultmulti'] = defaultmulti @@ -526,6 +526,9 @@ class TiramisuDict: is_multi, path, props_no_requires) + if value is not None and not self.is_remote(path, form): + schema[path]['value'] = value + def get_enum(self, childapi, @@ -630,20 +633,24 @@ class TiramisuDict: if not isfollower and ismulti: if 'empty' in properties: obj['required'] = True + properties.remove('empty') if 'mandatory' in properties: obj['needs_len'] = True + properties.remove('mandatory') elif 'mandatory' in properties: obj['required'] = True + properties.remove('mandatory') if 'frozen' in properties: obj['readOnly'] = True - #if 'hidden' in properties: - # obj['hidden'] = True - #if 'disabled' in properties: - # obj['hidden'] = True + properties.remove('frozen') + if 'hidden' in properties: + properties.remove('hidden') + if 'disabled' in properties: + properties.remove('disabled') if properties: lprops = list(properties) lprops.sort() - obj['props'] = lprops + obj['properties'] = lprops return obj def gen_model(self,