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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tomáš Peterka
erp5
Commits
9301f06e
Commit
9301f06e
authored
Jul 04, 2017
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Remove useless IF in editable-form-validation
parent
fa9cc706
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
...b_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
+13
-15
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
..._page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
View file @
9301f06e
...
...
@@ -155,8 +155,9 @@
})
.
push
(
undefined
,
function
(
error
)
{
if
(
error
.
target
!==
undefined
)
{
var
error_text
,
var
error_text
=
'
Encountered an unknown error. Try to resubmit
'
,
promise
;
// improve error message if we can
if
(
error
.
target
.
status
===
400
)
{
error_text
=
'
Input data has errors
'
;
}
else
if
(
error
.
target
.
status
===
403
)
{
...
...
@@ -164,11 +165,8 @@
}
else
if
(
error
.
target
.
status
===
0
)
{
// no/default=0 status means a network connection problem
error_text
=
'
Document was not saved! Resubmit when you are online or the document accessible
'
;
}
else
{
// display "unknown error" rather than destroying user's form data (throwing an error)
error_text
=
'
Encountered an unknown error. Try to resubmit
'
;
}
if
(
error_text
!==
undefined
)
{
// display translated error_text to user
promise
=
form_gadget
.
notifySubmitted
()
.
push
(
function
()
{
return
form_gadget
.
translate
(
error_text
);
...
...
@@ -176,10 +174,10 @@
.
push
(
function
(
message
)
{
return
form_gadget
.
notifyChange
(
message
+
'
.
'
);
});
}
if
(
error
.
target
.
status
===
400
)
{
// server validation of form data failed (indicated by reponse code 400)
// if server validation of form data failed (indicated by response code 400)
// we parse out field errors and display them to the user
if
(
error
.
target
.
status
===
400
)
{
promise
.
push
(
function
()
{
// when the server-side validation returns the error description
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
View file @
9301f06e
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
960.32
649.42585.31078
</string>
</value>
<value>
<string>
960.32
738.59764.37853
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
14991
58937.47
</float>
<float>
14991
61198.51
</float>
<string>
UTC
</string>
</tuple>
</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