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
Hamza
erp5
Commits
57cc2a7b
Commit
57cc2a7b
authored
May 15, 2018
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_core] Mass Workflow Transition does not fail with only one possible transition
parent
710e975a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
7 deletions
+46
-7
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testMassWorkflowTransition.zpt
...al_tests/renderjs_ui_zuite/testMassWorkflowTransition.zpt
+46
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFormIdForWorkflowAction.py
...portal_skins/erp5_core/Base_getFormIdForWorkflowAction.py
+0
-4
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_listWorkflow.py
...emplateItem/portal_skins/erp5_core/Folder_listWorkflow.py
+0
-3
No files found.
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testMassWorkflowTransition.zpt
View file @
57cc2a7b
...
@@ -290,6 +290,52 @@
...
@@ -290,6 +290,52 @@
<tr><td>
select
</td>
<tr><td>
select
</td>
<td>
//select[@name="field_workflow_action"]
</td>
<td>
//select[@name="field_workflow_action"]
</td>
<td>
value=invalidate_action
</td></tr>
<td>
value=invalidate_action
</td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'error', 'text': 'Form updated.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tr><td>
waitForElementPresent
</td>
<td>
//textarea[@name="field_workflow_dialog_your_comment"]
</td><td></td></tr>
<tr><td>
type
</td>
<td>
//textarea[@name="field_workflow_dialog_your_comment"]
</td>
<td>
Pain perdu
</td></tr>
<tr><td>
pause
</td><td>
2000
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'success', 'text': 'Workflow modification in progress.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tr><td>
open
</td>
<td>
${base_url}/Zuite_waitForActivities
</td><td></td></tr>
<tr><td>
assertTextPresent
</td>
<td>
Done.
</td><td></td></tr>
<tr><td>
open
</td>
<td>
${renderjs_url}/#/foo_module
</td><td></td></tr>
<tal:block
tal:define=
"pagination_configuration python: {'header': '(1 - 3 / 6)', 'footer': 'Records 1 - 3 / 6'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text"
/>
</tal:block>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-scope="field_listbox"]//tbody/tr[1]/td[1]//a
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//div[@data-gadget-scope="field_listbox"]//tbody/tr[1]/td[1]//a
</td><td></td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@data-role="header"]//a[@data-i18n="Views"]
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//div[@data-role="header"]//a[@data-i18n="Views"]
</td><td></td></tr>
<tr><td>
waitForElementPresent
</td>
<td>
//div[@role="main"]//ul[@data-role="listview"]//a[@data-i18n="History"]
</td><td></td></tr>
<tr><td>
click
</td>
<td>
//div[@role="main"]//ul[@data-role="listview"]//a[@data-i18n="History"]
</td><td></td></tr>
<tr><td>
waitForTextPresent
</td>
<td>
Pain perdu
</td><td></td></tr>
<tr><td>
assertTextPresent
</td>
<td>
Pain perdu
</td><td></td></tr>
</tbody></table>
</tbody></table>
</body>
</body>
</html>
</html>
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFormIdForWorkflowAction.py
View file @
57cc2a7b
...
@@ -33,9 +33,5 @@ for result in result_list:
...
@@ -33,9 +33,5 @@ for result in result_list:
if
workflow_action
==
action
[
'id'
]:
if
workflow_action
==
action
[
'id'
]:
return
action_form_id
# early return for performance reasons
return
action_form_id
# early return for performance reasons
if
not
workflow_action
and
len
(
id_form_dict
)
==
1
:
# if we have only one possible workflow transition we suppose it is the default one
return
id_form_dict
.
items
()[
0
][
1
]
# if we have no idea what workflow form we should use - just use ~~the default one~~ nothing
# if we have no idea what workflow form we should use - just use ~~the default one~~ nothing
return
""
return
""
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_listWorkflow.py
View file @
57cc2a7b
...
@@ -40,9 +40,6 @@ for result in context.Base_searchUsingFormIdAndQuery(form_id, query, limit=50):
...
@@ -40,9 +40,6 @@ for result in context.Base_searchUsingFormIdAndQuery(form_id, query, limit=50):
if
not
transition_dict
:
if
not
transition_dict
:
workflow_list
.
append
((
translate
(
"No state change possible"
),
""
))
workflow_list
.
append
((
translate
(
"No state change possible"
),
""
))
if
len
(
transition_dict
)
==
1
:
workflow_list
=
[]
# if there is only one workflow possible - do not bother with an empty option
# transition_dict.items() is in form (id, title) but ERP5 requires (title, id) so we reverse
# transition_dict.items() is in form (id, title) but ERP5 requires (title, id) so we reverse
if
transition_dict
:
if
transition_dict
:
workflow_list
.
extend
((
title
,
id
)
for
id
,
title
in
sorted
(
transition_dict
.
items
(),
key
=
lambda
x
:
x
[
1
]))
workflow_list
.
extend
((
title
,
id
)
for
id
,
title
in
sorted
(
transition_dict
.
items
(),
key
=
lambda
x
:
x
[
1
]))
...
...
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