Commit 80e5334a authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: add getCommandUrlForDict acquired method

```
return gadget.getCommandUrlForDict({
  foo_key: {
    command: 'display'
  }
})
  .push(function (url_dict) {
    console.log(url_dict.foo_key);
  });
```
parent 5c53e4e6
......@@ -585,6 +585,11 @@
) {
return route(this, 'router', 'getCommandUrlForList', param_list);
})
.allowPublicAcquisition("getUrlForDict", function getUrlForDict(
param_list
) {
return route(this, 'router', 'getCommandUrlForDict', param_list);
})
.allowPublicAcquisition("updateHeader", function updateHeader(param_list) {
initHeaderOptions(this);
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.7273.32666.52736</string> </value>
<value> <string>989.27523.29749.43383</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1609765240.15</float>
<float>1612532987.6</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -1107,6 +1107,17 @@
}
return result_list;
})
.declareMethod('getCommandUrlForDict', function getCommandUrlForDict(
options_dict
) {
var key;
for (key in options_dict) {
if (options_dict.hasOwnProperty(key)) {
options_dict[key] = getCommandUrlForMethod(this, options_dict[key]);
}
}
return options_dict;
})
.declareMethod('getCommandUrlFor', function getCommandUrlFor(options) {
return getCommandUrlForMethod(this, options);
})
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.17139.27691.33245</string> </value>
<value> <string>989.53404.33387.10564</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1610357319.16</float>
<float>1612533436.71</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -28,6 +28,13 @@
<dd>List of option_dict parameter to pass to all getCommandUrlFor call</dd>
</dl>
<dt>getCommandUrlForDict</dt>
<dd>Calculate a dict of url</dd>
<dl>
<dt>option_dict_dict</dt>
<dd>Dict of option_dict parameter to pass to all getCommandUrlFor call</dd>
</dl>
<dt>redirect</dt>
<dd>Change the URL</dd>
<dl>
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.17048.52617.25105</string> </value>
<value> <string>989.33076.35205.19609</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1536936538.99</float>
<float>1612533051.72</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