Commit 5e430ca2 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Keep InstanceTree_view links intact on listbox

   This custom approach is used on Panel View and it is only working properly for Panel View since the gadget that will be redirected into is the slapos_panel_view.

   When use normal renderjs_runner it may cause confusion, so keep the URLs just pointing to normal locations.
parent b719f50f
Pipeline #36713 failed with stage
in 0 seconds
......@@ -20,7 +20,6 @@
<string>search_columns</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
</list>
</value>
</item>
......@@ -233,29 +232,6 @@
<key> <string>title</string> </key>
<value> <string>Software Instances</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>aggregate_title</string>
<string>SoftwareInstance_getPartitionUrl</string>
</tuple>
<tuple>
<string>aggregate_parent_title</string>
<string>SoftwareInstance_getComputeNodeUrl</string>
</tuple>
<tuple>
<string>aggregate_parent_reference</string>
<string>SoftwareInstance_getComputeNodeUrl</string>
</tuple>
<tuple>
<string>aggregate_parent_subordination_title</string>
<string>SoftwareInstance_getComputeNodeUrl</string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
......
......@@ -293,7 +293,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_panel/ComputePartition_getInstanceUrlString',
'slapos_panel/ComputePartition_getOwnerUrl',
'slapos_panel/SoftwareInstance_getComputeNodeUrl',
'slapos_panel/SoftwareInstance_getPartitionUrl',
'slapos_panel_compatibility/Base_getComputerToken',
'slapos_parameter_editor/SoftwareProductModule_updateParameterEditorTestDialog',
'slapos_parameter_editor/SoftwareProductModule_validateParameterEditorTestDialog',
......
# Script to generate URL for compute_node partiton of Software Instances
# both for XHTML UI as well as renderJS UI
if brain is None:
brain = context
# 'brain' in this case is the Software Instance, hence trying to get
# the partition as it it related to the Software Instance with 'aggregate'
# category, hence, this will get us the relative URL of the aggregate
partition = brain.getAggregateValue()
if partition is None:
return None
if url_dict: # if RenderJS UI
jio_key = partition.getRelativeUrl()
return {
'command': 'push_history',
'view_kw': {
'view': 'slapos_panel_view',
'jio_key': jio_key,
},
'options': {
'jio_key': jio_key
},
}
else:
return partition.absolute_url()
<?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>url_dict=False, brain=None, selection=None, selection_name=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getPartitionUrl</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