Commit 4a927725 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Wrapper getUrlForList instead getUrlFor

Reimplement the wrapper to follow up this change:

erp5@f9c408f7
parent 7c22321a
...@@ -9,22 +9,23 @@ ...@@ -9,22 +9,23 @@
.declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs") .declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.allowPublicAcquisition("getUrlFor", function (param_list) { .allowPublicAcquisition("getUrlForList", function (promise_list) {
var gadget = this;
if ((param_list[0].command === "index") && (param_list[0].options.jio_key) && var index, param_list, gadget = this;
(param_list[0].options.jio_key.startsWith("software_product_module"))) { for (index in promise_list[0]) {
param_list[0].options.page = "slap_select_software_release"; if ((promise_list[0][index].command === "index") && (promise_list[0][index].options.jio_key) &&
if (gadget.computer_jio_key !== undefined) { (promise_list[0][index].options.jio_key.startsWith("software_product_module"))) {
param_list[0].options.computer_jio_key = gadget.computer_jio_key; promise_list[0][index].options.page = "slap_select_software_release";
if (gadget.computer_jio_key !== undefined) {
promise_list[0][index].options.computer_jio_key = gadget.computer_jio_key;
}
} }
} }
return gadget.getUrlFor(param_list[0]) return gadget.getUrlForList(promise_list[0]);
.push(function (result) {
return result;
});
}) })
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
...@@ -95,9 +96,15 @@ ...@@ -95,9 +96,15 @@
} }
}); });
}) })
.push(function (result) { .push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {"page": "slap_controller"}})
]);
})
.push(function (url_list) {
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Select one Software", page_title: "Select one Software",
selection_url: url_list[0],
filter_action: true filter_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.7.40651.47240</string> </value> <value> <string>972.37756.33633.30481</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>1512753759.32</float> <float>1545870712.4</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,24 +10,26 @@ ...@@ -10,24 +10,26 @@
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs") .declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_get", "jio_get")
.allowPublicAcquisition("getUrlFor", function (param_list) {
var gadget = this; .allowPublicAcquisition("getUrlForList", function (promise_list) {
if ((param_list[0].command === "index") && (param_list[0].options.jio_key) &&
(param_list[0].options.jio_key.startsWith("software_release_module"))) { var index, param_list, gadget = this;
if (gadget.computer_jio_key !== undefined) { for (index in promise_list[0]) {
param_list[0].options.page = "slap_add_software_installation"; if ((promise_list[0][index].command === "index") && (promise_list[0][index].options.jio_key) &&
param_list[0].options.computer_jio_key = gadget.computer_jio_key; (promise_list[0][index].options.jio_key.startsWith("software_release_module"))) {
} else { if (gadget.computer_jio_key !== undefined) {
param_list[0].options.page = "slap_add_hosting_subscription"; promise_list[0][index].options.page = "slap_add_software_installation";
promise_list[0][index].options.computer_jio_key = gadget.computer_jio_key;
} else {
promise_list[0][index].options.page = "slap_add_hosting_subscription";
}
} }
} }
return gadget.getUrlFor(param_list[0]) return gadget.getUrlForList(promise_list[0]);
.push(function (result) {
return result;
});
}) })
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
...@@ -104,9 +106,15 @@ ...@@ -104,9 +106,15 @@
}); });
}); });
}) })
.push(function (result) { .push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {"page": "slap_select_software_product"}})
]);
})
.push(function (url_list) {
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Select one Release", page_title: "Select one Release",
selection_url: url_list[0],
filter_action: true filter_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.7896.10186.10564</string> </value> <value> <string>972.37768.39754.62054</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>1512753841.61</float> <float>1545871468.02</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