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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
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
Hide 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.
"""
The code is a modified version of Folder_delete. We split into two files not to
some duplicated code with Folder_delete instead of modify Folder_delete
further complicate the mentioned script.
intended to make code easy understanding
"""
"""
portal
=
context
.
getPortalObject
()
from
ZODB.POSException
import
ConflictError
portal
=
context
.
getPortalObject
()
translate
=
portal
.
Base_translateString
if
context
.
isDeletable
(
check_relation
=
True
):
if
context
.
isDeletable
(
check_relation
=
True
):
parent
=
context
.
getParentValue
()
parent
=
context
.
getParentValue
()
...
@@ -16,10 +18,16 @@ if context.isDeletable(check_relation=True):
...
@@ -16,10 +18,16 @@ if context.isDeletable(check_relation=True):
portal
.
portal_workflow
.
doActionFor
(
context
,
'delete_action'
)
portal
.
portal_workflow
.
doActionFor
(
context
,
'delete_action'
)
else
:
else
:
parent
.
manage_delObjects
(
ids
=
[
context
.
getId
()])
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
:
except
ConflictError
:
raise
raise
except
Exception
:
except
Exception
:
# XXX Catch-them-all expression is never a good idea
pass
pass
request
=
portal
.
REQUEST
request
=
portal
.
REQUEST
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testDeleteDocument.zpt
View file @
25ad4056
...
@@ -176,21 +176,20 @@
...
@@ -176,21 +176,20 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tr>
<!-- Deletion of a Foo Document will still show it in Module View but with "deleted" state -->
<td>
waitForTextPresent
</td>
<tr><td>
waitForElementPresent
</td>
<td>
deleted
</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>
<td></td>
</tr>
<tr>
<td>
verifyTextPresent
</td>
<td>
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/toggle_editable_mode"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<!-- We should see only one Foo Document -->
<tr>
<td>
waitForElementPresent
</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>
<tr>
<tr>
<td>
click
</td>
<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>
<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 @@
...
@@ -35,7 +35,7 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<tr>
<td>
verify
ElementPresent
</td>
<td>
waitFor
ElementPresent
</td>
<td>
//div[@data-gadget-scope='field_my_title']//input
</td>
<td>
//div[@data-gadget-scope='field_my_title']//input
</td>
<td></td>
<td></td>
</tr>
</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