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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
30bdc0bb
Commit
30bdc0bb
authored
Jan 13, 2021
by
Gabriel Monnerat
Committed by
Romain Courteaud
Feb 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: add generic function to merge action with raw actions by group
parent
b3086168
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
393 additions
and
200 deletions
+393
-200
bt5/erp5_web_renderjs_ui/ActionTemplateItem/portal_types/portal_actions/jump_to_portal_type.xml
...eItem/portal_types/portal_actions/jump_to_portal_type.xml
+86
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.js
...TemplateItem/web_page_module/rjs_gadget_erp5_global_js.js
+120
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_global_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.js
...ateItem/web_page_module/rjs_gadget_erp5_page_action_js.js
+31
-32
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.xml
...teItem/web_page_module/rjs_gadget_erp5_page_action_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.html
...plateItem/web_page_module/rjs_gadget_erp5_panel_html.html
+4
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
...mplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
+2
-2
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
+66
-108
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/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
+1
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
...lateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
+20
-27
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_data_js.xml
...teItem/web_page_module/rjs_gadget_translation_data_js.xml
+37
-5
bt5/erp5_web_renderjs_ui/bt/template_action_path_list
bt5/erp5_web_renderjs_ui/bt/template_action_path_list
+2
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testAccessPortalTypeDocument.zpt
..._ui_developer_mode_zuite/testAccessPortalTypeDocument.zpt
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testModuleAccessPortalTypeDocument.zpt
...veloper_mode_zuite/testModuleAccessPortalTypeDocument.zpt
+12
-7
No files found.
bt5/erp5_web_renderjs_ui/ActionTemplateItem/portal_types/portal_actions/jump_to_portal_type.xml
0 → 100644
View file @
30bdc0bb
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jio_jump
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
jump_to_portal_type
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
Manage portal
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Edit Portal Type
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Base_redirectToPortalTypeDocument
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python: portal.portal_preferences.isPreferredHtmlStyleDevelopperMode()
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.js
View file @
30bdc0bb
/*global window, RSVP, SimpleQuery, ComplexQuery, Query,
ensureArray
*/
ensureArray
, Array
*/
/*jslint indent: 2, maxerr: 3, nomen: true, unparam: true, continue: true */
(
function
(
window
,
RSVP
,
SimpleQuery
,
ComplexQuery
,
Query
,
ensureArray
)
{
ensureArray
,
Array
)
{
"
use strict
"
;
///////////////////////////////
...
...
@@ -164,6 +164,122 @@
///////////////////////////////
// Handle listbox action list
///////////////////////////////
function
mergeGlobalActionWithRawActionList
(
gadget
,
links
,
group_id_list
,
command_mapping
,
editable_mapping
)
{
var
i
,
j
,
group
,
action_type
,
current_href
,
class_name
,
options
,
command
,
view
=
gadget
.
state
.
view
,
jump_view
=
gadget
.
state
.
jump_view
,
group_mapping
=
{},
url_mapping
=
{},
default_command_mapping
=
{
"
view
"
:
"
display_with_history
"
,
"
action_object_jio_jump
"
:
"
display_dialog_with_history
"
,
"
action_object_jio_action
"
:
"
display_with_history_and_cancel
"
,
"
action_object_view
"
:
"
display_with_history
"
,
"
action_workflow
"
:
"
display_dialog_with_history
"
,
"
action_object_clone_action
"
:
"
display_with_history_and_cancel
"
,
"
action_object_delete_action
"
:
"
display_with_history_and_cancel
"
};
editable_mapping
=
editable_mapping
||
{};
command_mapping
=
command_mapping
||
{};
for
(
i
=
0
;
i
<
group_id_list
.
length
;
i
+=
1
)
{
group
=
group_id_list
[
i
][
0
];
if
(
group_id_list
[
i
]
instanceof
Array
)
{
group_mapping
[
group
]
=
ensureArray
(
links
[
group
]);
action_type
=
group
+
"
_raw
"
;
if
(
links
.
hasOwnProperty
(
action_type
))
{
if
(
links
[
action_type
]
instanceof
Array
)
{
for
(
i
=
0
;
i
<
links
[
action_type
].
length
;
i
+=
1
)
{
if
(
links
[
action_type
][
i
].
href
)
{
group_mapping
[
group
].
push
(
links
[
action_type
][
i
]);
}
}
}
else
{
group_mapping
[
group
].
push
(
links
[
action_type
]);
}
}
if
(
group_id_list
[
i
].
length
>
1
)
{
for
(
j
=
1
;
j
<
group_id_list
[
i
].
length
;
j
+=
1
)
{
group_mapping
[
group
]
=
group_mapping
[
group
].
concat
(
ensureArray
(
links
[
group_id_list
[
i
][
j
]])
);
action_type
=
group_id_list
[
i
][
j
]
+
"
_raw
"
;
if
(
links
.
hasOwnProperty
(
action_type
))
{
if
(
links
[
action_type
]
instanceof
Array
)
{
for
(
i
=
0
;
i
<
links
[
action_type
].
length
;
i
+=
1
)
{
if
(
links
[
action_type
][
i
].
href
)
{
group_mapping
[
group
].
push
(
links
[
action_type
][
i
]);
}
}
}
else
{
group_mapping
[
group
].
push
(
links
[
action_type
]);
}
}
}
}
}
else
{
group_mapping
[
group_id_list
[
i
]]
=
ensureArray
(
links
[
group_id_list
[
i
]]
);
}
}
for
(
group
in
group_mapping
)
{
if
(
group_mapping
.
hasOwnProperty
(
group
))
{
if
(
!
url_mapping
.
hasOwnProperty
(
group
))
{
url_mapping
[
group
]
=
[];
}
for
(
i
=
0
;
i
<
group_mapping
[
group
].
length
;
i
+=
1
)
{
class_name
=
""
;
current_href
=
group_mapping
[
group
][
i
].
href
;
if
(
view
===
'
view
'
&&
group_mapping
[
group
][
i
].
name
===
view
)
{
class_name
=
'
active
'
;
}
else
if
(
current_href
===
view
)
{
class_name
=
'
active
'
;
}
else
if
(
jump_view
&&
((
current_href
===
jump_view
)
||
(
current_href
===
view
)))
{
class_name
=
'
active
'
;
}
if
(
group_mapping
[
group
][
i
].
name
.
indexOf
(
"
_raw
"
)
!==
-
1
)
{
command
=
"
raw
"
;
options
=
{
title
:
group_mapping
[
group
][
i
].
title
,
href
:
group_mapping
[
group
][
i
].
href
};
}
else
{
command
=
command_mapping
[
group
]
||
default_command_mapping
[
group
];
options
=
{
title
:
group_mapping
[
group
][
i
].
title
,
class_name
:
class_name
,
jio_key
:
gadget
.
state
.
jio_key
,
view
:
group_mapping
[
group
][
i
].
href
,
editable
:
editable_mapping
[
group
]
};
}
if
(
group
===
"
view
"
)
{
// Views in ERP5 must be forms but because of
// OfficeJS we keep it empty for different default
options
.
page
=
undefined
;
}
url_mapping
[
group
].
push
({
command
:
command
,
options
:
options
});
}
}
}
return
url_mapping
;
}
function
getListboxClipboardActionList
()
{
var
action_list
=
ensureArray
(
this
.
state
.
erp5_document
.
_links
.
action_object_list_action
||
[]),
i
,
...
...
@@ -311,8 +427,9 @@
.
allowPublicAcquisition
(
"
triggerListboxClipboardAction
"
,
triggerListboxClipboardAction
);
}
window
.
mergeGlobalActionWithRawActionList
=
mergeGlobalActionWithRawActionList
;
window
.
triggerListboxClipboardAction
=
triggerListboxClipboardAction
;
window
.
declareGadgetClassCanHandleListboxClipboardAction
=
declareGadgetClassCanHandleListboxClipboardAction
;
}(
window
,
RSVP
,
SimpleQuery
,
ComplexQuery
,
Query
,
ensureArray
));
\ No newline at end of file
}(
window
,
RSVP
,
SimpleQuery
,
ComplexQuery
,
Query
,
ensureArray
,
Array
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.xml
View file @
30bdc0bb
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
6.51245.10858.8089
</string>
</value>
<value>
<string>
98
9.47571.17838.51694
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
16
02058138.58
</float>
<float>
16
12185222.55
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.js
View file @
30bdc0bb
/*global window, rJS, RSVP, domsugar, calculatePageTitle, ensureArray */
/*global window, rJS, RSVP, domsugar, calculatePageTitle, ensureArray,
console, mergeGlobalActionWithRawActionList */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
domsugar
,
calculatePageTitle
,
ensureArray
)
{
(
function
(
window
,
rJS
,
RSVP
,
domsugar
,
calculatePageTitle
,
ensureArray
,
mergeGlobalActionWithRawActionList
)
{
"
use strict
"
;
function
generateSection
(
title
,
icon
,
view_list
)
{
var
i
,
dom_list
=
[];
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
dom_list
.
push
(
domsugar
(
'
li
'
,
[
domsugar
(
'
a
'
,
{
href
:
view_list
[
i
].
link
,
...
...
@@ -66,36 +67,33 @@
// what view we are at. If no view available than fallback to "links".
return
gadget
.
jio_getAttachment
(
gadget
.
state
.
jio_key
,
gadget
.
state
.
view
||
"
links
"
)
.
push
(
function
(
jio_attachment
)
{
var
i
,
j
,
url_for_kw_list
=
[],
url_mapping
=
mergeGlobalActionWithRawActionList
(
gadget
,
jio_attachment
.
_links
,
[
"
action_workflow
"
,
[
"
action_object_jio_action
"
,
"
action_object_jio_button
"
,
"
action_object_jio_fast_input
"
],
"
action_object_clone_action
"
,
"
action_object_delete_action
"
],
{
"
action_workflow
"
:
"
display_with_history_and_cancel
"
},
{
action_object_clone_action
:
true
});
erp5_document
=
jio_attachment
;
raw_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_development_mode_jump_raw
);
var
i
,
j
,
url_for_kw_list
=
[];
group_list
=
[
// Action list, editable, icon
ensureArray
(
erp5_document
.
_links
.
action_workflow
),
undefined
,
'
random
'
,
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_fast_input
)),
undefined
,
'
gear
'
,
ensureArray
(
erp5_document
.
_links
.
action_object_clone_action
),
true
,
'
clone
'
,
ensureArray
(
erp5_document
.
_links
.
action_object_delete_action
),
undefined
,
'
trash-o
'
];
for
(
i
=
0
;
i
<
group_list
.
length
;
i
+=
3
)
{
for
(
j
=
0
;
j
<
group_list
[
i
].
length
;
j
+=
1
)
{
url_for_kw_list
.
push
({
command
:
'
display_with_history_and_cancel
'
,
options
:
{
jio_key
:
gadget
.
state
.
jio_key
,
view
:
group_list
[
i
][
j
].
href
,
editable
:
group_list
[
i
+
1
]
}});
}
}
url_mapping
.
action_workflow
,
'
random
'
,
url_mapping
.
action_object_jio_action
,
'
gear
'
,
url_mapping
.
action_object_clone_action
,
'
clone
'
,
url_mapping
.
action_object_delete_action
,
'
trash-o
'
];
// Move this code one place that can be shared
for
(
i
in
erp5_document
.
_links
)
{
if
(
i
.
match
(
/.*_raw$/
)
&&
erp5_document
.
_links
[
i
].
href
)
{
raw_list
.
push
(
erp5_document
.
_links
[
i
]);
for
(
i
=
0
;
i
<
group_list
.
length
;
i
+=
2
)
{
for
(
j
=
0
;
j
<
group_list
[
i
].
length
;
j
+=
1
)
{
url_for_kw_list
.
push
(
group_list
[
i
][
j
]);
}
}
...
...
@@ -126,17 +124,17 @@
raw_action_list
=
[],
link_list
;
for
(
i
=
0
;
i
<
group_list
.
length
;
i
+=
3
)
{
for
(
i
=
0
;
i
<
group_list
.
length
;
i
+=
2
)
{
link_list
=
[];
for
(
j
=
0
;
j
<
group_list
[
i
].
length
;
j
+=
1
)
{
link_list
.
push
({
title
:
group_list
[
i
][
j
].
title
,
title
:
group_list
[
i
][
j
].
options
.
title
,
link
:
result_dict
.
url_list
[
k
]
});
k
+=
1
;
}
dom_list
.
push
(
generateSection
(
result_dict
.
translation_list
[
i
/
3
],
group_list
[
i
+
2
],
link_list
)
generateSection
(
result_dict
.
translation_list
[
i
/
2
],
group_list
[
i
+
1
],
link_list
)
);
}
...
...
@@ -164,4 +162,5 @@
return
;
});
}(
window
,
rJS
,
RSVP
,
domsugar
,
calculatePageTitle
,
ensureArray
));
}(
window
,
rJS
,
RSVP
,
domsugar
,
calculatePageTitle
,
ensureArray
,
mergeGlobalActionWithRawActionList
));
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_action_js.xml
View file @
30bdc0bb
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
989.
17757.52708.29969
</string>
</value>
<value>
<string>
989.
47954.24695.28433
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
161
0395382.6
</float>
<float>
161
2205919.8
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.html
View file @
30bdc0bb
...
...
@@ -23,7 +23,11 @@
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"domsugar.js"
type=
"text/javascript"
></script>
<script
src=
"jiodev.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_global.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_erp5_panel.js"
type=
"text/javascript"
></script>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
View file @
30bdc0bb
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
5.48809.10432.44578
</string>
</value>
<value>
<string>
98
9.30774.63276.56746
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>
1
596701351.5
</float>
<float>
1
611763679.73
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
View file @
30bdc0bb
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
30bdc0bb
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
8.65434.35774.5563
</string>
</value>
<value>
<string>
98
9.47833.1016.53060
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
16
09322633.89
</float>
<float>
16
12198632.86
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
30bdc0bb
...
...
@@ -281,9 +281,7 @@
]);
})
.
push
(
function
(
translated_title_list
)
{
var
field_href
,
form_definition
=
modification_dict
.
form_definition
,
action_confirm
=
form_gadget
.
element
.
querySelector
(
'
input.dialogconfirm
'
);
var
action_confirm
=
form_gadget
.
element
.
querySelector
(
'
input.dialogconfirm
'
);
if
(
action_confirm
!==
null
)
{
if
(
form_gadget
.
state
.
action_title
)
{
action_confirm
.
value
=
form_gadget
.
state
.
action_title
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
30bdc0bb
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
8.16932.41419.17169
</string>
</value>
<value>
<string>
98
9.30774.63276.56746
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
16
07348224.53
</float>
<float>
16
12183252.61
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
View file @
30bdc0bb
/*global window, rJS, RSVP, domsugar, URI, calculatePageTitle, ensureArray */
/*global window, rJS, RSVP, domsugar, URI, calculatePageTitle, ensureArray,
mergeGlobalActionWithRawActionList */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/** Page for displaying Views, Jump and BreadCrumb navigation for a document.
*/
(
function
(
window
,
rJS
,
RSVP
,
domsugar
,
URI
,
calculatePageTitle
,
ensureArray
)
{
(
function
(
window
,
rJS
,
RSVP
,
domsugar
,
URI
,
calculatePageTitle
,
ensureArray
,
mergeGlobalActionWithRawActionList
)
{
"
use strict
"
;
/** Go recursively up the parent-chain and insert breadcrumbs in the last argument.
...
...
@@ -101,31 +103,23 @@
jump_list
;
return
gadget
.
jio_getAttachment
(
gadget
.
state
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
var
i
,
url_for_kw_list
=
[];
erp5_document
=
result
;
view_list
=
ensureArray
(
erp5_document
.
_links
.
view
);
jump_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jio_jump
);
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
url_for_kw_list
.
push
({
command
:
'
display_with_history
'
,
options
:
{
jio_key
:
gadget
.
state
.
jio_key
,
view
:
view_list
[
i
].
href
,
page
:
undefined
// Views in ERP5 must be forms but because of
// OfficeJS we keep it empty for different default
}});
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
url_for_kw_list
.
push
({
command
:
'
display_dialog_with_history
'
,
options
:
{
jio_key
:
gadget
.
state
.
jio_key
,
view
:
jump_list
[
i
].
href
}});
}
return
mergeGlobalActionWithRawActionList
(
gadget
,
erp5_document
.
_links
,
[
"
view
"
,
"
action_object_jio_jump
"
]);
})
.
push
(
function
(
group_mapping
)
{
var
url_for_kw_list
=
[];
view_list
=
group_mapping
.
view
;
jump_list
=
group_mapping
.
action_object_jio_jump
;
url_for_kw_list
=
url_for_kw_list
.
concat
(
view_list
).
concat
(
jump_list
);
url_for_kw_list
.
push
({
command
:
'
cancel_dialog_with_history
'
});
return
RSVP
.
hash
({
url_list
:
gadget
.
getUrlForList
(
url_for_kw_list
),
_
:
modifyBreadcrumbList
(
gadget
,
...
...
@@ -135,21 +129,20 @@
page_title
:
calculatePageTitle
(
gadget
,
erp5_document
)
});
})
.
push
(
function
(
result_dict
)
{
var
i
,
j
=
0
;
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
tab_list
.
push
({
title
:
view_list
[
i
].
title
,
title
:
view_list
[
i
].
options
.
title
,
link
:
result_dict
.
url_list
[
j
]
});
j
+=
1
;
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
jump_action_list
.
push
({
title
:
jump_list
[
i
].
title
,
title
:
jump_list
[
i
].
options
.
title
,
link
:
result_dict
.
url_list
[
j
]
});
j
+=
1
;
...
...
@@ -171,4 +164,4 @@
return
;
});
}(
window
,
rJS
,
RSVP
,
domsugar
,
URI
,
calculatePageTitle
,
ensureArray
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
domsugar
,
URI
,
calculatePageTitle
,
ensureArray
,
mergeGlobalActionWithRawActionList
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.xml
View file @
30bdc0bb
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
1.62315.62619.21640
</string>
</value>
<value>
<string>
98
9.31920.37858.10717
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
582128721.85
</float>
<float>
1
611626994.73
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_translation_data_js.xml
View file @
30bdc0bb
...
...
@@ -224,12 +224,12 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<
none/
>
<
persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAY=
</string>
</persistent
>
</value>
</item>
<item>
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
46.45868.14105.29764
</string>
</value>
<value>
<string>
9
89.47814.22170.38929
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -256,8 +256,8 @@
</tuple>
<state>
<tuple>
<float>
1
445935505.72
</float>
<string>
GMT
</string>
<float>
1
612197547.78
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
...
...
@@ -331,4 +331,36 @@
</dictionary>
</pickle>
</record>
<record
id=
"6"
aka=
"AAAAAAAAAAY="
>
<pickle>
<global
name=
"Message"
module=
"Products.ERP5Type.Message"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string>
Translation data updated from web site ${web_site_id}.
</string>
</value>
</item>
<item>
<key>
<string>
domain
</string>
</key>
<value>
<string>
erp5_ui
</string>
</value>
</item>
<item>
<key>
<string>
mapping
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
web_site_id
</string>
</key>
<value>
<string>
renderjs_runner
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
message
</string>
</key>
<value>
<string>
Translation data updated from web site ${web_site_id}.
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui/bt/template_action_path_list
View file @
30bdc0bb
...
...
@@ -12,4 +12,5 @@ Web Site | create_translation_data
Web Style | version_view
Web Style | view
Web Style | view_editor
Web Style | web_view
\ No newline at end of file
Web Style | web_view
portal_actions | jump_to_portal_type
\ No newline at end of file
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testAccessPortalTypeDocument.zpt
View file @
30bdc0bb
...
...
@@ -29,12 +29,12 @@
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//ul[@class="document-listview"]/li/a[text()="Edit Portal Type
Preference
"]
</td>
<td>
//ul[@class="document-listview"]/li/a[text()="Edit Portal Type"]
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//ul[@class="document-listview"]/li/a[text()="Edit Portal Type
Preference
"]
</td>
<td>
//ul[@class="document-listview"]/li/a[text()="Edit Portal Type"]
</td>
<td></td>
</tr>
<tr>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testModuleAccessPortalTypeDocument.zpt
View file @
30bdc0bb
...
...
@@ -29,17 +29,17 @@
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
Edit Portal Type
Accounting Transaction Module
</td>
<td>
Edit Portal Type
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type
Accounting Transaction Module
"]
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type"]
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type
Accounting Transaction Module
"]
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type"]
</td>
<td></td>
</tr>
<tr>
...
...
@@ -54,12 +54,12 @@
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
Edit Portal Type
Base Type
</td>
<td>
Edit Portal Type
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type
Base Type
"]
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type"]
</td>
<td></td>
</tr>
<tr>
...
...
@@ -74,12 +74,17 @@
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
Edit Portal Type
Accounting Transaction Module
</td>
<td>
Edit Portal Type
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type Accounting Transaction Module"]
</td>
<td>
//dd[@class="document-listview"]/a[text()="Edit Portal Type"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[@data-i18n="Accounting"]
</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