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
Ekaterina
erp5
Commits
fa673cc3
Commit
fa673cc3
authored
May 07, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Do not display empty relation field in non editable mode
parent
b705495d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
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
+10
-2
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
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewField.zpt
...ts/renderjs_ui_page_templates_zuite/testFormViewField.zpt
+13
-1
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
fa673cc3
...
...
@@ -12,8 +12,16 @@
if
(
field
.
type
===
"
FormBox
"
)
{
return
true
;
}
// hidden fields should not be obviously rendered
if
(
field
.
hidden
===
1
)
{
return
false
;
}
// empty default value is bad and final decision
return
!
isEmpty
(
field
[
'
default
'
]);
// empty default value must not be displayed
if
(
isEmpty
(
field
[
'
default
'
]))
{
return
false
;
}
// relation field with no value must not be displayed too
if
((
field
[
'
default
'
].
length
===
1
)
&&
(
isEmpty
(
field
[
'
default
'
][
0
])))
{
return
false
;
}
// display the field by default
return
true
;
}
rJS
(
window
)
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
View file @
fa673cc3
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
6.32979.9603.63197
</string>
</value>
<value>
<string>
96
7.24700.63112.6741
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
152
2336529.93
</float>
<float>
152
5686010.1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewField.zpt
View file @
fa673cc3
...
...
@@ -42,7 +42,19 @@
<td></td>
</tr>
<!-- Field with value are displayed in read only -->
<!-- Empty relation field are not displayed -->
<tr>
<td>
assertElementNotPresent
</td>
<td>
//label[@for='field_my_foo_category_title']
</td>
<td></td>
</tr>
<tr>
<td>
assertElementNotPresent
</td>
<td>
//input[@name='field_my_foo_category_title']
</td>
<td></td>
</tr>
<!-- string Field with value are displayed in read only -->
<tr>
<td>
assertElementPresent
</td>
<td>
//label[@for='field_my_id' and text()='ID']
</td>
...
...
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