Commit bd5e345c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fix Account link on Panel after the login.

While !login is called, the panel is rendered before the n.me is modified, so the link for "Account" on the panel is wrong until the user refresh the site after login.
parent 069e8152
......@@ -10,6 +10,8 @@
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
......@@ -20,11 +22,25 @@
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
var gadget = this,
jio_key;
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("me");
})
.push(function (me) {
jio_key = me;
return gadget.jio_get(me);
})
.push(function (doc) {
options.doc = doc;
return gadget.changeState({
jio_key: jio_key,
doc: doc,
editable: 1
});
});
})
.onEvent('submit', function () {
......
......@@ -39,6 +39,17 @@
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
......@@ -216,7 +227,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>ERP5TypeTestCase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -230,7 +241,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.11755.3689.23091</string> </value>
<value> <string>966.43122.58529.31436</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>1519840315.92</float>
<float>1522945214.2</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -90,9 +90,6 @@
if (modification_dict.hasOwnProperty("global")) {
queue
.push(function () {
return context.getSetting('me');
})
.push(function (me) {
return RSVP.all([
context.getUrlFor({command: 'display', options: {page: "logout"}}),
context.getUrlFor({command: 'display', options: {page: "search", editable: true}}),
......@@ -103,7 +100,7 @@
context.getUrlFor({command: 'display', options: {page: "slap_computer_list", editable: true}}),
context.getUrlFor({command: 'display', options: {page: "slap_network_list", editable: true}}),
context.getUrlFor({command: 'display', options: {page: "slap_project_list", editable: true}}),
context.getUrlFor({command: 'display', options: {jio_key: me, page: "slap_controller", editable: true}})
context.getUrlFor({command: 'display', options: {page: "slap_person_view", editable: true}})
]);
})
.push(function (result_list) {
......
......@@ -39,6 +39,17 @@
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
......@@ -230,7 +241,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.57491.46790.33894</string> </value>
<value> <string>966.41526.6603.40089</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>1519396462.37</float>
<float>1522944680.15</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