Commit 0f0e7121 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: use hateoas action filter script

It allows to reuse the erp5js header gadget.

See nexedi/erp5!2039
parent d22e4e68
......@@ -3,8 +3,6 @@ url_list = [
'slapos_master_panel_access.js',
'gadget_erp5_page_slapos_master_panel_external_payment_result.html',
'slapos_master_panel_external_payment_result.js',
'slapos_master_panel_header.html',
'slapos_master_panel_header.js',
'slapos_master_panel_import_product.html',
'slapos_master_panel_import_product.js',
'slapos_master_panel_panel.html',
......
......@@ -281,6 +281,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_panel/PaymentTransaction_triggerPaymentCheckAlarmAndRedirectToPanel',
'slapos_panel/SoftwareInstance_getComputeNodeUrl',
'slapos_panel_compatibility/Base_getComputerToken',
'slapos_panel/WebSection_filterSlaposPanelActionDict',
'slapos_parameter_editor/SoftwareProductModule_updateParameterEditorTestDialog',
'slapos_parameter_editor/SoftwareProductModule_validateParameterEditorTestDialog',
'slapos_parameter_editor/SoftwareProductModule_validateSoftwareReleaseForParameterEditorTestDialog',
......
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=Front
data-i18n=Previous
data-i18n=Cancel
data-i18n=Back
data-i18n=Editable
data-i18n=Viewable
data-i18n=New
data-i18n=Save
data-i18n=Proceed
data-i18n=Add
data-i18n=Filter
data-i18n=Views
data-i18n=Jump
data-i18n=Delete
data-i18n=Export
data-i18n=Actions
data-i18n=Cut
data-i18n=Add
data-i18n=Previous
data-i18n=Next
data-i18n=Loading
data-i18n=Fast Input
data-i18n=Language
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 Header</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_header.html">
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!-- custom script -->
<script src="slapos_master_panel_header.js" type="text/javascript"></script>
</head>
<body>
<div data-role="header" class="ui-header">
<div class="ui-btn-left">
<div class="ui-controlgroup-controls">
</div>
</div>
<h1></h1>
<div class="ui-btn-right">
<div class="ui-controlgroup-controls">
</div>
</div>
<div class="ui-subheader">
<ul>
</ul>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -104,8 +104,6 @@
"action_object_clone_action": "display_dialog_with_history"
}, {
"action_object_clone_action": true
}, function filter(action) {
return (action.name.indexOf('slapos') !== -1);
});
workflow_list = JSON.stringify(group_mapping.action_workflow);
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1013.57437.64230.29320</string> </value>
<value> <string>1021.58357.56828.19046</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1705332675.51</float>
<float>1736327288.57</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -437,7 +437,9 @@
</item>
<item>
<key> <string>configuration_header_gadget_url</string> </key>
<value> <string>slapos_master_panel_header.html</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_icon_url</string> </key>
......@@ -756,7 +758,7 @@ WebSection_getPanelPrecacheManifestList</string> </value>
<item>
<key> <string>comment</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAs=</string> </persistent>
<none/>
</value>
</item>
<item>
......@@ -765,7 +767,7 @@ WebSection_getPanelPrecacheManifestList</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1020.19478.47544.40584</string> </value>
<value> <string>1021.58354.4516.21589</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -785,7 +787,7 @@ WebSection_getPanelPrecacheManifestList</string> </value>
</tuple>
<state>
<tuple>
<float>1730148383.59</float>
<float>1736327305.36</float>
<string>UTC</string>
</tuple>
</state>
......@@ -799,31 +801,4 @@ WebSection_getPanelPrecacheManifestList</string> </value>
</dictionary>
</pickle>
</record>
<record id="11" aka="AAAAAAAAAAs=">
<pickle>
<global name="Message" module="Products.ERP5Type.Message"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>Translation data updated.</string> </value>
</item>
<item>
<key> <string>domain</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>mapping</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>message</string> </key>
<value> <string>Translation data updated.</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -174,6 +174,16 @@
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_filter_action_script_id</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
......@@ -203,6 +213,10 @@
</tuple>
</value>
</item>
<item>
<key> <string>configuration_filter_action_script_id</string> </key>
<value> <string>WebSection_filterSlaposPanelActionDict</string> </value>
</item>
<item>
<key> <string>configuration_login</string> </key>
<value> <string>connection/login_form{?came_from}</string> </value>
......@@ -466,7 +480,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1014.6188.10537.18773</string> </value>
<value> <string>1021.45456.10756.3003</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -486,7 +500,7 @@
</tuple>
<state>
<tuple>
<float>1707822098.93</float>
<float>1736326074.9</float>
<string>UTC</string>
</tuple>
</state>
......
filtered_action_dict = {}
for action_category_name, action_list in action_dict.items():
filtered_action_dict[action_category_name] = [action for action in action_list if 'slapos' in action['id']]
return filtered_action_dict
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>action_dict</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_filterSlaposPanelActionDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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