Commit b2f24083 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

erp5_officejs: Remove useless code from jio dropbox configurator

parent aa779dc3
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
(function (window, rJS, RSVP, console) { (function (window, rJS, RSVP, console) {
"use strict"; "use strict";
function setDropboxConfiguration(gadget) { function setDropboxConfiguration(gadget, token) {
return gadget.getSetting("portal_type") return gadget.getSetting("portal_type")
.push(function (portal_type) { .push(function (portal_type) {
var old_date = new Date(), var old_date = new Date(),
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
type: "drivetojiomapping", type: "drivetojiomapping",
sub_storage: { sub_storage: {
type: "dropbox", type: "dropbox",
access_token: gadget.props.access_token, access_token: token,
root: "sandbox" root: "sandbox"
} }
} }
...@@ -87,40 +87,11 @@ ...@@ -87,40 +87,11 @@
var gadget_klass = rJS(window); var gadget_klass = rJS(window);
gadget_klass gadget_klass
.ready(function (g) {
g.props = {};
return g.getElement()
.push(function (element) {
g.props.element = element;
g.props.deferred = RSVP.defer();
});
})
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this; return setDropboxConfiguration(this, options.access_token);
return gadget.updateHeader({
title: "Connect To Drobox Storage",
back_url: "#page=jio_configurator",
panel_action: false
})
.push(function () {
gadget.props.access_token = options.token;
return gadget.props.deferred.resolve();
});
})
.declareService(function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.props.deferred.promise;
})
.push(function () {
return setDropboxConfiguration(gadget);
});
}); });
}(window, rJS, RSVP, console)); }(window, rJS, RSVP, console));
\ No newline at end of file
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>cedric.le.ninivin</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.15367.8749.64307</string> </value> <value> <string>960.64347.25493.60518</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1498205374.87</float> <float>1501057664.67</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