Commit 534133b9 authored by Boris Kocherov's avatar Boris Kocherov

use external_reference marker for force create subgadget

parent 4bd32c11
...@@ -251,6 +251,7 @@ ...@@ -251,6 +251,7 @@
url, url,
download_url, download_url,
hash, hash,
external_reference = false,
queue; queue;
// XXX need use `id` property // XXX need use `id` property
if (!schema_path) { if (!schema_path) {
...@@ -271,6 +272,7 @@ ...@@ -271,6 +272,7 @@
hash = url.hash; hash = url.hash;
url = url.href; url = url.href;
if (download_url.startsWith("urn:jio:")) { if (download_url.startsWith("urn:jio:")) {
external_reference = true;
queue = RSVP.Queue() queue = RSVP.Queue()
.push(function () { .push(function () {
return g.resolveExternalReference(download_url, schema_path, path); return g.resolveExternalReference(download_url, schema_path, path);
...@@ -329,6 +331,7 @@ ...@@ -329,6 +331,7 @@
}) })
.push(function (schema_arr) { .push(function (schema_arr) {
checkAndMarkSoftCircular(g, schema_arr, schema_path, url); checkAndMarkSoftCircular(g, schema_arr, schema_path, url);
schema_arr.external_reference = external_reference;
return schema_arr; return schema_arr;
}); });
} }
......
...@@ -1370,7 +1370,7 @@ ...@@ -1370,7 +1370,7 @@
schema_arr = properties[key]; schema_arr = properties[key];
filtered_schema_arr = schemaArrFilteredByDocument(schema_arr, json_document[key]); filtered_schema_arr = schemaArrFilteredByDocument(schema_arr, json_document[key]);
// XXX need schema merge with patternProperties passed key // XXX need schema merge with patternProperties passed key
if (checkSchemaArrOneChoise(schema_arr)) { if (checkSchemaArrOneChoise(schema_arr) && !schema_arr.external_reference) {
if (required.indexOf(key) >= 0) { if (required.indexOf(key) >= 0) {
used_properties[key] = false; used_properties[key] = false;
q.push(render_field.bind(g, g, key, path, q.push(render_field.bind(g, g, key, path,
...@@ -1390,13 +1390,15 @@ ...@@ -1390,13 +1390,15 @@
} }
} }
if (!used_properties.hasOwnProperty(key) && if (!used_properties.hasOwnProperty(key) &&
json_document.hasOwnProperty(key)) { (json_document.hasOwnProperty(key) ||
schema_arr.external_reference)) {
used_properties[key] = ""; used_properties[key] = "";
q.push( q.push(
addSubForm.bind(g, { addSubForm.bind(g, {
gadget: g, gadget: g,
property_name: key, property_name: key,
parent_path: path, parent_path: path,
delete_button: !schema_arr.external_reference,
schema_arr: filtered_schema_arr, schema_arr: filtered_schema_arr,
json_document: json_document[key] json_document: json_document[key]
}) })
......
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