Commit cf730f8b authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Reimplement allOf

parent 6530d531
...@@ -272,12 +272,25 @@ ...@@ -272,12 +272,25 @@
} }
} }
// Expand by force the allOf recomposing the properties and required.
for (key in json_field.allOf) { for (key in json_field.allOf) {
if (json_field.allOf.hasOwnProperty(key)) { if (json_field.allOf.hasOwnProperty(key)) {
render_subform(json_field.allOf[key], if (json_field.properties === undefined) {
default_dict, json_field.properties = json_field.allOf[key].properties;
root, } else if (json_field.allOf[key].properties !== undefined) {
path); json_field.properties = Object.assign({},
json_field.properties,
json_field.allOf[key].properties
);
}
if (json_field.required === undefined) {
json_field.required = json_field.allOf[key].required;
} else if (json_field.allOf[key].required !== undefined) {
json_field.required.push.apply(
json_field.required,
json_field.allOf[key].required
);
}
} }
} }
...@@ -286,7 +299,6 @@ ...@@ -286,7 +299,6 @@
div = document.createElement("div"); div = document.createElement("div");
div.setAttribute("class", "subfield"); div.setAttribute("class", "subfield");
div.title = json_field.properties[key].description; div.title = json_field.properties[key].description;
/* console.log(key); */
label = document.createElement("label"); label = document.createElement("label");
label.textContent = json_field.properties[key].title; label.textContent = json_field.properties[key].title;
div.appendChild(label); div.appendChild(label);
......
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1003.60564.512.29713</string> </value> <value> <string>1003.60830.54174.62190</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1666896829.85</float> <float>1666905733.95</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment