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
Labels
Merge Requests
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
1e371494
Commit
1e371494
authored
May 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Form/ListBox: display error wrapper for editable fields with link
only the case without an URL column was properly handled
parent
fe81e31d
Pipeline
#34888
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
4 deletions
+116
-4
bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testEditableError.zpt
...lateItem/portal_tests/listbox_zuite/testEditableError.zpt
+112
-2
product/ERP5Form/ListBox.py
product/ERP5Form/ListBox.py
+4
-2
No files found.
bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testEditableError.zpt
View file @
1e371494
...
...
@@ -2,12 +2,12 @@
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test Title Line
</title>
<title>
Editable fields validation errors
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test that and Editable Column has no Link
</td></tr>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Editable fields validation errors
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/ListBoxZuite_CommonTemplate/macros/init"
/>
<tr>
...
...
@@ -76,6 +76,116 @@
<td></td>
<td>
Make sure there is an input tag in line 1 col 1
</td>
</tr>
<tr>
<td>
type
</td>
<td>
//*[@class="listbox-data-line-0 DataA"]//td[3]/input
</td>
<td>
X
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
Base_edit:method
</td>
<td></td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
//*[@class="listbox-data-line-0 DataA"]//td[3]/input
</td>
<td>
X
</td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//*[@class="listbox-data-line-0 DataA"]//td[3]/span[@class="error"]
</td>
<td>
You did not enter a floating point number.
</td>
</tr>
<!-- prevent "you have unsaved changes" beforeunload warning -->
<tr>
<td>
storeEval
</td>
<td>
window.changed = false
</td>
<td>
_
</td>
</tr>
<!-- now check with an URL column -->
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_view/listbox/manage_main
</td>
<td>
X
</td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_url_columns
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
field_url_columns
</td>
<td>
quantity |
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
submit
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Content changed
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/0
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//*[@class="listbox-data-line-0 DataA"]//td[3]/input
</td>
<td>
X
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
Base_edit:method
</td>
<td></td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
//*[@class="listbox-data-line-0 DataA"]//td[3]/input
</td>
<td>
X
</td>
</tr>
<tr>
<td>
verifyText
</td>
<td>
//*[@class="listbox-data-line-0 DataA"]//td[3]/span[@class="error"]
</td>
<td>
You did not enter a floating point number.
</td>
</tr>
<tr>
<td>
storeEval
</td>
<td>
window.changed = false
</td>
<td>
_
</td>
</tr>
<!-- restore listbox configuration -->
<tr>
<td>
open
</td>
<td>
${base_url}/Foo_view/listbox/manage_main
</td>
<td>
X
</td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_url_columns
</td>
<td>
quantity |
</td>
</tr>
<tr>
<td>
type
</td>
<td>
field_url_columns
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
submit
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Content changed
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
product/ERP5Form/ListBox.py
View file @
1e371494
...
...
@@ -2544,6 +2544,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
else
:
cell_html
=
u''
if
error_message
:
error_message
=
u' <span class="error">%s</span>'
%
error_message
if
url
is
None
:
html
=
cell_html
+
error_message
else
:
...
...
@@ -2551,8 +2553,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
html
=
u'%s'
%
cell_html
else
:
html
=
u'<a href="%s">%s</a>'
%
(
url
,
cell_html
)
if
error_message
not
in
(
''
,
None
)
:
html
+=
u' <span class="error">%s</span>'
%
error_message
if
error_message
:
html
+=
error_message
else
:
# If not editable, show a static text with a link, if enabled.
html
=
html_quote
(
processed_value
)
...
...
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