Commit c496ff02 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: don't crash interface for failing query

parent d9259433
...@@ -1121,6 +1121,10 @@ html table thead th[colspan] {\n ...@@ -1121,6 +1121,10 @@ html table thead th[colspan] {\n
text-align: center;\n text-align: center;\n
}\n }\n
\n \n
html .ui-listbox-error {\n
text-align: center;\n
}\n
\n
/* cell background */\n /* cell background */\n
html table thead tr,\n html table thead tr,\n
html table tfoot tr,\n html table tfoot tr,\n
...@@ -5215,7 +5219,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n ...@@ -5215,7 +5219,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>948.40163.31953.33774</string> </value> <value> <string>949.1052.3508.62634</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -5233,7 +5237,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n ...@@ -5233,7 +5237,7 @@ html .ui-panel .ui-content .ui-btn[class*="ui-icon-"]:after {\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1453373898.88</float> <float>1454957135.51</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -253,7 +253,18 @@ ...@@ -253,7 +253,18 @@
</table>\n </table>\n
</div>\n </div>\n
</script>\n </script>\n
\n \n
\n
\n
<script id="error-message-template" type="text/x-handlebars-template">\n
<div class="ui-listbox-error">\n
\t\t <a class="ui-btn ui-corner-all ui-btn-inline" href="{{reset_url}}">\n
\t\t <span style="color:red" data-i18n="Invalid Search Criteria">Invalid Search Criteria</span>\n
\t\t <span>-</span>\n
<span data-i18n="Reset">Reset</span>\n
</a>\n
</div>\n
</script>\n
\n \n
</head>\n </head>\n
<body>\n <body>\n
...@@ -397,7 +408,7 @@ ...@@ -397,7 +408,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>948.8903.55441.44066</string> </value> <value> <string>949.1053.41653.819</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -415,7 +426,7 @@ ...@@ -415,7 +426,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1451495552.88</float> <float>1454957159.48</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -103,9 +103,9 @@ ...@@ -103,9 +103,9 @@
/*jslint indent: 2, maxerr: 3, maxlen: 100, nomen: true */\n /*jslint indent: 2, maxerr: 3, maxlen: 100, nomen: true */\n
/*global window, document, rJS, RSVP, Handlebars, $, loopEventListener,\n /*global window, document, rJS, RSVP, Handlebars, $, loopEventListener,\n
QueryFactory, SimpleQuery, ComplexQuery, Query*/\n QueryFactory, SimpleQuery, ComplexQuery, Query, console*/\n
(function (window, document, rJS, RSVP, Handlebars, $, loopEventListener,\n (function (window, document, rJS, RSVP, Handlebars, $, loopEventListener,\n
QueryFactory, SimpleQuery, ComplexQuery, Query) {\n QueryFactory, SimpleQuery, ComplexQuery, Query, console) {\n
"use strict";\n "use strict";\n
var gadget_klass = rJS(window),\n var gadget_klass = rJS(window),\n
filter_item_source = gadget_klass.__template_element\n filter_item_source = gadget_klass.__template_element\n
...@@ -319,7 +319,14 @@ ...@@ -319,7 +319,14 @@
query_list;\n query_list;\n
if (gadget.props.extended_search) {\n if (gadget.props.extended_search) {\n
//string to query\n //string to query\n
query_list = QueryFactory.create(gadget.props.extended_search);\n try {\n
query_list = QueryFactory.create(gadget.props.extended_search);\n
} catch (error) {\n
//XXXX hack to not crash interface\n
//it catch all error, not only search criteria invalid error\n
console.warn(error);\n
return;\n
}\n
if (query_list.operator === "OR") {\n if (query_list.operator === "OR") {\n
or.checked = true;\n or.checked = true;\n
and.checked = false;\n and.checked = false;\n
...@@ -476,7 +483,7 @@ ...@@ -476,7 +483,7 @@
});\n });\n
\n \n
}(window, document, rJS, RSVP, Handlebars, $, loopEventListener,\n }(window, document, rJS, RSVP, Handlebars, $, loopEventListener,\n
QueryFactory, SimpleQuery, ComplexQuery, Query)); QueryFactory, SimpleQuery, ComplexQuery, Query, console));
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -613,7 +620,7 @@ ...@@ -613,7 +620,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>947.29484.5127.28433</string> </value> <value> <string>949.2121.59518.17646</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -631,7 +638,7 @@ ...@@ -631,7 +638,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1448903443.33</float> <float>1455022145.56</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