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
Paul Graydon
erp5
Commits
a0733cd4
Commit
a0733cd4
authored
Sep 24, 2018
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_core] Revert view for Historical Comparison.
Partial revert from
2f121c19
parent
c64d55fc
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
547 additions
and
275 deletions
+547
-275
bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testHistory.zpt
...hTemplateItem/portal_tests/document_zuite/testHistory.zpt
+27
-30
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewHistoricalRevisionLink.zpt
...ge_templates_zuite/testFormViewHistoricalRevisionLink.zpt
+8
-21
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.py
...s/erp5_core/Base_getHistoricalComparisonDifferenceList.py
+45
-22
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison.xml
.../portal_skins/erp5_core/Base_viewHistoricalComparison.xml
+1
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison/listbox.xml
...skins/erp5_core/Base_viewHistoricalComparison/listbox.xml
+466
-29
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison/listbox_diff.xml
.../erp5_core/Base_viewHistoricalComparison/listbox_diff.xml
+0
-169
product/ERP5/tests/testXHTML.py
product/ERP5/tests/testXHTML.py
+0
-1
No files found.
bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testHistory.zpt
View file @
a0733cd4
...
...
@@ -130,21 +130,20 @@
<td>
title
</td>
</tr>
<tr>
<td>
assert
ElementPresen
t
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[2]
/div[@data-gadget-sandbox="public"]
</td>
<td>
</td
>
<td>
assert
Tex
t
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[2]
</td>
<td>
Title 0
</td>
<!-- before --
>
</tr>
<tr>
<td>
storeEval
</td>
<td>
document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-0 DataA']/td[2]/div[@data-gadget-sandbox='public']", document.querySelector('#selenium_myiframe').contentWindow.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getAttribute('data-gadget-value');
</td>
<td>
_data_gadget_value
</td
>
<td>
assertText
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[3]
</td>
<td>
Version 1
</td>
<!-- after --
>
</tr>
<tr>
<td>
verifyEval
</td>
<td>
storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')
</td>
<td>
---+++@@-1+1@@-Title0+Version1
</td
>
<td>
assertText
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[4]
</td>
<td>
Version 3
</td>
<!-- now --
>
</tr>
</tal:block>
<tal:block
tal:condition=
"python: context.TestTool_getSkinName()=='Mobile'"
>
...
...
@@ -191,21 +190,20 @@
<td>
title
</td>
</tr>
<tr>
<td>
assert
ElementPresen
t
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[2]
/div[@data-gadget-sandbox="public"]
</td>
<td>
</td
>
<td>
assert
Tex
t
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[2]
</td>
<td>
Version 1
</td>
<!-- before --
>
</tr>
<tr>
<td>
storeEval
</td>
<td>
document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-0 DataA']/td[2]/div[@data-gadget-sandbox='public']", document.querySelector('#selenium_myiframe').contentWindow.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getAttribute('data-gadget-value');
</td>
<td>
_data_gadget_value
</td
>
<td>
assertText
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[3]
</td>
<td>
Version 2
</td>
<!-- after --
>
</tr>
<tr>
<td>
verifyEval
</td>
<td>
storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')
</td>
<td>
---+++@@-1+1@@-Version1+Version2
</td
>
<td>
assertText
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[4]
</td>
<td>
Version 3
</td>
<!-- now --
>
</tr>
</tal:block>
<tal:block
tal:condition=
"python: context.TestTool_getSkinName()=='Mobile'"
>
...
...
@@ -270,21 +268,20 @@
<td>
title
</td>
</tr>
<tr>
<td>
assert
ElementPresen
t
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[2]
/div[@data-gadget-sandbox="public"]
</td>
<td>
</td
>
<td>
assert
Tex
t
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[2]
</td>
<td>
Version 2
</td>
<!-- before --
>
</tr>
<tr>
<td>
storeEval
</td>
<td>
document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-0 DataA']/td[2]/div[@data-gadget-sandbox='public']", document.querySelector('#selenium_myiframe').contentWindow.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getAttribute('data-gadget-value');
</td>
<td>
_data_gadget_value
</td
>
<td>
assertText
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[3]
</td>
<td>
Version 3
</td>
<!-- after --
>
</tr>
<tr>
<td>
verifyEval
</td>
<td>
storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')
</td>
<td>
---+++@@-1+1@@-Version2+Version3
</td
>
<td>
assertText
</td>
<td>
//tr[@class='listbox-data-line-0 DataA']/td[4]
</td>
<td>
Version 3
</td>
<!-- now --
>
</tr>
</tal:block>
<tal:block
tal:condition=
"python: context.TestTool_getSkinName()=='Mobile'"
>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewHistoricalRevisionLink.zpt
View file @
a0733cd4
...
...
@@ -130,32 +130,19 @@
<tr>
<td>
verifyText
</td>
<td>
//div[@data-gadget-scope='field_listbox']//table/thead/tr[1]/th[2]
</td>
<td>
Diff Viewer
</td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope='field_listbox']//table/tbody/tr[2]/td[2]//iframe
</td>
<td></td>
<td>
Old Value
</td>
</tr>
<tr>
<td>
pause
</td>
<td>
1000
</td>
<td></td>
</tr>
<!-- Check for the value of diff in Iframe -->
<tr>
<td>
storeEval
</td>
<td>
document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//div[@data-gadget-scope='field_listbox']//table/tbody/tr[2]/td[2]//iframe", document.querySelector('#selenium_myiframe').contentWindow.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.contentWindow.document.body.textContent
</td>
<td>
diff_content
</td>
<td>
verifyText
</td>
<td>
//div[@data-gadget-scope='field_listbox']//table/thead/tr[1]/th[3]
</td>
<td>
New Value
</td>
</tr>
<tr>
<td>
verifyEval
</td>
<!-- Verify the value after removing the spaces and line breaks -->
<td>
storedVars['diff_content'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')
</td>
<td>
1-1+Anewfoo
</td>
<td>
verifyText
</td>
<td>
//div[@data-gadget-scope='field_listbox']//table/thead/tr[1]/th[4]
</td>
<td>
Current Value
</td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
</html>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.py
View file @
a0733cd4
from
Products.
ERP5Type.Document
import
newTempBase
from
Products.
PythonScripts.standard
import
Object
from
ZODB.POSException
import
ConflictError
from
zExceptions
import
Unauthorized
Base_translateString
=
context
.
Base_translateString
portal
=
context
.
getPortalObject
()
portal_diff
=
portal
.
portal_diff
try
:
context
.
HistoricalRevisions
[
serial
]
except
(
ConflictError
,
Unauthorized
):
raise
except
Exception
:
return
[
newTempBase
(
portal
,
Base_translateString
(
'Historical revisions are'
except
Exception
:
# POSKeyError
return
[
Object
(
property_name
=
Base_translateString
(
'Historical revisions are'
' not available, maybe the database has been packed'
))]
if
next_serial
==
'0.0.0.0'
:
# In case the next serial is 0.0.0.0, we should always be considering the
# new object as the current context
new_getProperty
=
context
.
getProperty
new
=
context
else
:
new
=
context
.
HistoricalRevisions
[
next_serial
]
new_getProperty
=
new
.
getProperty
old
=
context
.
HistoricalRevisions
[
serial
]
result
=
[]
# XXX: Instead of creating a separate property list here, we can use DiffTool
# to directly find out the beautified diff and send it to the listbox
binary_data_explanation
=
Base_translateString
(
"Binary data can't be displayed"
)
base_error_message
=
Base_translateString
(
'(value retrieval failed)'
)
diff
=
portal_diff
.
diffPortalObject
(
old
,
new
).
asBeautifiedJSONDiff
()
for
prop_dict
in
context
.
getPropertyMap
():
prop
=
prop_dict
[
'id'
]
error
=
False
try
:
current_value
=
context
.
getProperty
(
prop
)
except
TypeError
:
error
=
True
current_value
=
base_error_message
try
:
old_value
=
old
.
getProperty
(
prop
)
except
TypeError
:
error
=
True
old_value
=
base_error_message
try
:
new_value
=
new_getProperty
(
prop
)
except
TypeError
:
error
=
True
new_value
=
base_error_message
if
new_value
!=
old_value
or
error
:
# check if values are unicode convertible (binary are not)
if
isinstance
(
new_value
,
(
str
,
unicode
)):
try
:
unicode
(
str
(
new_value
),
'utf-8'
)
except
UnicodeDecodeError
:
new_value
=
binary_data_explanation
if
isinstance
(
old_value
,
(
str
,
unicode
)):
try
:
unicode
(
str
(
old_value
),
'utf-8'
)
except
UnicodeDecodeError
:
old_value
=
binary_data_explanation
if
isinstance
(
current_value
,
(
str
,
unicode
)):
try
:
unicode
(
str
(
current_value
),
'utf-8'
)
except
UnicodeDecodeError
:
current_value
=
binary_data_explanation
tempbase_list
=
[]
uid
=
900
for
x
in
diff
:
temp_obj
=
newTempBase
(
portal
,
x
[
'path'
],
**
x
)
temp_obj
.
setUid
(
'new_%s'
%
uid
)
uid
=
uid
+
1
tempbase_list
.
append
(
temp_obj
)
return
tempbase_list
result
.
append
(
Object
(
property_name
=
prop
,
new_value
=
new_value
,
old_value
=
old_value
,
current_value
=
current_value
))
return
result
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison.xml
View file @
a0733cd4
...
...
@@ -90,9 +90,7 @@
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list>
<string>
listbox_diff
</string>
</list>
<list/>
</value>
</item>
<item>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison/listbox.xml
View file @
a0733cd4
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison/listbox_diff.xml
deleted
100644 → 0
View file @
c64d55fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
css_class
</string>
<string>
default
</string>
<string>
gadget_url
</string>
<string>
js_sandbox
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_diff
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string>
listbox-gadget
</string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_gadget_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Diff Viewer
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: cell.diff
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: field.restrictedTraverse(\'gadget_erp5_side_by_side_diff.html\').absolute_url()
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: context.Base_getDiffGadgetSandbox()
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/testXHTML.py
View file @
a0733cd4
...
...
@@ -50,7 +50,6 @@ class TestXHTMLMixin(ERP5TypeTestCase):
# some forms have intentionally empty listbox selections like RSS generators
FORM_LISTBOX_EMPTY_SELECTION_PATH_LIST
=
[
'erp5_web_widget_library/WebSection_viewContentListAsRSS'
,
'erp5_core/Base_viewHistoricalComparison'
,
'erp5_diff/ERP5Site_viewDiffTwoObjectDialog'
,]
JSL_IGNORE_FILE_LIST
=
(
'diff2html.js'
,
...
...
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