works with test/auto tests

This commit is contained in:
Emmanuel Garette 2019-07-06 07:18:32 +02:00
parent fb1286e50e
commit d3eef77c03
64 changed files with 1293 additions and 152 deletions

View File

@ -12,7 +12,26 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.boolean": {
"clearable": true
},
"null": [ "null": [
{ {
"title": "Configurer", "title": "Configurer",

View File

@ -16,7 +16,26 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.boolean": {
"clearable": true
},
"null": [ "null": [
{ {
"title": "Configurer", "title": "Configurer",

View File

@ -17,8 +17,25 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice": { "options.choice": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"null": [ "null": [

View File

@ -21,8 +21,25 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice": { "options.choice": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"null": [ "null": [

View File

@ -57,17 +57,37 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice1.choice1": { "options.choice1.choice1": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice2": { "options.choice1.choice2": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice3": { "options.choice1.choice3": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice4": { "options.choice1.choice4": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"null": [ "null": [

View File

@ -58,22 +58,41 @@
}, },
"options.choice1.choice3": { "options.choice1.choice3": {
"null": { "null": {
"display": false, "display": false
"hidden": true
} }
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice1.choice1": { "options.choice1.choice1": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice2": { "options.choice1.choice2": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice3": { "options.choice1.choice3": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice4": { "options.choice1.choice4": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"null": [ "null": [

View File

@ -67,17 +67,37 @@
} }
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice1.choice1": { "options.choice1.choice1": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice2": { "options.choice1.choice2": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice3": { "options.choice1.choice3": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"options.choice1.choice4": { "options.choice1.choice4": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"null": [ "null": [

View File

@ -21,8 +21,25 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice": { "options.choice": {
"clearable": true,
"type": "choice" "type": "choice"
}, },
"null": [ "null": [

View File

@ -17,8 +17,25 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice": { "options.choice": {
"clearable": true,
"type": "choice", "type": "choice",
"displayed": { "displayed": {
"choice 1": "renamed 1", "choice 1": "renamed 1",

View File

@ -4,11 +4,11 @@
"properties": { "properties": {
"options.choice": { "options.choice": {
"type": "choice", "type": "choice",
"value": "hide",
"enum": [ "enum": [
"hide", "hide",
"show" "show"
], ],
"value": "hide",
"title": "Choice description" "title": "Choice description"
}, },
"options.unicode2": { "options.unicode2": {
@ -27,9 +27,26 @@
"owner": "default" "owner": "default"
}, },
"options.unicode2": { "options.unicode2": {
"display": false,
"hidden": true "hidden": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.choice": { "options.choice": {
"clearable": true, "clearable": true,
@ -41,13 +58,13 @@
] ]
}, },
"expected": { "expected": {
"hide": { "show": {
"hide": [ "show": [
"options.unicode2" "options.unicode2"
] ]
}, },
"show": { "hide": {
"show": [ "hide": [
"options.unicode2" "options.unicode2"
] ]
} }
@ -55,6 +72,7 @@
} }
}, },
"options.unicode2": { "options.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -12,7 +12,27 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.date": {
"clearable": true,
"remote": true
},
"null": [ "null": [
{ {
"title": "Configurer", "title": "Configurer",

View File

@ -16,7 +16,27 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.date": {
"clearable": true,
"remote": true
},
"null": [ "null": [
{ {
"title": "Configurer", "title": "Configurer",

View File

@ -10,8 +10,25 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"usbpath": { "usbpath": {
"clearable": true,
"pattern": "^[a-zA-Z0-9\\-\\._~/+]+$", "pattern": "^[a-zA-Z0-9\\-\\._~/+]+$",
"type": "input" "type": "input"
}, },

View File

@ -24,20 +24,40 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.hostname1": { "options.hostname1": {
"clearable": true,
"pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$", "pattern": "^((?!-)[a-z0-9-]{1,63}\\.){1,}[a-z0-9-]{1,63}$",
"type": "input" "type": "input"
}, },
"options.hostname2": { "options.hostname2": {
"clearable": true,
"pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$", "pattern": "^((?!-)[a-z0-9-]{0,63}\\.){0,}[a-z0-9-]{1,63}$",
"type": "input" "type": "input"
}, },
"options.hostname3": { "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]?)))$", "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" "type": "input"
}, },
"options.hostname4": { "options.hostname4": {
"clearable": true,
"pattern": "^((?!-)[a-z0-9-]{1,15})$", "pattern": "^((?!-)[a-z0-9-]{1,15})$",
"type": "input" "type": "input"
}, },

View File

@ -12,9 +12,26 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.ip": { "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" "type": "input"
}, },
"null": [ "null": [

View File

@ -16,9 +16,26 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.ip": { "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" "type": "input"
}, },
"null": [ "null": [

View File

@ -12,8 +12,25 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.mail": { "options.mail": {
"clearable": true,
"pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$", "pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
"type": "input" "type": "input"
}, },

View File

@ -12,8 +12,25 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.integer": { "options.integer": {
"clearable": true,
"pattern": "^[0-9]+$", "pattern": "^[0-9]+$",
"type": "input" "type": "input"
}, },

View File

@ -16,8 +16,25 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.integer": { "options.integer": {
"clearable": true,
"pattern": "^[0-9]+$", "pattern": "^[0-9]+$",
"type": "input" "type": "input"
}, },

View File

@ -18,6 +18,22 @@
"owner": "user" "owner": "user"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.integer": { "options.integer": {
"clearable": true, "clearable": true,

View File

@ -18,6 +18,22 @@
"owner": "default" "owner": "default"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.integer": { "options.integer": {
"clearable": true, "clearable": true,

View File

@ -12,8 +12,25 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -16,8 +16,25 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -35,22 +35,42 @@
}, },
"model": { "model": {
"options.unicode.unicode": { "options.unicode.unicode": {
"display": false,
"required": true, "required": true,
"display": false,
"hidden": true "hidden": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -38,17 +38,37 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -20,7 +20,7 @@
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"type": "string", "type": "string",
"default": "follower2", "defaultmulti": "follower2",
"isMulti": true, "isMulti": true,
"title": "Unicode follower 2 with default multi" "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": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true, "clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
@ -71,6 +88,7 @@
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -54,22 +54,41 @@
"hidden": true "hidden": true
}, },
"null": { "null": {
"display": false, "display": false
"hidden": true
} }
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -37,17 +37,37 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode1": { "options.unicode1.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode2": { "options.unicode1.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode3": { "options.unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -38,28 +38,52 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"options.unicode.unicode3" "options": [
] "options.unicode.unicode3"
} ]
}
]
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"options.unicode.unicode2" "options": [
] "options.unicode.unicode2"
} ]
}
]
}, },
"null": [ "null": [
{ {

View File

@ -38,14 +38,33 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -63,6 +82,7 @@
} }
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -34,17 +34,36 @@
}, },
"model": { "model": {
"options.unicode1": { "options.unicode1": {
"display": false,
"properties": [ "properties": [
"hidden" "hidden"
], ]
"hidden": true
}, },
"options.unicode1.unicode1": { "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": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -62,12 +81,15 @@
} }
}, },
"options.unicode1.unicode1": { "options.unicode1.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode2": { "options.unicode1.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode3": { "options.unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -33,8 +33,25 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1.unicode1": { "options.unicode1.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -52,9 +69,11 @@
} }
}, },
"options.unicode1.unicode2": { "options.unicode1.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode3": { "options.unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -49,12 +49,30 @@
"owner": "user" "owner": "user"
}, },
"1": { "1": {
"display": false,
"hidden": true "hidden": true
} }
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1.unicode1": { "options.unicode1.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -72,9 +90,11 @@
} }
}, },
"options.unicode1.unicode2": { "options.unicode1.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode3": { "options.unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -33,11 +33,29 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1.unicode1": { "options.unicode1.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode2": { "options.unicode1.unicode2": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -55,6 +73,7 @@
} }
}, },
"options.unicode1.unicode3": { "options.unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -34,17 +34,36 @@
}, },
"model": { "model": {
"options.unicode1": { "options.unicode1": {
"display": false,
"properties": [ "properties": [
"hidden" "hidden"
], ]
"hidden": true
}, },
"options.unicode1.unicode1": { "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": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -62,12 +81,15 @@
} }
}, },
"options.unicode1.unicode1": { "options.unicode1.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode2": { "options.unicode1.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode1.unicode3": { "options.unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -64,14 +64,32 @@
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"1": { "1": {
"display": false,
"hidden": true, "hidden": true,
"value": "super", "value": "super",
"owner": "user" "owner": "user"
} }
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -89,12 +107,15 @@
} }
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -39,17 +39,37 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -20,7 +20,7 @@
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
"type": "string", "type": "string",
"default": "follower2", "defaultmulti": "follower2",
"isMulti": true, "isMulti": true,
"title": "Unicode follower 2 with default multi" "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": { "form": {
"options.unicode.unicode": { "options.unicode.unicode": {
"clearable": true, "clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode1": { "options.unicode.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode.unicode2": { "options.unicode.unicode2": {
@ -87,6 +104,7 @@
"type": "input" "type": "input"
}, },
"options.unicode.unicode3": { "options.unicode.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -16,8 +16,25 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -17,8 +17,25 @@
"owner": "user" "owner": "user"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -17,8 +17,25 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -14,13 +14,30 @@
}, },
"model": { "model": {
"options.unicode": { "options.unicode": {
"display": false,
"required": true, "required": true,
"display": false,
"hidden": true "hidden": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -18,8 +18,25 @@
"needs_len": true "needs_len": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -27,6 +27,22 @@
"owner": "user" "owner": "user"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true, "clearable": true,

View File

@ -71,62 +71,94 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"descr1.unicode1": { "descr1.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"descr2.unicode2", "options": [
"descr3.unicode3" "descr2.unicode2",
] "descr3.unicode3"
} ]
}
]
}, },
"descr1.unicode1_multi": { "descr1.unicode1_multi": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"descr2.unicode2_multi", "options": [
"descr3.unicode3_multi" "descr2.unicode2_multi",
] "descr3.unicode3_multi"
} ]
}
]
}, },
"descr2.unicode2": { "descr2.unicode2": {
"clearable": true, "clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"descr1.unicode1", "options": [
"descr3.unicode3" "descr1.unicode1",
] "descr3.unicode3"
} ]
}
]
}, },
"descr2.unicode2_multi": { "descr2.unicode2_multi": {
"clearable": true, "clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"descr1.unicode1_multi", "options": [
"descr3.unicode3_multi" "descr1.unicode1_multi",
] "descr3.unicode3_multi"
} ]
}
]
}, },
"descr3.unicode3": { "descr3.unicode3": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"descr1.unicode1", "options": [
"descr2.unicode2" "descr1.unicode1",
] "descr2.unicode2"
} ]
}
]
}, },
"descr3.unicode3_multi": { "descr3.unicode3_multi": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"descr1.unicode1_multi", "options": [
"descr2.unicode2_multi" "descr1.unicode1_multi",
] "descr2.unicode2_multi"
} ]
}
]
}, },
"null": [ "null": [
{ {

View File

@ -19,11 +19,29 @@
"model": { "model": {
"options.unicode2": { "options.unicode2": {
"required": true, "required": true,
"display": false,
"hidden": true "hidden": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -41,6 +59,7 @@
} }
}, },
"options.unicode2": { "options.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -26,6 +26,22 @@
"owner": "default" "owner": "default"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true, "clearable": true,

View File

@ -16,22 +16,44 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"options.unicode2" "options": [
] "options.unicode2"
} ]
}
]
}, },
"options.unicode2": { "options.unicode2": {
"clearable": true,
"type": "input", "type": "input",
"not_equal": { "not_equal": [
"options": [ {
"options.unicode1" "options": [
] "options.unicode1"
} ]
}
]
}, },
"null": [ "null": [
{ {

View File

@ -27,14 +27,39 @@
}, },
"model": { "model": {
"unicode1": { "unicode1": {
"display": false,
"properties": [ "properties": [
"hidden" "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": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -52,9 +77,11 @@
} }
}, },
"unicode1.unicode2": { "unicode1.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"unicode1.unicode3": { "unicode1.unicode3": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -17,11 +17,29 @@
}, },
"model": { "model": {
"options.unicode2": { "options.unicode2": {
"display": false,
"hidden": true "hidden": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"dependencies": { "dependencies": {
"default": { "default": {
@ -39,6 +57,7 @@
} }
}, },
"options.unicode2": { "options.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -18,10 +18,26 @@
"owner": "default" "owner": "default"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"type": "input", "clearable": true,
"clearable": true "type": "input"
}, },
"null": [ "null": [
{ {

View File

@ -16,11 +16,29 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input" "type": "input"
}, },
"options.unicode2": { "options.unicode2": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -16,16 +16,33 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"copy": [ "copy": [
"options.unicode2" "options.unicode2"
] ]
}, },
"options.unicode2": { "options.unicode2": {
"type": "input", "clearable": true,
"clearable": true "type": "input"
}, },
"null": [ "null": [
{ {

View File

@ -25,16 +25,33 @@
"required": true "required": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true,
"type": "input", "type": "input",
"copy": [ "copy": [
"options.unicode2" "options.unicode2"
] ]
}, },
"options.unicode2": { "options.unicode2": {
"type": "input", "clearable": true,
"clearable": true "type": "input"
}, },
"null": [ "null": [
{ {

View File

@ -22,6 +22,22 @@
"owner": "default" "owner": "default"
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode1": { "options.unicode1": {
"clearable": true, "clearable": true,

View File

@ -17,8 +17,25 @@
"hidden": true "hidden": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -18,8 +18,25 @@
] ]
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -18,8 +18,25 @@
] ]
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.unicode": { "options.unicode": {
"clearable": true,
"type": "input" "type": "input"
}, },
"null": [ "null": [

View File

@ -12,8 +12,25 @@
} }
}, },
"model": {}, "model": {},
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.username": { "options.username": {
"clearable": true,
"pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$", "pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$",
"type": "input" "type": "input"
}, },

View File

@ -16,8 +16,25 @@
"readOnly": true "readOnly": true
} }
}, },
"global": {
"owner": "user",
"properties": [
"cache",
"demoting_error_warning",
"disabled",
"force_store_value",
"frozen",
"hidden",
"validator",
"warnings"
],
"permissives": [
"hidden"
]
},
"form": { "form": {
"options.username": { "options.username": {
"clearable": true,
"pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$", "pattern": "^[a-z_][a-z0-9_-]{0,30}[$a-z0-9_-]{0,1}$",
"type": "input" "type": "input"
}, },

View File

@ -22,7 +22,7 @@ def datapath():
def list_data(ext='.py'): def list_data(ext='.py'):
# return ['unicode1_leader_hidden_followers.py'] # return ['choice1_requires.py']
datadir = datapath() datadir = datapath()
filenames = listdir(datadir) filenames = listdir(datadir)
filenames.sort() filenames.sort()
@ -78,6 +78,17 @@ def del_property(expected, prop):
return new_form 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): def add_property(expected, prop, prop_value):
all_options = [] all_options = []
all_descroptions = [] all_descroptions = []
@ -144,8 +155,10 @@ def test_jsons():
expected = loads(fh.read()) expected = loads(fh.read())
if clearable == 'none': if clearable == 'none':
expected['form'] = del_property(expected, 'clearable') expected['form'] = del_property(expected, 'clearable')
if remote == 'none' and 'tiramisu' in expected: if remote == 'all':
del expected['tiramisu'] if 'tiramisu' in expected:
del expected['tiramisu']
expected['form'] = del_property(expected, 'pattern')
if clearable == 'all': if clearable == 'all':
expected['form'] = add_property(expected, 'clearable', True) expected['form'] = add_property(expected, 'clearable', True)
if remote == 'all': if remote == 'all':
@ -169,6 +182,7 @@ def test_jsons():
for model in values['model']: for model in values['model']:
if 'properties' in model: if 'properties' in model:
model['properties'] = set(model['properties']) model['properties'] = set(model['properties'])
del_value_property(expected['schema'], expected['form'])
if debug: if debug:
from pprint import pprint from pprint import pprint
pprint(values) pprint(values)
@ -224,9 +238,10 @@ def test_jsons_subconfig():
form['copy'][idx] = modulepath + '.' + noteq form['copy'][idx] = modulepath + '.' + noteq
if 'not_equal' in form: if 'not_equal' in form:
new_form = [] new_form = []
for noteq in form['not_equal']['options']: for idx, not_equal in enumerate(form['not_equal']):
new_form.append(modulepath + '.' + noteq) for noteq in not_equal['options']:
form['not_equal']['options'] = new_form new_form.append(modulepath + '.' + noteq)
form['not_equal'][idx]['options'] = new_form
if 'dependencies' in form: if 'dependencies' in form:
for dependency in form['dependencies'].values(): for dependency in form['dependencies'].values():
for val1 in dependency.values(): for val1 in dependency.values():

View File

@ -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'] assert cfg.option('ip_admin_eth0.ip_admin_eth0').value.get() == ['192.168.1.2']
# #
cfg.option('activate').value.set(False) cfg.option('activate').value.set(False)
raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.ip_admin_eth0').value.get()") if config_type != 'tiramisu-api':
raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") # 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) cfg.option('activate').value.set(True)
assert cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get() is None assert cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get() is None
# #
cfg.option('activate').value.set(False) cfg.option('activate').value.set(False)
raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.ip_admin_eth0').value.get()") if config_type != 'tiramisu-api':
raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") # 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} assert cfg.value.dict() == {'activate': False}
@ -1476,9 +1480,6 @@ def test_leadership_requires_no_leader(config_type):
cfg.option('activate').value.set(False) 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', 0).value.get()")
raises(PropertiesOptionError, "cfg.option('ip_admin_eth0.netmask_admin_eth0', 1).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} assert cfg.value.dict() == {'ip_admin_eth0.ip_admin_eth0': ['192.168.1.2', '192.168.1.1'], 'activate': False}

View File

@ -1091,7 +1091,7 @@ msgstr "context n'est pas supporté maintenant pour {}"
#: tiramisu/todict.py:82 tiramisu/todict.py:91 #: tiramisu/todict.py:82 tiramisu/todict.py:91
msgid "option {} only works when remotable is not \"none\"" 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 #: tiramisu/todict.py:706 tiramisu/todict.py:839
msgid "unknown form {}" msgid "unknown form {}"

View File

@ -118,10 +118,12 @@ class Consistencies(object):
def process(self, form): def process(self, form):
for path in self.not_equal: 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]: for warnings_only in self.not_equal[path]:
options = self.not_equal[path][warnings_only] options = self.not_equal[path][warnings_only]
if path not in form:
form[path] = {}
if 'not_equal' not in form[path]: if 'not_equal' not in form[path]:
form[path]['not_equal'] = [] form[path]['not_equal'] = []
obj = {'options': options} obj = {'options': options}
@ -137,6 +139,17 @@ class Requires(object):
self.tiramisu_web = tiramisu_web self.tiramisu_web = tiramisu_web
self.action_hide = self.tiramisu_web.config._config_bag.properties 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, def manage_requires(self,
childapi, childapi,
path, path,
@ -144,15 +157,6 @@ class Requires(object):
current_action): current_action):
for requires in childapi.option.requires(): for requires in childapi.option.requires():
len_to_long = len(requires) > 1 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: for require in requires:
options, action, inverse, transitive, same_action, operator = require options, action, inverse, transitive, same_action, operator = require
if not len_to_long: if not len_to_long:
@ -162,53 +166,51 @@ class Requires(object):
for option_param in chain(option[1].args, option[1].kwargs.values()): for option_param in chain(option[1].args, option[1].kwargs.values()):
if isinstance(option_param, ParamOption): if isinstance(option_param, ParamOption):
self.tiramisu_web.set_remotable(option_param.option.impl_getpath(), form) self.tiramisu_web.set_remotable(option_param.option.impl_getpath(), form)
self.set_master_remote(childapi, path, form)
elif len_to_long: elif len_to_long:
self.tiramisu_web.set_remotable(option.impl_getpath(), form) self.tiramisu_web.set_remotable(option.impl_getpath(), form)
self.set_master_remote(childapi, path, form)
else: else:
option_path = option.impl_getpath() option_path = option.impl_getpath()
if action in self.action_hide: 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) require_option = self.tiramisu_web.config.unrestraint.option(option_path)
if transitive is False or same_action is False or operator == 'and': if transitive is False or same_action is False or operator == 'and':
# transitive to "False" not supported yet for a requirement # transitive to "False" not supported yet for a requirement
# same_action 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 # operator "and" not supported yet for a requirement
self.tiramisu_web.set_remotable(option_path, form, require_option) self.tiramisu_web.set_remotable(option_path, form, require_option)
self.set_master_remote(childapi, path, form)
if require_option.option.requires(): if require_option.option.requires():
for reqs in require_option.option.requires(): for reqs in require_option.option.requires():
for req in reqs: for req in reqs:
for subopt, subexp in req[0]: for subopt, subexp in req[0]:
if not isinstance(subopt, tuple): if not isinstance(subopt, tuple):
self.tiramisu_web.set_remotable(subopt.impl_getpath(), form) self.tiramisu_web.set_remotable(subopt.impl_getpath(), form)
if isinstance(option, ChoiceOption): self.set_master_remote(childapi, path, form)
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)
if inverse: if inverse:
act = 'show' act = 'show'
inv_act = 'hide' inv_act = 'hide'
else: else:
act = 'hide' act = 'hide'
inv_act = 'show' 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: for exp in expected:
self.requires.setdefault(path, self.requires.setdefault(path,
{'expected': {}} {'expected': {}}
@ -218,6 +220,7 @@ class Requires(object):
self.requires[path].setdefault('default', {}).setdefault(inv_act, []).append(option_path) self.requires[path].setdefault('default', {}).setdefault(inv_act, []).append(option_path)
else: else:
self.tiramisu_web.set_remotable(option_path, form) self.tiramisu_web.set_remotable(option_path, form)
self.set_master_remote(childapi, path, form)
def add(self, path, childapi, form): def add(self, path, childapi, form):
#collect id of all options #collect id of all options
@ -232,12 +235,6 @@ class Requires(object):
form, form,
current_action) 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): def process(self, form):
dependencies = {} dependencies = {}
for path, values in self.requires.items(): for path, values in self.requires.items():
@ -245,7 +242,7 @@ class Requires(object):
for option in values['default'].get('show', []): for option in values['default'].get('show', []):
if path == option: if path == option:
self.tiramisu_web.set_remotable(path, form) 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, dependencies.setdefault(option,
{'default': {}, 'expected': {}} {'default': {}, 'expected': {}}
)['default'].setdefault('show', []) )['default'].setdefault('show', [])
@ -254,7 +251,7 @@ class Requires(object):
for option in values['default'].get('hide', []): for option in values['default'].get('hide', []):
if path == option: if path == option:
self.tiramisu_web.set_remotable(path, form) 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, dependencies.setdefault(option,
{'default': {}, 'expected': {}} {'default': {}, 'expected': {}}
)['default'].setdefault('hide', []) )['default'].setdefault('hide', [])
@ -266,7 +263,7 @@ class Requires(object):
for option in actions.get('show', []): for option in actions.get('show', []):
if path == option: if path == option:
self.tiramisu_web.set_remotable(path, form) 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, dependencies.setdefault(option,
{'expected': {}} {'expected': {}}
)['expected'].setdefault(expected, )['expected'].setdefault(expected,
@ -276,7 +273,7 @@ class Requires(object):
for option in actions.get('hide', []): for option in actions.get('hide', []):
if path == option: if path == option:
self.tiramisu_web.set_remotable(path, form) 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, dependencies.setdefault(option,
{'expected': {}} {'expected': {}}
)['expected'].setdefault(expected, )['expected'].setdefault(expected,
@ -336,6 +333,12 @@ class TiramisuDict:
path = root + '.' + childname path = root + '.' + childname
yield path, childapi 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): def set_remotable(self, path, form, childapi=None):
if self.remotable == 'none': if self.remotable == 'none':
raise ValueError(_('option {} only works when remotable is not "none"').format(path)) raise ValueError(_('option {} only works when remotable is not "none"').format(path))
@ -500,9 +503,6 @@ class TiramisuDict:
if childapi_option.issymlinkoption(): if childapi_option.issymlinkoption():
schema[path]['opt_path'] = childapi_option.get().impl_getopt().impl_getpath() schema[path]['opt_path'] = childapi_option.get().impl_getopt().impl_getpath()
else: else:
if value is not None:
schema[path]['value'] = value
if defaultmulti is not None: if defaultmulti is not None:
schema[path]['defaultmulti'] = defaultmulti schema[path]['defaultmulti'] = defaultmulti
@ -526,6 +526,9 @@ class TiramisuDict:
is_multi, is_multi,
path, path,
props_no_requires) props_no_requires)
if value is not None and not self.is_remote(path, form):
schema[path]['value'] = value
def get_enum(self, def get_enum(self,
childapi, childapi,
@ -630,20 +633,24 @@ class TiramisuDict:
if not isfollower and ismulti: if not isfollower and ismulti:
if 'empty' in properties: if 'empty' in properties:
obj['required'] = True obj['required'] = True
properties.remove('empty')
if 'mandatory' in properties: if 'mandatory' in properties:
obj['needs_len'] = True obj['needs_len'] = True
properties.remove('mandatory')
elif 'mandatory' in properties: elif 'mandatory' in properties:
obj['required'] = True obj['required'] = True
properties.remove('mandatory')
if 'frozen' in properties: if 'frozen' in properties:
obj['readOnly'] = True obj['readOnly'] = True
#if 'hidden' in properties: properties.remove('frozen')
# obj['hidden'] = True if 'hidden' in properties:
#if 'disabled' in properties: properties.remove('hidden')
# obj['hidden'] = True if 'disabled' in properties:
properties.remove('disabled')
if properties: if properties:
lprops = list(properties) lprops = list(properties)
lprops.sort() lprops.sort()
obj['props'] = lprops obj['properties'] = lprops
return obj return obj
def gen_model(self, def gen_model(self,