Commit 9ee80ebb authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Update UI to user edit Upgrade Scope on the Computer/Hosting Subscription

parent 095256fd
...@@ -119,6 +119,10 @@ ...@@ -119,6 +119,10 @@
monitor_scope_list = [['', ''], monitor_scope_list = [['', ''],
['Enabled', 'enable'], ['Enabled', 'enable'],
['Disabled', 'disable']], ['Disabled', 'disable']],
upgrade_scope_list = [['', ''],
['Auto Upgrade', 'auto'],
['Ask Confirmation before Upgrade', 'ask_confirmation'],
['Never Upgrade', 'never']],
allocation_scope_list = [['', ''], allocation_scope_list = [['', ''],
['Closed for maintenance', 'close/maintenance'], ['Closed for maintenance', 'close/maintenance'],
['Closed for termination', 'close/termination'], ['Closed for termination', 'close/termination'],
...@@ -210,6 +214,18 @@ ...@@ -210,6 +214,18 @@
"hidden": (gadget.state.doc.allocation_scope === "open/friend") ? 0 : 1, "hidden": (gadget.state.doc.allocation_scope === "open/friend") ? 0 : 1,
"type": "LinesField" "type": "LinesField"
}, },
"my_upgrade_scope": {
"description": "",
"title": "Upgrade",
"default": gadget.state.doc.upgrade_scope,
"css_class": "",
"items": upgrade_scope_list,
"required": 1,
"editable": 1,
"key": "upgrade_scope",
"hidden": 0,
"type": "ListField"
},
"my_source": { "my_source": {
"description": "The name of a document in ERP5", "description": "The name of a document in ERP5",
"title": "Current Site", "title": "Current Site",
...@@ -301,7 +317,8 @@ ...@@ -301,7 +317,8 @@
], [ ], [
"right", "right",
[["my_source"], ["my_source_project"], ["my_monitor_scope"], [["my_source"], ["my_source_project"], ["my_monitor_scope"],
["my_allocation_scope"], ["my_subject_list"]] ["my_upgrade_scope"], ["my_allocation_scope"],
["my_subject_list"]]
], [ ], [
"bottom", "bottom",
[["ticket_listbox"], ["listbox"]] [["ticket_listbox"], ["listbox"]]
......
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.38762.9625.45482</string> </value> <value> <string>974.59075.20655.52309</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1545932477.94</float> <float>1554755115.93</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -147,6 +147,10 @@ ...@@ -147,6 +147,10 @@
], monitor_scope_list = [['', ''], ], monitor_scope_list = [['', ''],
['Enabled', 'enable'], ['Enabled', 'enable'],
['Disabled', 'disable'] ['Disabled', 'disable']
], upgrade_scope_list = [['', ''],
['Auto Upgrade', 'auto'],
['Ask Confirmation before Upgrade', 'ask_confirmation'],
['Never Upgrade', 'never']
], ticket_column_list = [ ], ticket_column_list = [
['title', 'Title'], ['title', 'Title'],
['reference', 'Reference'], ['reference', 'Reference'],
...@@ -291,6 +295,18 @@ ...@@ -291,6 +295,18 @@
"hidden": 0, "hidden": 0,
"type": "ListField" "type": "ListField"
}, },
"my_upgrade_scope": {
"description": "",
"title": "Upgrade",
"default": gadget.state.doc.upgrade_scope,
"css_class": "",
"items": upgrade_scope_list,
"required": 1,
"editable": 1,
"key": "upgrade_scope",
"hidden": 0,
"type": "ListField"
},
"connection_listbox": { "connection_listbox": {
"column_list": connection_column_list, "column_list": connection_column_list,
"show_anchor": 0, "show_anchor": 0,
...@@ -374,7 +390,7 @@ ...@@ -374,7 +390,7 @@
], [ ], [
"right", "right",
[["my_slap_state_title"], ['my_monitoring_status'], ['my_monitor_scope']] [["my_slap_state_title"], ['my_monitoring_status'], ['my_monitor_scope'], ['my_upgrade_scope']]
], ["center", ], ["center",
[["my_source_reference"], ["my_url_string"]] [["my_source_reference"], ["my_url_string"]]
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>superrafael</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.50467.55565.53623</string> </value> <value> <string>974.50791.18350.19558</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1554251651.88</float> <float>1554751476.78</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
<string>my_source_title</string> <string>my_source_title</string>
<string>my_source_project_title</string> <string>my_source_project_title</string>
<string>my_monitor_scope</string> <string>my_monitor_scope</string>
<string>my_upgrade_scope</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_upgrade_scope</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -5,6 +5,8 @@ edit_kw = {} ...@@ -5,6 +5,8 @@ edit_kw = {}
if monitor_scope is not None and monitor_scope != context.getMonitorScope(): if monitor_scope is not None and monitor_scope != context.getMonitorScope():
edit_kw["monitor_scope"] = monitor_scope edit_kw["monitor_scope"] = monitor_scope
if upgrade_scope is not None and upgrade_scope != context.getUpgradeScope():
edit_kw["upgrade_scope"] = upgrade_scope
if short_title != context.getShortTitle(): if short_title != context.getShortTitle():
edit_kw["short_title"] = short_title edit_kw["short_title"] = short_title
...@@ -24,7 +26,7 @@ def isSoftwareTypeChanged(software_type): ...@@ -24,7 +26,7 @@ def isSoftwareTypeChanged(software_type):
return current_software_type != software_type return current_software_type != software_type
if 'software_type' in request and isSoftwareTypeChanged(request['software_type']): if 'software_type' in request and isSoftwareTypeChanged(request['software_type']):
raise ValueError("Change Software Type is forbidden.") raise ValueError("Change Software Type is forbidden.")
if context.getTextContent() != text_content: if context.getTextContent() != text_content:
context.HostingSubscription_requestPerson(instance_xml=request['text_content']) context.HostingSubscription_requestPerson(instance_xml=request['text_content'])
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>text_content, short_title, description, monitor_scope=None</string> </value> <value> <string>text_content, short_title, description, monitor_scope=None, upgrade_scope=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<string>my_root_slave</string> <string>my_root_slave</string>
<string>my_monitor_scope</string> <string>my_monitor_scope</string>
<string>my_connection_parameter_list</string> <string>my_connection_parameter_list</string>
<string>my_upgrade_scope</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_upgrade_scope</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Upgrade Scope</string> </value>
</item>
</dictionary>
</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