Commit a6fbb478 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: filter action panel to only show meaningful actions in...

erp5_web_renderjs_ui: filter action panel to only show meaningful actions in the context of the web site
parent f9114449
...@@ -167,7 +167,8 @@ ...@@ -167,7 +167,8 @@
function mergeGlobalActionWithRawActionList(jio_key, view, jump_view, function mergeGlobalActionWithRawActionList(jio_key, view, jump_view,
link_list, group_id_list, link_list, group_id_list,
command_mapping, command_mapping,
editable_mapping) { editable_mapping,
filterMethod) {
var i, j, group, var i, j, group,
action_type, action_type,
current_href, current_href,
...@@ -230,11 +231,20 @@ ...@@ -230,11 +231,20 @@
} }
} }
} else { } else {
action_type = group;
group_mapping[group] = ensureArray( group_mapping[group] = ensureArray(
link_list[group] link_list[group]
); );
addRawUrlToGroupMapping(group, group + "_raw"); addRawUrlToGroupMapping(group, group + "_raw");
} }
// Filter action to only keep action related to web site context
if (filterMethod !== undefined) {
for (j = group_mapping[action_type].length - 1; 0 <= j; j -= 1) {
if (!filterMethod(group_mapping[action_type][j])) {
group_mapping[action_type].splice(j, 1);
}
}
}
} }
for (group in group_mapping) { for (group in group_mapping) {
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>991.63236.62412.49203</string> </value> <value> <string>1003.51428.45312.41796</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1620739824.54</float> <float>1666341502.97</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment