Commit 9763d33a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fixes for navigation when request/revoke tokens and certificates

parent 10c4ac32
......@@ -108,9 +108,15 @@
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: "slap_computer_list"}})
]);
})
.push(function (url_list) {
var header_dict = {
page_title: "Request New Token",
submit_action: true
submit_action: true,
selection_url: url_list[0]
};
return gadget.updateHeader(header_dict);
});
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.11783.35902.34747</string> </value>
<value> <string>963.13252.46039.12646</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1509614011.63</float>
<float>1523376496.21</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -121,10 +121,16 @@
}
});
})
.push(function () {
.push(function (result) {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
var header_dict = {
page_title: "Request New Certificate",
submit_action: true
submit_action: true,
selection_url: url_list[0]
};
return gadget.updateHeader(header_dict);
});
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9183.27618.62976</string> </value>
<value> <string>963.9426.27532.17049</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1509467572.68</float>
<float>1523382684.29</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -98,10 +98,16 @@
}
});
})
.push(function () {
.push(function (result) {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Revoke Computer Certificate",
submit_action: true
submit_action: true,
selection_url: url_list[0]
});
});
});
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9179.31358.47206</string> </value>
<value> <string>963.9426.27532.17049</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1509457711.73</float>
<float>1523382738.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -111,9 +111,15 @@
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: "slap_person_view"}})
]);
})
.push(function (url_list) {
var header_dict = {
page_title: "Request New Token",
submit_action: true
submit_action: true,
selection_url: url_list[0]
};
return gadget.updateHeader(header_dict);
});
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.11778.2343.53282</string> </value>
<value> <string>963.13252.46039.12646</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1509613804.28</float>
<float>1523440041.74</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -121,10 +121,16 @@
}
});
})
.push(function () {
.push(function (result) {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: 'slap_person_view'}})
]);
})
.push(function (url_list) {
var header_dict = {
page_title: "Request New Certificate",
submit_action: true
submit_action: true,
selection_url: url_list[0]
};
return gadget.updateHeader(header_dict);
});
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.9343.28182.38178</string> </value>
<value> <string>966.51407.11575.14882</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1509467517.63</float>
<float>1523442542.74</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -98,11 +98,18 @@
}
});
})
.push(function () {
return gadget.updateHeader({
.push(function (result) {
return RSVP.all([
gadget.getUrlFor({command: 'change', options: {page: 'slap_person_view'}})
]);
})
.push(function (url_list) {
var header_dict = {
page_title: "Revoke Person Certificate",
submit_action: true
});
submit_action: true,
selection_url: url_list[0]
};
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.8908.56192.28808</string> </value>
<value> <string>966.51407.14598.40925</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1509442196.32</float>
<float>1523442545.33</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,12 +15,30 @@
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("jio_put", "jio_put")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('updateDocument', function (content) {
var gadget = this, property, doc = {};
for (property in content) {
if ((content.hasOwnProperty(property)) &&
// Remove undefined keys added by Gadget fields
(property !== "undefined") &&
// Remove listboxes UIs
(property !== "listbox_uid:list") &&
// Remove default_*:int keys added by ListField
!(property.endsWith(":int") && property.startsWith("default_"))) {
doc[property] = content[property];
}
}
return gadget.jio_put(gadget.state.jio_key, doc);
})
.declareMethod("render", function (options) {
var gadget = this,
jio_key;
......@@ -53,7 +71,12 @@
return form_gadget.getContent();
})
.push(function (content) {
return gadget.updateDocument(content);
return gadget.updateDocument(content)
.push(function () {
return gadget.updateHeader({
page_title: "Your Account : " + content.first_name + " " + content.last_name
});
});
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
......@@ -125,11 +148,14 @@
});
})
.push(function () {
return gadget.getSetting("me");
})
.push(function (me) {
return RSVP.all([
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_request_certificate"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_person_get_token"}}),
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_revoke_certificate"}}),
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_request_certificate"}}),
gadget.getUrlFor({command: "change", options: {jio_key: me, page: "slap_person_get_token"}}),
gadget.getUrlFor({command: "change", options: {page: "slapos"}})
]);
})
......
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -241,7 +241,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.43122.58529.31436</string> </value>
<value> <string>966.51361.49328.12834</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -259,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>1522945214.2</float>
<float>1523440982.76</float>
<string>UTC</string>
</tuple>
</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