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
Sven Franck
erp5
Commits
92556fec
Commit
92556fec
authored
Jan 08, 2018
by
Tomáš Peterka
Committed by
Tomáš Peterka
Jan 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Partially revert commit f774f59f412931e5360cb3610fb6d85de2e877da with explanation
parent
e12d9cd5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+27
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
92556fec
...
...
@@ -3,6 +3,22 @@
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
)
{
"
use strict
"
;
/** Return true if `field` resembles non-empty and non-editable field. */
function
isGoodNonEditableField
(
field
)
{
// ListBox and FormBox should always get a chance to render because they
// can contain editable fields
if
(
field
.
type
===
"
ListBox
"
)
{
return
true
;
}
if
(
field
.
type
===
"
FormBox
"
)
{
return
true
;
}
// hidden fields should not be obviously rendered
if
(
field
.
hidden
===
1
)
{
return
false
;
}
// field without default
if
(
!
field
[
'
default
'
])
{
return
false
;
}
if
(
field
[
'
default
'
].
length
===
0
)
{
return
false
;
}
if
(
field
[
'
default
'
].
length
===
1
&&
(
!
field
[
'
default
'
][
0
]))
{
return
false
;
}
return
true
;
}
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
...
...
@@ -50,6 +66,17 @@
rendered_form
=
gadget
.
state
.
erp5_document
.
_embedded
.
_view
,
key
;
/* Remove empty non-editable fields to prevent them from displaying (business requirement).
Deleting objects inplace does not seem to be a good idea.
*/
for
(
key
in
rendered_form
)
{
if
(
rendered_form
.
hasOwnProperty
(
key
)
&&
(
key
[
0
]
!==
"
_
"
))
{
if
(
!
isGoodNonEditableField
(
rendered_form
[
key
]))
{
delete
rendered_form
[
key
];
}
}
}
form_options
.
erp5_document
=
gadget
.
state
.
erp5_document
;
form_options
.
form_definition
=
gadget
.
state
.
form_definition
;
form_options
.
view
=
gadget
.
state
.
view
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
View file @
92556fec
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
25532.35708.31044
</string>
</value>
<value>
<string>
964.
44232.19748.18107
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
151
4478835.97
</float>
<float>
151
5406785.95
</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