Commit 7e6b9699 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Notify about form validation errors

parent 3bd5a1cc
<!DOCTYPE html>
<html>
<!--
data-i18n=Input data has errors
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.45675.44850.53452</string> </value>
<value> <string>956.14163.7437.54408</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1476956084.58</float>
<float>1482749950.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -180,7 +180,10 @@
if ((error.target !== undefined) && (error.target.status === 400)) {
return form_gadget.notifySubmitted()
.push(function () {
return form_gadget.notifyChange();
return form_gadget.translate('Input data has errors');
})
.push(function (message) {
return form_gadget.notifyChange(message + '.');
})
.push(function () {
return form_gadget.displayFormulatorValidationError(JSON.parse(error.target.responseText));
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.5836.52322.40960</string> </value>
<value> <string>956.14161.10627.9233</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482747274.44</float>
<float>1482749961.0</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Input data has errors
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>952.64761.25287.18397</string> </value>
<value> <string>955.51162.4768.35123</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1475506409.12</float>
<float>1482749363.33</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,6 +8,7 @@
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
......@@ -148,7 +149,10 @@
if ((error.target !== undefined) && (error.target.status === 400)) {
return form_gadget.notifySubmitted()
.push(function () {
return form_gadget.notifyChange();
return form_gadget.translate('Input data has errors');
})
.push(function (message) {
return form_gadget.notifyChange(message + '.');
})
.push(function () {
return form_gadget.displayFormulatorValidationError(JSON.parse(error.target.responseText));
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.14116.17826.62532</string> </value>
<value> <string>956.14154.33619.20206</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482747207.41</float>
<float>1482749968.67</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