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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
92594d68
Commit
92594d68
authored
Apr 27, 2021
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: Add action in ERP5JS UI to access update action script on backend
parent
a20c02c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
161 additions
and
14 deletions
+161
-14
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+4
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
...thTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
+25
-12
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDeveloperEditFormUpdateAction.xml
...eveloper_mode_zuite/testDeveloperEditFormUpdateAction.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDeveloperEditFormUpdateAction.zpt
...eveloper_mode_zuite/testDeveloperEditFormUpdateAction.zpt
+72
-0
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
92594d68
...
...
@@ -1248,6 +1248,10 @@ def renderFormDefinition(form, response_dict):
response_dict
[
"edit_form_action_href"
]
=
'%s/%s/manage_main'
%
(
site_root
.
getId
(),
form
.
action
)
if
form
.
update_action
:
response_dict
[
"edit_form_update_href"
]
=
'%s/%s/manage_main'
%
(
site_root
.
getId
(),
form
.
update_action
)
def
statusLevelToString
(
level
):
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
View file @
92594d68
...
...
@@ -183,6 +183,10 @@
if
(
options
.
form_definition
.
hasOwnProperty
(
"
edit_form_action_href
"
))
{
hash
+=
"
edit_form_action
"
;
}
if
(
options
.
form_definition
.
hasOwnProperty
(
"
edit_form_update_href
"
))
{
hash
+=
"
edit_form_update_action
"
;
}
return
this
.
changeState
({
erp5_document
:
options
.
erp5_document
,
form_definition
:
options
.
form_definition
,
...
...
@@ -233,6 +237,7 @@
dev_element_list
,
parent_element
,
field_href
,
developer_action_mapping
,
j
;
if
(
modification_dict
.
hasOwnProperty
(
'
hash
'
))
{
...
...
@@ -252,22 +257,30 @@
for
(
j
=
0
;
j
<
dev_element_list
.
length
;
j
+=
1
)
{
form_gadget
.
element
.
removeChild
(
dev_element_list
[
j
]);
}
if
(
form_definition
.
hasOwnProperty
(
"
edit_form_href
"
))
{
field_href
=
addDeveloperAction
(
developer_action_mapping
=
{
"
edit_form_href
"
:
[
"
edit-form ui-icon-edit ui-btn-icon-left
"
,
form_definition
.
edit_form_href
,
"
Edit this form
"
);
form_gadget
.
element
.
insertBefore
(
field_href
,
dom_element
);
}
if
(
form_definition
.
hasOwnProperty
(
"
edit_form_action_href
"
))
{
field_href
=
addDeveloperAction
(
],
"
edit_form_action_href
"
:
[
"
edit-form-action ui-icon-external-link ui-btn-icon-left
"
,
form_definition
.
edit_form_action_href
,
"
Edit this form's action
"
);
form_gadget
.
element
.
insertBefore
(
field_href
,
dom_element
);
],
"
edit_form_update_href
"
:
[
"
edit-form-action ui-icon-external-link-square ui-btn-icon-left
"
,
"
Edit this form's update action
"
]
};
for
(
j
in
developer_action_mapping
)
{
if
(
developer_action_mapping
.
hasOwnProperty
(
j
)
&&
form_definition
.
hasOwnProperty
(
j
))
{
field_href
=
addDeveloperAction
(
developer_action_mapping
[
j
][
0
],
form_definition
[
j
],
developer_action_mapping
[
j
][
1
]
);
form_gadget
.
element
.
insertBefore
(
field_href
,
dom_element
);
}
}
}
});
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
92594d68
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
99
0.57432.47622.47940
</string>
</value>
<value>
<string>
99
1.26405.47.57924
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
161
6447651.73
</float>
<float>
161
8519262.64
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDeveloperEditFormUpdateAction.xml
0 → 100644
View file @
92594d68
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<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_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testDeveloperEditFormUpdateAction
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode>
Test Developer Edit Form Update Action
</unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDeveloperEditFormUpdateAction.zpt
0 → 100644
View file @
92594d68
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test Fields without label
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr>
<td
rowspan=
"1"
colspan=
"3"
>
Test Parallel Field
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/expected_failure_for_anonymous_selection"
/>
</td>
</tr>
</thead>
<tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/?page=preference
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list"
/>
<tr>
<td>
click
</td>
<td>
//a[text()="Foos"]
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"
/>
<tal:block
tal:define=
"click_configuration python: {'text': 'Add'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'success',
'text': 'Object created.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
tal:define=
"click_configuration python: {'text': 'Dialog with only Update'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_form.html')]/a[@href="portal_skins/erp5_ui_test/Foo_viewDialogWithOnlyUpdateDialog/manage_main"]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_form.html')]/a[@href="hateoas/Foo_viewDialogWithOnlyUpdateDialog/manage_main"]
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_form.html')]/a[@href="hateoas/Foo_viewDialogWithOnlyUpdateDialog/manage_main"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@href="my_title/manage_workspace"]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//a[contains(@href, "/web_site_module/renderjs_runner/hateoas/Foo_viewDialogWithOnlyUpdateDialog/manage_workspace")]
</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
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