Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yoji Takeuchi
erp5
Commits
c496ff02
Commit
c496ff02
authored
Feb 09, 2016
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: don't crash interface for failing query
parent
d9259433
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
109 deletions
+166
-109
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_css.xml
.../PathTemplateItem/web_page_module/rjs_gadget_erp5_css.xml
+6
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
...lateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
+14
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+133
-98
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searcheditor_js.xml
...eItem/web_page_module/rjs_gadget_erp5_searcheditor_js.xml
+13
-6
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_css.xml
View file @
c496ff02
...
@@ -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>
94
8.40163.31953.3377
4
</string>
</value>
<value>
<string>
94
9.1052.3508.6263
4
</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>
145
3373898.88
</float>
<float>
145
4957135.51
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
View file @
c496ff02
...
@@ -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>
94
8.8903.55441.44066
</string>
</value>
<value>
<string>
94
9.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>
145
1495552.8
8
</float>
<float>
145
4957159.4
8
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
c496ff02
...
@@ -109,9 +109,9 @@
...
@@ -109,9 +109,9 @@
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*global window, document, rJS, URI, RSVP, loopEventListener,\n
/*global window, document, rJS, URI, RSVP, loopEventListener,\n
SimpleQuery, ComplexQuery, Query, Handlebars*/\n
SimpleQuery, ComplexQuery, Query, Handlebars
, console
*/\n
(function (window, document, rJS, URI, RSVP, loopEventListener,\n
(function (window, document, rJS, URI, RSVP, loopEventListener,\n
SimpleQuery, ComplexQuery, Query, Handlebars) {\n
SimpleQuery, ComplexQuery, Query, Handlebars
, console
) {\n
"use strict";\n
"use strict";\n
var gadget_klass = rJS(window),\n
var gadget_klass = rJS(window),\n
listbox_hidden_thead_source = gadget_klass.__template_element\n
listbox_hidden_thead_source = gadget_klass.__template_element\n
...
@@ -140,7 +140,12 @@
...
@@ -140,7 +140,12 @@
listbox_source = gadget_klass.__template_element\n
listbox_source = gadget_klass.__template_element\n
.getElementById("listbox-template")\n
.getElementById("listbox-template")\n
.innerHTML,\n
.innerHTML,\n
listbox_template = Handlebars.compile(listbox_source);\n
listbox_template = Handlebars.compile(listbox_source),\n
\n
error_message_source = gadget_klass.__template_element\n
.getElementById("error-message-template")\n
.innerHTML,\n
error_message_template = Handlebars.compile(error_message_source);\n
\n
\n
\n
\n
function renderListboxThead(gadget, template) {\n
function renderListboxThead(gadget, template) {\n
...
@@ -248,6 +253,22 @@
...
@@ -248,6 +253,22 @@
));\n
));\n
}\n
}\n
\n
\n
\n
function renderErrorMessage(gadget) {\n
return gadget.getUrlFor({\n
command: \'store_and_change\',\n
options: {\n
"extended_search": ""\n
}\n
})\n
.push(function (url) {\n
return gadget.translateHtml(error_message_template(\n
{\n
\'reset_url\' : url\n
}\n
));\n
});\n
}\n
\n
\n
rJS(window)\n
rJS(window)\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
...
@@ -388,6 +409,7 @@
...
@@ -388,6 +409,7 @@
select_list = [],\n
select_list = [],\n
dataset,\n
dataset,\n
counter,\n
counter,\n
queue,\n
i;\n
i;\n
\n
\n
if (field_json.query === undefined) {\n
if (field_json.query === undefined) {\n
...
@@ -411,14 +433,26 @@
...
@@ -411,14 +433,26 @@
select_list.push(field_json.column_list[i][0]);\n
select_list.push(field_json.column_list[i][0]);\n
}\n
}\n
select_list.push("uid");\n
select_list.push("uid");\n
return
gadget.jio_allDocs({\n
queue =
gadget.jio_allDocs({\n
// XXX Not jIO compatible, but until a better api is found...\n
// XXX Not jIO compatible, but until a better api is found...\n
"list_method_template": field_json.list_method_template,\n
"list_method_template": field_json.list_method_template,\n
"query": query_string,\n
"query": query_string,\n
"limit": [begin_from, lines + 1],\n
"limit": [begin_from, lines + 1],\n
"select_list": select_list,\n
"select_list": select_list,\n
"sort_on": gadget.props.sort_list\n
"sort_on": gadget.props.sort_list\n
}).push(function (result) {\n
});\n
queue\n
.push(undefined, function (error) {\n
//XXXXX hack to not crash interface\n
//this will catch all error, not only search criteria invalid error\n
console.warn(error);\n
return renderErrorMessage(gadget)\n
.push(function (error_html) {\n
gadget.props.element.querySelector(".document_table").innerHTML = error_html;\n
queue.cancel();\n
});\n
})\n
.push(function (result) {\n
var promise_list = [result];\n
var promise_list = [result];\n
counter = Math.min(result.data.total_rows, lines);\n
counter = Math.min(result.data.total_rows, lines);\n
for (i = 0; i < counter; i += 1) {\n
for (i = 0; i < counter; i += 1) {\n
...
@@ -514,6 +548,7 @@
...
@@ -514,6 +548,7 @@
}).push(function (my_html) {\n
}).push(function (my_html) {\n
gadget.props.element.querySelector(".tfoot").innerHTML = my_html;\n
gadget.props.element.querySelector(".tfoot").innerHTML = my_html;\n
});\n
});\n
return queue;\n
})\n
})\n
\n
\n
\n
\n
...
@@ -657,7 +692,7 @@
...
@@ -657,7 +692,7 @@
});\n
});\n
\n
\n
}(window,
document,
rJS,
URI,
RSVP,
loopEventListener,\n
}(window,
document,
rJS,
URI,
RSVP,
loopEventListener,\n
SimpleQuery,
ComplexQuery,
Query,
Handlebars));
SimpleQuery,
ComplexQuery,
Query,
Handlebars
,
console
));
]]
></string>
</value>
]]
></string>
</value>
</item>
</item>
...
@@ -794,7 +829,7 @@
...
@@ -794,7 +829,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
8.8931.54995.63897
</string>
</value>
<value>
<string>
94
9.2121.3637.17544
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -812,7 +847,7 @@
...
@@ -812,7 +847,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
145
1497439.76
</float>
<float>
145
5022186.29
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searcheditor_js.xml
View file @
c496ff02
...
@@ -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
try {\n
query_list = QueryFactory.create(gadget.props.extended_search);\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>
94
7.29484.5127.28433
</string>
</value>
<value>
<string>
94
9.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>
14
48903443.33
</float>
<float>
14
55022145.56
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment