Commit 4c53cf66 authored by Tristan Cavelier's avatar Tristan Cavelier

RELATIONERROR only handle allDocs error

(indentation in next commit)
parent 05ed7201
...@@ -242,7 +242,8 @@ ...@@ -242,7 +242,8 @@
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
var plane = gadget.element.querySelector("a"), var plane = gadget.element.querySelector("a"),
ul = gadget.element.querySelector(".search_ul"); ul = gadget.element.querySelector(".search_ul"),
translation_promise;
plane.href = ''; plane.href = '';
// uid is known // uid is known
...@@ -308,8 +309,12 @@ ...@@ -308,8 +309,12 @@
return RSVP.delay(200); return RSVP.delay(200);
}) })
.push(function () { .push(function () {
return RSVP.all([ translation_promise = gadget.getTranslationList([
gadget.jio_allDocs({ 'Create New',
'Explore the Search Result List'
]);
return gadget.jio_allDocs({
query: Query.objectToSearchText(new ComplexQuery({ query: Query.objectToSearchText(new ComplexQuery({
operator: "AND", operator: "AND",
query_list: [ query_list: [
...@@ -325,13 +330,12 @@ ...@@ -325,13 +330,12 @@
limit: [0, 10], limit: [0, 10],
select_list: [gadget.state.catalog_index, "uid"], select_list: [gadget.state.catalog_index, "uid"],
sort_on: JSON.parse(gadget.state.sort_list_json) sort_on: JSON.parse(gadget.state.sort_list_json)
}), })
gadget.getTranslationList([ .push(function (result) {
'Create New', return new RSVP.Queue()
'Explore the Search Result List' .push(function () {
]) return RSVP.all([result, translation_promise]);
]); })
})
.push(function (result_list) { .push(function (result_list) {
var i, var i,
row, row,
...@@ -394,10 +398,17 @@ ...@@ -394,10 +398,17 @@
ul.removeChild(ul.firstChild); ul.removeChild(ul.firstChild);
} }
ul.appendChild(fragment_element); ul.appendChild(fragment_element);
})
.push(undefined, function () {
return gadget.notifyInvalid("Invalid search criteria");
}); });
}, function (error) {
if (error && error.hash &&
error.hash.expected &&
error.hash.expected.length === 1 &&
error.hash.expected[0] === "'QUOTE'") {
return gadget.notifyInvalid("Invalid search criteria");
}
throw error;
});
});
}); });
}) })
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.21286.46840.25002</string> </value> <value> <string>976.29948.48865.1092</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1560265812.69</float> <float>1560785130.18</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