"software/caddy-frontend/development.cfg" did not exist on "41736b8921dbe8a129eb53da0866d1327bef28de"
Commit 7924d351 authored by Jérome Perrin's avatar Jérome Perrin

Re-enable "Diff Object" "Diff Module Objects" for users

This is used and should not be disabled.

There was an error when clicking this dialog, fix that error instead.

See merge request nexedi/erp5!1301
parents 01310e93 813d4942
...@@ -264,6 +264,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -264,6 +264,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
expected = {'folder': [], expected = {'folder': [],
'global': [], 'global': [],
'object': [], 'object': [],
'object_action': [{'id': 'diff_object_action', 'title': 'Diff Object'}],
'object_exchange': [{'id': 'csv_export', 'title': 'Export Csv File'}], # erp5_csv_style 'object_exchange': [{'id': 'csv_export', 'title': 'Export Csv File'}], # erp5_csv_style
'object_hidden': [{'id': 'view_historical_comparison', 'object_hidden': [{'id': 'view_historical_comparison',
'title': 'View Historical Comparison'}, 'title': 'View Historical Comparison'},
...@@ -285,6 +286,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -285,6 +286,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
expected = {'folder': [], expected = {'folder': [],
'global': [], 'global': [],
'object': [], 'object': [],
'object_action': [{'id': 'diff_object_action', 'title': 'Diff Object'}],
'object_exchange': [{'id': 'csv_export', 'title': 'Export Csv File'}], # erp5_csv_style 'object_exchange': [{'id': 'csv_export', 'title': 'Export Csv File'}], # erp5_csv_style
'object_hidden': [{'id': 'view_historical_comparison', 'object_hidden': [{'id': 'view_historical_comparison',
'title': 'View Historical Comparison'}, 'title': 'View Historical Comparison'},
......
...@@ -63,48 +63,56 @@ ...@@ -63,48 +63,56 @@
<td>Diff Module Objects</td> <td>Diff Module Objects</td>
</tr> </tr>
<!-- Check the diff content --> <tal:block tal:repeat="_ python: (1, 2)">
<tr>
<!-- Check the diff content -->
<tr>
<td>verifyValue</td> <td>verifyValue</td>
<td>field_your_first_path</td> <td>field_your_first_path</td>
<td>bar_module/1</td> <td>bar_module/1</td>
</tr> </tr>
<tr> <tr>
<td>verifyValue</td> <td>verifyValue</td>
<td>field_your_second_path</td> <td>field_your_second_path</td>
<td>bar_module/2</td> <td>bar_module/2</td>
</tr> </tr>
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//a[@class="listbox_title"]</td> <td>//a[@class="listbox_title"]</td>
<td>exact:Diff</td> <td>exact:Diff</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//tr[@class='listbox-data-line-2 DataA']</td> <td>//tr[@class='listbox-data-line-2 DataA']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//tr[@class='listbox-data-line-2 DataA']/td[1]</td> <td>//tr[@class='listbox-data-line-2 DataA']/td[1]</td>
<td>title</td> <td>title</td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td>//tr[@class='listbox-data-line-2 DataA']/td[2]/div[@data-gadget-sandbox="public"]</td> <td>//tr[@class='listbox-data-line-2 DataA']/td[2]/div[@data-gadget-sandbox="public"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>storeEval</td> <td>storeEval</td>
<td>document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-2 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>document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-2 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>_data_gadget_value</td>
</tr> </tr>
<tr> <tr>
<td>verifyEval</td> <td>verifyEval</td>
<td>storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')</td> <td>storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')</td>
<td>---+++@@-1+1@@-Title1+Title2</td> <td>---+++@@-1+1@@-Title1+Title2</td>
</tr> </tr>
<!-- submit the action again, it should be same -->
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
</tal:block>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -54,48 +54,58 @@ ...@@ -54,48 +54,58 @@
<td>Diff Object</td> <td>Diff Object</td>
</tr> </tr>
<!-- Check the diff content --> <tal:block tal:repeat="_ python: (1, 2)">
<tr>
<!-- Check the diff content -->
<tr>
<td>verifyValue</td> <td>verifyValue</td>
<td>field_your_first_path</td> <td>field_your_first_path</td>
<td>bar_module/1</td> <td>bar_module/1</td>
</tr> </tr>
<tr> <tr>
<td>verifyValue</td> <td>verifyValue</td>
<td>field_your_second_path</td> <td>field_your_second_path</td>
<td>bar_module/1</td> <td>bar_module/1</td>
</tr> </tr>
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//a[@class="listbox_title"]</td> <td>//a[@class="listbox_title"]</td>
<td>exact:Diff</td> <td>exact:Diff</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//tr[@class='listbox-data-line-1 DataB']</td> <td>//tr[@class='listbox-data-line-1 DataB']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//tr[@class='listbox-data-line-1 DataB']/td[1]</td> <td>//tr[@class='listbox-data-line-1 DataB']/td[1]</td>
<td>title</td> <td>title</td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td>//tr[@class='listbox-data-line-1 DataB']/td[2]/div[@data-gadget-sandbox="public"]</td> <td>//tr[@class='listbox-data-line-1 DataB']/td[2]/div[@data-gadget-sandbox="public"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>storeEval</td> <td>storeEval</td>
<td>document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-1 DataB']/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>document.querySelector('#selenium_myiframe').contentWindow.document.evaluate("//tr[@class='listbox-data-line-1 DataB']/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>_data_gadget_value</td>
</tr> </tr>
<tr> <tr>
<td>verifyEval</td> <td>verifyEval</td>
<td>storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')</td> <td>storedVars['_data_gadget_value'].replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/\s+/g, '')</td>
<td>---+++@@-1+1@@-Title1+Title2</td> <td>---+++@@-1+1@@-Title1+Title2</td>
</tr> </tr>
<!-- submit the action again, it should be same -->
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
</tal:block>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
<value> <value>
<tuple> <tuple>
<string>Manage portal</string> <string>View</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
<value> <value>
<tuple> <tuple>
<string>Manage portal</string> <string>View</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -98,7 +98,7 @@ if ((first_path is None and second_path is None) and ...@@ -98,7 +98,7 @@ if ((first_path is None and second_path is None) and
# In case the list_selection_name is there, it can be the case of selection # In case the list_selection_name is there, it can be the case of selection
# from the module, hence we get the paths from the selection and use them to # from the module, hence we get the paths from the selection and use them to
# create diff. # create diff.
if list_selection_name is not None: if list_selection_name:
selected_object_list = portal.portal_selections.getSelectionCheckedValueList( selected_object_list = portal.portal_selections.getSelectionCheckedValueList(
selection_name=list_selection_name) selection_name=list_selection_name)
first_object = selected_object_list[0] first_object = selected_object_list[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment