Commit baf5d3aa authored by Gabriel Monnerat's avatar Gabriel Monnerat

WorkflowTool: /manage_properties page does not exists anymore

Workflows are ERP5 Document now, we stay inside ERP5JS intead of go to ZMI
parent 92594d68
Pipeline #15250 failed with stage
......@@ -27,8 +27,6 @@
#
##############################################################################
import re
from erp5.component.mixin.TestWorkflowMixin import TestWorkflowMixin
from Products.ERP5Type.tests.utils import todo_erp5
......@@ -162,7 +160,6 @@ class TestWorklist(TestWorkflowMixin):
def createWorklist(self, workflow_id, worklist_id, actbox_name,
actbox_url=None, **kw):
# add new workflow compatibility
tales_re = re.compile(r'(\w+:)?(.*)')
workflow_value = self.getWorkflowTool()[workflow_id]
if workflow_value.__class__.__name__ == 'Workflow':
worklist_value = workflow_value.newContent(portal_type='Worklist')
......@@ -300,18 +297,18 @@ class TestWorklist(TestWorkflowMixin):
action, = [r for r in result if r["id"] == "onlyjio_validation_workflow"]
self.assertEqual(action["name"], "Validation Workflow")
self.assertTrue(
action["url"].endswith("/portal_workflow/validation_workflow/manage_properties"),
action["url"].endswith("/portal_workflow/validation_workflow/Base_redirectToWorkflowDocument?workflow_id=validation_workflow"),
action
)
self.assertEqual(action["category"], "object_onlyjio_jump_raw")
self.assertEqual(action["category"], "object_onlyjio_jump")
action, = [r for r in result if r["id"] == "onlyjio_edit_workflow"]
self.assertEqual(action["name"], "Edit Workflow")
self.assertTrue(
action["url"].endswith("/portal_workflow/edit_workflow/manage_properties"),
action["url"].endswith("/portal_workflow/edit_workflow/Base_redirectToWorkflowDocument?workflow_id=edit_workflow"),
action
)
self.assertEqual(action["category"], "object_onlyjio_jump_raw")
self.assertEqual(action["category"], "object_onlyjio_jump")
for role, user_id_list in (('Assignor', ('foo', 'manager')),
('Assignee', ('foo', 'bar'))):
......
workflow = context.getPortalObject().portal_workflow.restrictedTraverse(
workflow_id)
return workflow.Base_redirect(
keep_items={
"portal_status_message": workflow.getTranslatedTitle()
})
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>workflow_id, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_redirectToWorkflowDocument</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -612,12 +612,12 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self.assertEqual(result_dict['_links']['action_workflow'][0]['title'], "Custom Action No Dialog")
self.assertEqual(result_dict['_links']['action_workflow'][0]['name'], "custom_action_no_dialog")
self.assertEqual(result_dict['_links']['action_object_jio_jump']['href'],
self.assertEqual(result_dict['_links']['action_object_jio_jump'][0]['href'],
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=jump_query" % (
self.portal.absolute_url(),
urllib.quote_plus(document.getRelativeUrl())))
self.assertEqual(result_dict['_links']['action_object_jio_jump']['title'], "Queries")
self.assertEqual(result_dict['_links']['action_object_jio_jump']['name'], "jump_query")
self.assertEqual(result_dict['_links']['action_object_jio_jump'][0]['title'], "Queries")
self.assertEqual(result_dict['_links']['action_object_jio_jump'][0]['name'], "jump_query")
self.assertEqual(result_dict['_links']['portal']['href'], 'urn:jio:get:%s' % document.getPortalObject().getId())
self.assertEqual(result_dict['_links']['portal']['name'], document.getPortalObject().getTitle())
......@@ -972,12 +972,12 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self.assertEqual(result_dict['_links']['action_workflow'][0]['title'], "Custom Action No Dialog")
self.assertEqual(result_dict['_links']['action_workflow'][0]['name'], "custom_action_no_dialog")
self.assertEqual(result_dict['_links']['action_object_jio_jump']['href'],
self.assertEqual(result_dict['_links']['action_object_jio_jump'][0]['href'],
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=jump_query" % (
self.portal.absolute_url(),
urllib.quote_plus(document.getRelativeUrl())))
self.assertEqual(result_dict['_links']['action_object_jio_jump']['title'], "Queries")
self.assertEqual(result_dict['_links']['action_object_jio_jump']['name'], "jump_query")
self.assertEqual(result_dict['_links']['action_object_jio_jump'][0]['title'], "Queries")
self.assertEqual(result_dict['_links']['action_object_jio_jump'][0]['name'], "jump_query")
self.assertEqual(result_dict['_links']['portal']['href'], 'urn:jio:get:%s' % document.getPortalObject().getId())
self.assertEqual(result_dict['_links']['portal']['name'], document.getPortalObject().getTitle())
......
......@@ -29,15 +29,17 @@
<td>//ul[@class="document-listview"]//li/a[text()="Edit Workflow"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<!-- Not sure why, but without waitForElementPresent, assertValue is not finding the element -->
<tr>
<td>waitForElementPresent</td>
<td>//input[@value="Edit Workflow"]</td>
<td>//input[@id="field_my_title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Edit Workflow"]</td>
<td></td>
<td>assertValue</td>
<td>//input[@id="field_my_title"]</td>
<td>Edit Workflow</td>
</tr>
</tbody></table>
</body>
......
......@@ -456,9 +456,11 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
actions.append({
"id": "onlyjio_%s" % wf.getReference(),
"name": wf.getTitle(),
"url": "%s/manage_properties" % wf.absolute_url_path(),
"url": "%s/Base_redirectToWorkflowDocument?workflow_id=%s" % (
wf.absolute_url(),
wf.getId()),
"icon": None,
"category": "object_onlyjio_jump_raw",
"category": "object_onlyjio_jump",
"priority": 100
})
actions.extend(wf.listObjectActions(info))
......
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