Commit cf730f8b authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Reimplement allOf

parent 6530d531
......@@ -272,12 +272,25 @@
}
}
// Expand by force the allOf recomposing the properties and required.
for (key in json_field.allOf) {
if (json_field.allOf.hasOwnProperty(key)) {
render_subform(json_field.allOf[key],
default_dict,
root,
path);
if (json_field.properties === undefined) {
json_field.properties = json_field.allOf[key].properties;
} else if (json_field.allOf[key].properties !== undefined) {
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 @@
div = document.createElement("div");
div.setAttribute("class", "subfield");
div.title = json_field.properties[key].description;
/* console.log(key); */
label = document.createElement("label");
label.textContent = json_field.properties[key].title;
div.appendChild(label);
......
......@@ -280,7 +280,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1003.60564.512.29713</string> </value>
<value> <string>1003.60830.54174.62190</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -298,7 +298,7 @@
</tuple>
<state>
<tuple>
<float>1666896829.85</float>
<float>1666905733.95</float>
<string>UTC</string>
</tuple>
</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