Commit 0959ffa1 authored by Boris Kocherov's avatar Boris Kocherov

[erp5_only_office] use notifyChange in olap_wizard

parent a1d7fef2
...@@ -192,6 +192,18 @@ DocsAPI.DocEditor.version = function () { ...@@ -192,6 +192,18 @@ DocsAPI.DocEditor.version = function () {
console.error(e); console.error(e);
}); });
} }
if (scope === "xmlawizard") {
return this.getDeclaredGadget(scope)
.push(function (g) {
return g.getContent();
})
.push(function (data) {
console.log(JSON.stringify(data));
})
.push(undefined, function (e) {
console.error(e);
});
}
}) })
.allowPublicAcquisition("getRemoteSettings", function () { .allowPublicAcquisition("getRemoteSettings", function () {
return this.jio_getAttachment('/', 'remote_settings.json', {format: 'json'}) return this.jio_getAttachment('/', 'remote_settings.json', {format: 'json'})
......
...@@ -103,16 +103,6 @@ ...@@ -103,16 +103,6 @@
return queue; return queue;
} }
function print_content(gadget) {
return gadget.getDeclaredGadget("olap_wizard")
.push(function (g) {
return g.getContent();
})
.push(function (v) {
console.log(JSON.stringify(v));
});
}
function discoverDimensions(schema, used_dimensions, opt) { function discoverDimensions(schema, used_dimensions, opt) {
return xmla_request_retry("discoverMDDimensions", opt) return xmla_request_retry("discoverMDDimensions", opt)
.push(undefined, function (error) { .push(undefined, function (error) {
...@@ -364,7 +354,6 @@ ...@@ -364,7 +354,6 @@
function rerender_once(connection_settings, sub_gadget) { function rerender_once(connection_settings, sub_gadget) {
return sub_gadget.getContent() return sub_gadget.getContent()
.push(function (content) { .push(function (content) {
console.log(content);
return generateChoiceSchema(connection_settings, used_diemensions, content); return generateChoiceSchema(connection_settings, used_diemensions, content);
}) })
.push(function (schema) { .push(function (schema) {
...@@ -376,7 +365,7 @@ ...@@ -376,7 +365,7 @@
}); });
} }
queue return queue
.push(function () { .push(function () {
return g.getDeclaredGadget("olap_wizard"); return g.getDeclaredGadget("olap_wizard");
}) })
...@@ -392,7 +381,7 @@ ...@@ -392,7 +381,7 @@
sub_gadget = arr[1]; sub_gadget = arr[1];
return rerender_once(connection_settings, sub_gadget) return rerender_once(connection_settings, sub_gadget)
.push(function (changed) { .push(function (changed) {
if (changed.length > 0) { if (changed && changed.length > 0) {
if (changed.indexOf('/dimension') >= 0) { if (changed.indexOf('/dimension') >= 0) {
return allRerender(); return allRerender();
} }
...@@ -400,14 +389,10 @@ ...@@ -400,14 +389,10 @@
} }
}) })
.push(function (changed) { .push(function (changed) {
if (changed.length > 0) { if (changed && changed.length > 0) {
return rerender_once(connection_settings, sub_gadget); return rerender_once(connection_settings, sub_gadget);
} }
}); });
})
.push(function () {
// return g.notifyChange();
return print_content(g);
}); });
} }
...@@ -420,7 +405,7 @@ ...@@ -420,7 +405,7 @@
})); }));
}) })
.push(function () { .push(function () {
return []; return g.notifyChange();
}); });
}; };
...@@ -444,11 +429,13 @@ ...@@ -444,11 +429,13 @@
if (relPath === "/dimension") { if (relPath === "/dimension") {
return allRerender(); return allRerender();
} }
return rerender(s); return rerender(s)
.push(function () {
return g.notifyChange();
});
} }
} }
// return g.notifyChange(); return g.notifyChange();
return print_content(g);
}) })
.allowPublicAcquisition("resolveExternalReference", function (arr) { .allowPublicAcquisition("resolveExternalReference", function (arr) {
var g = this, var g = this,
......
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