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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
8863ec26
Commit
8863ec26
authored
Dec 29, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: show the clone action in the panel
parent
0f71fa66
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
4 deletions
+131
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
...hTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
+22
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewMenuActionLink.xml
...js_ui_page_templates_zuite/testFormViewMenuActionLink.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewMenuActionLink.zpt
...js_ui_page_templates_zuite/testFormViewMenuActionLink.zpt
+49
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
View file @
8863ec26
...
@@ -67,6 +67,7 @@
...
@@ -67,6 +67,7 @@
workflow_list
,
workflow_list
,
view_list
,
view_list
,
action_list
,
action_list
,
clone_list
,
jump_list
,
jump_list
,
i
;
i
;
...
@@ -86,6 +87,7 @@
...
@@ -86,6 +87,7 @@
action_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jio_action
)
action_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jio_action
)
.
concat
(
ensureArray
(
erp5_document
.
_links
.
action_object_jio_button
))
.
concat
(
ensureArray
(
erp5_document
.
_links
.
action_object_jio_button
))
.
concat
(
ensureArray
(
erp5_document
.
_links
.
action_object_jio_fast_input
));
.
concat
(
ensureArray
(
erp5_document
.
_links
.
action_object_jio_fast_input
));
clone_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_clone_action
);
jump_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jio_jump
);
jump_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jio_jump
);
if
(
view
===
'
view
'
)
{
if
(
view
===
'
view
'
)
{
...
@@ -102,6 +104,9 @@
...
@@ -102,6 +104,9 @@
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
action_list
[
i
].
class_name
=
action_list
[
i
].
href
===
view
?
'
active
'
:
''
;
action_list
[
i
].
class_name
=
action_list
[
i
].
href
===
view
?
'
active
'
:
''
;
}
}
for
(
i
=
0
;
i
<
clone_list
.
length
;
i
+=
1
)
{
clone_list
[
i
].
class_name
=
clone_list
[
i
].
href
===
view
?
'
active
'
:
''
;
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
jump_list
[
i
].
class_name
=
((
jump_list
[
i
].
href
===
jump_view
)
||
(
jump_list
[
i
].
href
===
view
))
?
'
active
'
:
''
;
jump_list
[
i
].
class_name
=
((
jump_list
[
i
].
href
===
jump_view
)
||
(
jump_list
[
i
].
href
===
view
))
?
'
active
'
:
''
;
}
}
...
@@ -111,6 +116,7 @@
...
@@ -111,6 +116,7 @@
workflow_list
=
JSON
.
stringify
(
workflow_list
);
workflow_list
=
JSON
.
stringify
(
workflow_list
);
view_list
=
JSON
.
stringify
(
view_list
);
view_list
=
JSON
.
stringify
(
view_list
);
action_list
=
JSON
.
stringify
(
action_list
);
action_list
=
JSON
.
stringify
(
action_list
);
clone_list
=
JSON
.
stringify
(
clone_list
);
jump_list
=
JSON
.
stringify
(
jump_list
);
jump_list
=
JSON
.
stringify
(
jump_list
);
}
}
return
context
.
getUrlParameter
(
'
editable
'
)
return
context
.
getUrlParameter
(
'
editable
'
)
...
@@ -121,6 +127,7 @@
...
@@ -121,6 +127,7 @@
workflow_list
:
workflow_list
,
workflow_list
:
workflow_list
,
view_list
:
view_list
,
view_list
:
view_list
,
action_list
:
action_list
,
action_list
:
action_list
,
clone_list
:
clone_list
,
jump_list
:
jump_list
,
jump_list
:
jump_list
,
global
:
true
,
global
:
true
,
jio_key
:
jio_key
,
jio_key
:
jio_key
,
...
@@ -246,6 +253,7 @@
...
@@ -246,6 +253,7 @@
modification_dict
.
hasOwnProperty
(
"
jump_view
"
)
||
modification_dict
.
hasOwnProperty
(
"
jump_view
"
)
||
modification_dict
.
hasOwnProperty
(
"
workflow_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
workflow_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
action_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
action_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
clone_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
jump_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
jump_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
jio_key
"
)
||
modification_dict
.
hasOwnProperty
(
"
jio_key
"
)
||
modification_dict
.
hasOwnProperty
(
"
view_list
"
)))
{
modification_dict
.
hasOwnProperty
(
"
view_list
"
)))
{
...
@@ -258,6 +266,7 @@
...
@@ -258,6 +266,7 @@
parameter_list
=
[],
parameter_list
=
[],
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
),
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
),
action_list
=
JSON
.
parse
(
gadget
.
state
.
action_list
),
action_list
=
JSON
.
parse
(
gadget
.
state
.
action_list
),
clone_list
=
JSON
.
parse
(
gadget
.
state
.
clone_list
),
jump_list
=
JSON
.
parse
(
gadget
.
state
.
jump_list
);
jump_list
=
JSON
.
parse
(
gadget
.
state
.
jump_list
);
workflow_list
=
JSON
.
parse
(
gadget
.
state
.
workflow_list
);
workflow_list
=
JSON
.
parse
(
gadget
.
state
.
workflow_list
);
...
@@ -288,6 +297,16 @@
...
@@ -288,6 +297,16 @@
}
}
});
});
}
}
for
(
i
=
0
;
i
<
clone_list
.
length
;
i
+=
1
)
{
parameter_list
.
push
({
command
:
'
display_dialog_with_history
'
,
options
:
{
jio_key
:
gadget
.
state
.
jio_key
,
view
:
clone_list
[
i
].
href
,
editable
:
true
}
});
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
parameter_list
.
push
({
parameter_list
.
push
({
command
:
'
display_dialog_with_history
'
,
command
:
'
display_dialog_with_history
'
,
...
@@ -308,6 +327,7 @@
...
@@ -308,6 +327,7 @@
dl_fragment
=
document
.
createDocumentFragment
(),
dl_fragment
=
document
.
createDocumentFragment
(),
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
),
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
),
action_list
=
JSON
.
parse
(
gadget
.
state
.
action_list
),
action_list
=
JSON
.
parse
(
gadget
.
state
.
action_list
),
clone_list
=
JSON
.
parse
(
gadget
.
state
.
clone_list
),
jump_list
=
JSON
.
parse
(
gadget
.
state
.
jump_list
);
jump_list
=
JSON
.
parse
(
gadget
.
state
.
jump_list
);
appendDt
(
dl_fragment
,
result_list
[
1
][
0
],
'
eye
'
,
appendDt
(
dl_fragment
,
result_list
[
1
][
0
],
'
eye
'
,
...
@@ -318,12 +338,12 @@
...
@@ -318,12 +338,12 @@
workflow_list
,
result_list
[
0
],
view_list
.
length
);
workflow_list
,
result_list
[
0
],
view_list
.
length
);
}
}
appendDt
(
dl_fragment
,
result_list
[
1
][
2
],
'
cogs
'
,
appendDt
(
dl_fragment
,
result_list
[
1
][
2
],
'
cogs
'
,
action_list
,
result_list
[
0
],
action_list
.
concat
(
clone_list
)
,
result_list
[
0
],
view_list
.
length
+
workflow_list
.
length
);
view_list
.
length
+
workflow_list
.
length
);
appendDt
(
dl_fragment
,
result_list
[
1
][
3
],
'
plane
'
,
appendDt
(
dl_fragment
,
result_list
[
1
][
3
],
'
plane
'
,
jump_list
,
result_list
[
0
],
jump_list
,
result_list
[
0
],
view_list
.
length
+
workflow_list
.
length
+
view_list
.
length
+
workflow_list
.
length
+
action_list
.
length
);
action_list
.
length
+
clone_list
.
length
);
dl_element
=
gadget
.
element
.
querySelector
(
"
dl
"
);
dl_element
=
gadget
.
element
.
querySelector
(
"
dl
"
);
while
(
dl_element
.
firstChild
)
{
while
(
dl_element
.
firstChild
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
8863ec26
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
7.27464.21813.5548
3
</string>
</value>
<value>
<string>
98
8.65434.35774.556
3
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
160
4411452.55
</float>
<float>
160
9322633.89
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewMenuActionLink.xml
0 → 100644
View file @
8863ec26
<?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>
testFormViewMenuActionLink
</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></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewMenuActionLink.zpt
0 → 100644
View file @
8863ec26
<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 Page Front
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Page Tab Link List
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/PTZuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/foo_module/1
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded"
/>
<!-- Go to the action from the panel -->
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/open_menu_panel"
/>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-scope='panel']//a[text()='Clone Document' and contains(@href, '#!display_dialog_with_history') and contains(@href, 'clone_document')]
</td>
<td></td>
</tr>
<!-- Follow one link -->
<tal:block
tal:define=
"click_configuration python: {'text': 'Clone Document'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"
/>
</tal:block>
<tal:block
tal:define=
"notification_configuration python: {'class': 'success',
'text': 'Created Clone Foo.'}"
>
<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"
/>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode"
/>
</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