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
Yoji Takeuchi
erp5
Commits
25ad4056
Commit
25ad4056
authored
Sep 26, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui + json_style] Deletion of an object returns meaningful response
parent
1100aa14
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
18 deletions
+25
-18
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
...tem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
+14
-6
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt
...tem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt
+10
-11
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testPanelEditableButton.zpt
...ortal_tests/renderjs_ui_zuite/testPanelEditableButton.zpt
+1
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_deleteObject.py
View file @
25ad4056
from
ZODB.POSException
import
ConflictError
"""Delete object - this script is called as the last frontier thus its result
gets printed into response body.
"""
some duplicated code with Folder_delete instead of modify Folder_delete
intended to make code easy understanding
The code is a modified version of Folder_delete. We split into two files not to
further complicate the mentioned script.
"""
portal
=
context
.
getPortalObject
()
from
ZODB.POSException
import
ConflictError
portal
=
context
.
getPortalObject
()
translate
=
portal
.
Base_translateString
if
context
.
isDeletable
(
check_relation
=
True
):
parent
=
context
.
getParentValue
()
...
...
@@ -16,10 +18,16 @@ if context.isDeletable(check_relation=True):
portal
.
portal_workflow
.
doActionFor
(
context
,
'delete_action'
)
else
:
parent
.
manage_delObjects
(
ids
=
[
context
.
getId
()])
return
# redirect back to the container since the context was deleted
return
container
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
translate
(
"Document deleted"
)
})
except
ConflictError
:
raise
except
Exception
:
# XXX Catch-them-all expression is never a good idea
pass
request
=
portal
.
REQUEST
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt
View file @
25ad4056
...
...
@@ -176,21 +176,20 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tr>
<td>
waitForTextPresent
</td>
<td>
deleted
</td>
<td></td>
</tr>
<!-- Deletion of a Foo Document will still show it in Module View but with "deleted" state -->
<tr><td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope="field_listbox"]//a[text()="deleted"]
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<!-- We should see only one Foo Document -->
<tr>
<td>
verifyTex
tPresent
</td>
<td>
deleted
</td>
<td>
waitForElemen
tPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
click
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]
</td>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testPanelEditableButton.zpt
View file @
25ad4056
...
...
@@ -35,7 +35,7 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
verify
ElementPresent
</td>
<td>
waitFor
ElementPresent
</td>
<td>
//div[@data-gadget-scope='field_my_title']//input
</td>
<td></td>
</tr>
...
...
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