Commit 8a35fe2e authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fix history navigation by setting selection_url

parent f878bc64
...@@ -172,11 +172,13 @@ ...@@ -172,11 +172,13 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}) gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
selection_url: url_list[1],
page_title: gadget.state.doc.title, page_title: gadget.state.doc.title,
save_action: true save_action: true
}; };
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.18670.13781.59596</string> </value> <value> <string>964.25688.27741.426</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>1514293945.35</float> <float>1519840189.99</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -306,7 +306,8 @@ ...@@ -306,7 +306,8 @@
gadget.getUrlFor({command: "change", options: {page: "slap_computer_request_certificate"}}), gadget.getUrlFor({command: "change", options: {page: "slap_computer_request_certificate"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_computer_revoke_certificate"}}), gadget.getUrlFor({command: "change", options: {page: "slap_computer_revoke_certificate"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_rss_ticket"}}), gadget.getUrlFor({command: "change", options: {page: "slap_rss_ticket"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_transfer_computer"}}) gadget.getUrlFor({command: "change", options: {page: "slap_transfer_computer"}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
...@@ -318,6 +319,7 @@ ...@@ -318,6 +319,7 @@
revoke_certificate_url: url_list[4], revoke_certificate_url: url_list[4],
rss_url: url_list[5], rss_url: url_list[5],
transfer_url: url_list[6], transfer_url: url_list[6],
selection_url: url_list[7],
save_action: true save_action: true
}; };
if (!gadget.state.editable) { if (!gadget.state.editable) {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.22340.34561.5051</string> </value> <value> <string>965.32357.28484.18978</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>1518626245.91</float> <float>1519839785.23</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -148,6 +148,8 @@ ...@@ -148,6 +148,8 @@
], parameter_dict = { ], parameter_dict = {
'parameter' : { 'parameter' : {
'json_url': gadget.state.doc.url_string + ".json", 'json_url': gadget.state.doc.url_string + ".json",
'softwaretype': gadget.state.doc.source_reference,
'shared': gadget.state.doc.root_slave ? 1: 0,
//'json_url': "https://lab.node.vifib.com/nexedi/slapos/raw/master/software/kvm/software.cfg.json", //'json_url': "https://lab.node.vifib.com/nexedi/slapos/raw/master/software/kvm/software.cfg.json",
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>'), 'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>'),
'restricted_softwaretype': true 'restricted_softwaretype': true
...@@ -361,8 +363,8 @@ ...@@ -361,8 +363,8 @@
gadget.getUrlFor({command: "change", options: {"page": "slap_start_hosting_subscription"}}), gadget.getUrlFor({command: "change", options: {"page": "slap_start_hosting_subscription"}}),
gadget.getUrlFor({command: "change", options: {"page": "slap_stop_hosting_subscription"}}), gadget.getUrlFor({command: "change", options: {"page": "slap_stop_hosting_subscription"}}),
gadget.getUrlFor({command: "change", options: {"page": "slap_destroy_hosting_subscription"}}), gadget.getUrlFor({command: "change", options: {"page": "slap_destroy_hosting_subscription"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_rss_ticket"}}) gadget.getUrlFor({command: "change", options: {page: "slap_rss_ticket"}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
...@@ -371,6 +373,7 @@ ...@@ -371,6 +373,7 @@
ticket_url: url_list[1], ticket_url: url_list[1],
destroy_url: url_list[4], destroy_url: url_list[4],
rss_url: url_list[5], rss_url: url_list[5],
selection_url: url_list[6],
save_action: true save_action: true
}; };
if (gadget.state.doc.slap_state === "start_requested") { if (gadget.state.doc.slap_state === "start_requested") {
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</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>965.44973.60841.22613</string> </value> <value> <string>965.52537.30720.54476</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>1519383466.28</float> <float>1519839464.14</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -223,11 +223,13 @@ ...@@ -223,11 +223,13 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}) gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
selection_url: url_list[1],
page_title: "Site : " + gadget.state.doc.title, page_title: "Site : " + gadget.state.doc.title,
save_action: true save_action: true
}; };
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.22308.54466.53742</string> </value> <value> <string>965.22310.48800.7492</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>1518023444.62</float> <float>1519839885.6</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -113,7 +113,8 @@ ...@@ -113,7 +113,8 @@
gadget.getUrlFor({command: "change", options: {editable: true}}), gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: "change", options: {page: "slap_person_revoke_certificate"}}), gadget.getUrlFor({command: "change", options: {page: "slap_person_revoke_certificate"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_person_request_certificate"}}), gadget.getUrlFor({command: "change", options: {page: "slap_person_request_certificate"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_person_get_token"}}) gadget.getUrlFor({command: "change", options: {page: "slap_person_get_token"}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
...@@ -122,7 +123,8 @@ ...@@ -122,7 +123,8 @@
save_action: true, save_action: true,
request_certificate_url: url_list[2], request_certificate_url: url_list[2],
revoke_certificate_url: url_list[1], revoke_certificate_url: url_list[1],
token_url: url_list[3] token_url: url_list[3],
selection_url: url_list[4]
}; };
if (!gadget.state.editable) { if (!gadget.state.editable) {
header_dict.edit_content = url_list[0]; header_dict.edit_content = url_list[0];
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509612213.9</float> <float>1519840315.92</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -185,11 +185,13 @@ ...@@ -185,11 +185,13 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}) gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
selection_url: url_list[1],
page_title: gadget.state.doc.title, page_title: gadget.state.doc.title,
save_action: true save_action: true
}; };
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.7077.52697.19507</string> </value> <value> <string>964.25686.34120.2013</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>1514293831.19</float> <float>1519840228.63</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -214,14 +214,15 @@ ...@@ -214,14 +214,15 @@
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}), gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: "change", options: {page: "slap_add_related_event", editable: true}}) gadget.getUrlFor({command: "change", options: {page: "slap_add_related_event", editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
page_title: "Upgrade Decision : " + gadget.state.doc.title, page_title: "Regularisation Request : " + gadget.state.doc.title,
add_url: url_list[1] add_url: url_list[1],
selection_url: url_list[2]
}; };
return gadget.updateHeader(header_dict); return gadget.updateHeader(header_dict);
}); });
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519232359.93</float> <float>1519839694.72</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -156,12 +156,16 @@ ...@@ -156,12 +156,16 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}) gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var start_date = new Date(gadget.state.doc.start_date), var start_date = new Date(gadget.state.doc.start_date),
header_dict = {page_title: "Invoice : " + start_date.toUTCString()}; header_dict = {
selection_url: url_list[1],
page_title: "Invoice : " + start_date.toUTCString()
};
if (!gadget.state.editable) { if (!gadget.state.editable) {
header_dict.edit_content = url_list[0]; header_dict.edit_content = url_list[0];
} }
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.22103.26552.47598</string> </value> <value> <string>965.22110.58962.31914</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>1518011453.92</float> <float>1519840089.42</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -172,12 +172,16 @@ ...@@ -172,12 +172,16 @@
}); });
}) })
.push(function () { .push(function () {
return gadget.getUrlFor({command: "change", options: {"page": "slap_destroy_software_installation"}}); return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "slap_destroy_software_installation"}}),
gadget.getUrlFor({command: 'history_previous'})
]);
}) })
.push(function (url) { .push(function (url_list) {
var header_dict = { var header_dict = {
selection_url: url_list[1],
page_title: "Software Installation : " + gadget.state.doc.software_release_title, page_title: "Software Installation : " + gadget.state.doc.software_release_title,
destroy_url: url destroy_url: url_list[0]
}; };
return gadget.updateHeader(header_dict); return gadget.updateHeader(header_dict);
}); });
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.22196.14970.20087</string> </value> <value> <string>965.22201.19033.38092</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>1518016877.37</float> <float>1519839991.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -210,11 +210,13 @@ ...@@ -210,11 +210,13 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}) gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
selection_url: url_list[1],
page_title: gadget.state.doc.portal_type + page_title: gadget.state.doc.portal_type +
" : " + gadget.state.doc.title " : " + gadget.state.doc.title
}; };
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.22413.11243.43315</string> </value> <value> <string>965.22416.58700.19182</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>1518029813.69</float> <float>1519839839.98</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -214,14 +214,15 @@ ...@@ -214,14 +214,15 @@
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}), gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: "change", options: {page: "slap_add_related_event", editable: true}}) gadget.getUrlFor({command: "change", options: {page: "slap_add_related_event", editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
page_title: "Ticket : " + gadget.state.doc.title, page_title: "Support Request : " + gadget.state.doc.title,
add_url: url_list[1] add_url: url_list[1],
selection_url: url_list[6]
}; };
return gadget.updateHeader(header_dict); return gadget.updateHeader(header_dict);
}); });
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</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>965.42336.49617.6348</string> </value> <value> <string>965.52582.23389.44953</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>1519232298.79</float> <float>1519839745.96</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -214,14 +214,15 @@ ...@@ -214,14 +214,15 @@
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getUrlFor({command: "change", options: {editable: true}}), gadget.getUrlFor({command: "change", options: {editable: true}}),
gadget.getUrlFor({command: "change", options: {page: "slap_add_related_event", editable: true}}) gadget.getUrlFor({command: "change", options: {page: "slap_add_related_event", editable: true}}),
gadget.getUrlFor({command: 'history_previous'})
]); ]);
}) })
.push(function (url_list) { .push(function (url_list) {
var header_dict = { var header_dict = {
page_title: "Upgrade Decision : " + gadget.state.doc.title, page_title: "Upgrade Decision : " + gadget.state.doc.title,
add_url: url_list[1] add_url: url_list[1],
selection_url: url_list[2]
}; };
return gadget.updateHeader(header_dict); return gadget.updateHeader(header_dict);
}); });
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</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>965.42382.57800.29883</string> </value> <value> <string>965.42461.15.870</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>1519232459.97</float> <float>1519839590.8</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