Commit 649ffd40 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] For refresh if render is called from parent gadget.

In reality, it should be done by internally only using changeState, but that's another story
parent 6514e4c7
...@@ -178,7 +178,8 @@ and handling data send&receive. ...@@ -178,7 +178,8 @@ and handling data send&receive.
erp5_document: undefined, erp5_document: undefined,
erp5_form: undefined, erp5_form: undefined,
url: undefined, url: undefined,
embedded: asBoolean(options.embedded) embedded: asBoolean(options.embedded),
is_refresh: options.is_refresh || false
}; };
// options.editable differs when it comes from the erp5_launcher of FormBox - try to unify it here // options.editable differs when it comes from the erp5_launcher of FormBox - try to unify it here
...@@ -277,7 +278,7 @@ and handling data send&receive. ...@@ -277,7 +278,7 @@ and handling data send&receive.
erp5_document = JSON.parse(gadget.state.erp5_document), erp5_document = JSON.parse(gadget.state.erp5_document),
erp5_form = JSON.parse(gadget.state.erp5_form); erp5_form = JSON.parse(gadget.state.erp5_form);
if (modification_dict.hasOwnProperty('url')) { if ((!gadget.state.is_refresh) || modification_dict.hasOwnProperty('url')) {
queue = gadget.declareGadget(gadget.state.url, {scope: "fg"}); queue = gadget.declareGadget(gadget.state.url, {scope: "fg"});
} else { } else {
queue = gadget.getDeclaredGadget("fg"); queue = gadget.getDeclaredGadget("fg");
...@@ -300,7 +301,7 @@ and handling data send&receive. ...@@ -300,7 +301,7 @@ and handling data send&receive.
return page_template_gadget.render(sub_options); return page_template_gadget.render(sub_options);
}) })
.push(function () { .push(function () {
if (modification_dict.hasOwnProperty('url')) { if ((!gadget.state.is_refresh) || modification_dict.hasOwnProperty('url')) {
return page_template_gadget.getElement() return page_template_gadget.getElement()
.push(function (fragment) { .push(function (fragment) {
var element = gadget.element; var element = gadget.element;
...@@ -409,6 +410,7 @@ and handling data send&receive. ...@@ -409,6 +410,7 @@ and handling data send&receive.
// We modify inplace state.options because render method uses and removes // We modify inplace state.options because render method uses and removes
// erp5_document hidden in its options. // erp5_document hidden in its options.
options.erp5_document = erp5_document; options.erp5_document = erp5_document;
options.is_refresh = true;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
if (response_view._notification === undefined) { if (response_view._notification === undefined) {
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.56533.48127.29525</string> </value> <value> <string>976.24235.55108.50397</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1558448080.86</float> <float>1560442327.31</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