Commit f1c464fd authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Protect getContent with a mutex

parent 9e2fd3d5
......@@ -81,7 +81,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -91,5 +91,5 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.4135.1398.9574</string> </value>
<value> <string>964.58673.54614.19165</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1505315155.72</float>
<float>1516273481.45</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -364,7 +364,7 @@
});
}
return result;
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
var gadget = this;
......@@ -375,6 +375,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -224,7 +224,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.2047.43587.43144</string> </value>
<value> <string>964.28338.34111.16742</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -242,8 +242,8 @@
</tuple>
<state>
<tuple>
<float>1516809315.48</float>
<string>GMT+1</string>
<float>1516273374.69</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
......@@ -60,7 +60,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -70,6 +70,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.51162.4768.35123</string> </value>
<value> <string>964.58690.62622.54732</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843519.98</float>
<float>1516274124.26</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -58,7 +58,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -68,6 +68,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.51162.4768.35123</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843418.41</float>
<float>1516274354.26</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -105,7 +105,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -115,6 +115,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS, Math));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.40246.8021.32017</string> </value>
<value> <string>964.3910.33744.24644</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1512458225.4</float>
<float>1516274429.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -225,7 +225,7 @@
return gadget.props.listbox_gadget.getListboxInfo();
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod("getContent", function (options) {
var form_gadget = this,
k,
......@@ -259,7 +259,7 @@
.push(function () {
return data;
});
})
}, {mutex: 'changestate'})
.declareMethod("checkValidity", function () {
var form_gadget = this,
k,
......@@ -286,6 +286,6 @@
return result;
});
});
}, {mutex: 'changestate'});
}(window, document, rJS, RSVP));
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.25533.41108.47530</string> </value>
<value> <string>964.58561.19908.14080</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1515496577.67</float>
<float>1516274548.88</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,6 +79,6 @@
.push(function (result) {
return result.getContent();
});
});
}, {mutex: 'changestate'});
}(window, rJS, document));
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.24020.58652.57139</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1507901872.84</float>
<float>1516274684.77</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -62,7 +62,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -72,6 +72,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.15712.57649.37376</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843064.62</float>
<float>1516274738.47</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -185,7 +185,7 @@
}
return true;
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
var argument_list = arguments;
......@@ -196,7 +196,7 @@
}
return {};
});
})
}, {mutex: 'changestate'})
.declareMethod('getListboxInfo', function () {
var argument_list = arguments;
......@@ -204,7 +204,7 @@
.push(function (gadget) {
return gadget.getListboxInfo.apply(gadget, argument_list);
});
})
}, {mutex: 'changestate'})
.allowPublicAcquisition("notifyInvalid", function (param_list) {
return this.changeState({error_text: param_list[0]});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.7149.35202.27306</string> </value>
<value> <string>964.8273.15694.60620</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1513181723.22</float>
<float>1516274849.55</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -761,7 +761,7 @@
data[form_gadget.props.listbox_uid_dict.key] = form_gadget.props.listbox_uid_dict.value;
return data;
});
})
}, {mutex: 'changestate'})
.onEvent('click', function (evt) {
var gadget = this,
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.49926.23272.20514</string> </value>
<value> <string>964.57356.13308.65211</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1515755492.39</float>
<float>1516194029.5</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -96,7 +96,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -106,6 +106,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.51162.4768.35123</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843508.73</float>
<float>1516274989.51</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -143,5 +143,5 @@
});
}
return final_result;
});
}, {mutex: 'changestate'});
}(window, rJS, RSVP, document));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.24032.27808.24456</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1490947237.26</float>
<float>1516282312.66</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -133,7 +133,7 @@
});
}
return final_result;
})
}, {mutex: 'changestate'})
.allowPublicAcquisition('notifyValid', function () {
return;
......@@ -194,6 +194,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS, document, RSVP));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.38785.31645.18483</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1507301921.45</float>
<float>1516282402.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -239,6 +239,6 @@
});
}
return final_result;
});
}, {mutex: 'changestate'});
}(window, rJS, RSVP, document));
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.60244.25298.44253</string> </value>
<value> <string>964.45640.391.48230</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516369404.81</float>
<float>1516282515.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -42,19 +42,19 @@
.push(function (g) {
return g.triggerSubmit();
});
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
return this.getDeclaredGadget('fg')
.push(function (declared_gadget) {
return declared_gadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
return this.getDeclaredGadget('fg')
.push(function (declared_gadget) {
return declared_gadget.getContent();
});
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
// Own methods
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.49235.21851.43451</string> </value>
<value> <string>964.45640.391.48230</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1515078479.71</float>
<float>1516294817.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -330,7 +330,7 @@
}
// Typing a search query should not modify the header status
return;
})
}, {mutex: 'changestate'})
.allowPublicAcquisition('notifyValid', function () {
// Typing a search query should not modify the header status
return;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.39835.8408.1945</string> </value>
<value> <string>964.45640.391.48230</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1515142977.99</float>
<float>1516295067.02</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -69,7 +69,7 @@
});
}
return {};
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -79,6 +79,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.51162.4768.35123</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482843530.9</float>
<float>1516295166.36</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -34,19 +34,19 @@
.push(function (declared_gadget) {
return declared_gadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
return this.getDeclaredGadget("erp5_form")
.push(function (declared_gadget) {
return declared_gadget.getContent();
});
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('triggerSubmit', function () {
this.element.querySelector('input[type="submit"]').click();
})
}, {mutex: 'changestate'})
.declareMethod('render', function (options) {
// copy out wanted items from options and pass it to `changeState`
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.65326.20561.44834</string> </value>
<value> <string>964.3910.33744.24644</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1512740130.49</float>
<float>1516350278.01</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -21,13 +21,13 @@
.push(function (declared_gadget) {
return declared_gadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
return this.getDeclaredGadget("erp5_form")
.push(function (declared_gadget) {
return declared_gadget.getContent();
});
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
......@@ -150,7 +150,7 @@
focus_on: focus_on
});
});
})
}, {mutex: 'changestate'})
.onEvent('submit', function () {
var gadget = this;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.28769.36150.45141</string> </value>
<value> <string>964.45640.391.48230</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1514478835.27</float>
<float>1516351087.15</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -26,13 +26,13 @@
.push(function (declared_gadget) {
return declared_gadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
return this.getDeclaredGadget("erp5_form")
.push(function (declared_gadget) {
return declared_gadget.getContent();
});
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.4168.39270.46967</string> </value>
<value> <string>964.45640.391.48230</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1514542029.91</float>
<float>1516351216.09</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,13 +14,13 @@
.push(function (declared_gadget) {
return declared_gadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
return this.getDeclaredGadget("erp5_form")
.push(function (declared_gadget) {
return declared_gadget.getContent();
});
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
......@@ -55,7 +55,7 @@
form_options.editable = form_gadget.state.editable;
return erp5_form.render(form_options);
})
});
});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.56888.60131.33518</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1504617145.02</float>
<float>1516351314.5</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -35,13 +35,13 @@
.push(function (declared_gadget) {
return declared_gadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
return this.getDeclaredGadget("erp5_form")
.push(function (declared_gadget) {
return declared_gadget.getContent();
});
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.45882.29366.36147</string> </value>
<value> <string>964.58561.19908.14080</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1515593717.52</float>
<float>1516351419.44</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -160,5 +160,5 @@
});
}
return final_result;
});
}, {mutex: 'changestate'});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.58788.30707.10649</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479375435.94</float>
<float>1516351756.55</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -365,7 +365,7 @@
};
}
return result;
})
}, {mutex: 'changestate'})
/////////////////////////////////////////////////////////////////
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.64317.62914.20172</string> </value>
<value> <string>964.15380.34560.33723</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1516635043.86</float>
<float>1516352011.0</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -85,6 +85,6 @@
}
return result;
});
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>959.26374.14159.14984</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516369688.01</float>
<float>1516352110.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -193,7 +193,7 @@
return content_dict;
});
})
}, {mutex: 'changestate'})
.declareAcquiredMethod("triggerSubmit", "triggerSubmit")
.onEvent('click', function (evt) {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.59679.1954.25241</string> </value>
<value> <string>963.65076.53120.24439</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1512408075.41</float>
<float>1516352207.94</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -58,7 +58,7 @@
.push(function (gadget) {
return gadget.getContent();
});
})
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
......@@ -68,6 +68,6 @@
});
}
return true;
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.5523.58984.43537</string> </value>
<value> <string>964.58974.3063.39065</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1503499581.59</float>
<float>1516352339.02</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -55,7 +55,7 @@
.push(function (subgadget) {
return subgadget.checkValidity();
});
})
}, {mutex: 'changestate'})
.declareMethod('getContent', function () {
if (this.state.editable) {
......@@ -65,6 +65,6 @@
});
}
return {};
});
}, {mutex: 'changestate'});
}(window, rJS));
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.5523.58984.43537</string> </value>
<value> <string>963.54995.41625.39389</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1511311791.54</float>
<float>1516352427.53</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -149,7 +149,7 @@
// (as ERP5 does in case of formulator error)
this.state.value = result[input.getAttribute('name')];
return result;
})
}, {mutex: 'changestate'})
.declareAcquiredMethod("notifyValid", "notifyValid")
.declareMethod('checkValidity', function () {
......@@ -180,7 +180,7 @@
});
}
return result;
})
}, {mutex: 'changestate'})
.declareAcquiredMethod("notifyChange", "notifyChange")
.onEvent('change', function () {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.50704.60870.52872</string> </value>
<value> <string>964.58989.24664.17868</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1511969724.67</float>
<float>1516352669.6</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