Commit 5db325c7 authored by Tristan Cavelier's avatar Tristan Cavelier

[erp5_web_renderjs_ui] Handle errors while typing in a relation input

For instance, typing a backslash in a relation field does not crash the ui anymore.

/bug #20180123-D78557
https://nexedijs.erp5.net/#/bug_module/20180123-D78557
parent 94a179a6
......@@ -243,7 +243,8 @@
return RSVP.Queue()
.push(function () {
var plane = gadget.element.querySelector("a"),
ul = gadget.element.querySelector(".search_ul");
ul = gadget.element.querySelector(".search_ul"),
translation_promise;
plane.href = '';
// uid is known
......@@ -309,8 +310,12 @@
return RSVP.delay(200);
})
.push(function () {
return RSVP.all([
gadget.jio_allDocs({
translation_promise = gadget.getTranslationList([
'Create New',
'Explore the Search Result List'
]);
return gadget.jio_allDocs({
query: Query.objectToSearchText(new ComplexQuery({
operator: "AND",
query_list: [
......@@ -326,13 +331,12 @@
limit: [0, 10],
select_list: [gadget.state.catalog_index, "uid"],
sort_on: JSON.parse(gadget.state.sort_list_json)
}),
gadget.getTranslationList([
'Create New',
'Explore the Search Result List'
])
]);
})
})
.push(function (result) {
return new RSVP.Queue()
.push(function () {
return RSVP.all([result, translation_promise]);
})
.push(function (result_list) {
var i,
row,
......@@ -396,6 +400,10 @@
}
ul.appendChild(fragment_element);
});
}, function () {
return gadget.notifyInvalid("Invalid search criteria");
});
});
});
})
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.23288.3697.17425</string> </value>
<value> <string>976.29948.48865.1092</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1541156739.42</float>
<float>1560785130.18</float>
<string>UTC</string>
</tuple>
</state>
......@@ -311,7 +311,7 @@
</tuple>
<state>
<tuple>
<float>1541669313.00</float>
<float>1541669313.0</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