Commit 3d6f4835 authored by Boris Kocherov's avatar Boris Kocherov

demo olap_wizard use getRemoteSettings

parent 410e9239
...@@ -4,20 +4,11 @@ ...@@ -4,20 +4,11 @@
(function (window, rJS) { (function (window, rJS) {
"use strict"; "use strict";
function getConnections() { function getCurrentConnectionSettings(g, gadget) {
return {
"xmla": {
"urls": ["https://d1.erp5.ru/saiku/xmla"],
"properties": {"DataSourceInfo": "FoodMart", "Catalog": "FoodMart", "Cube": "Sales"}
}
};
}
function getCurrentConnectionSettings(gadget) {
var connections; var connections;
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
return getConnections(); return g.getRemoteSettings();
}) })
.push(function (c) { .push(function (c) {
connections = c; connections = c;
...@@ -318,10 +309,24 @@ ...@@ -318,10 +309,24 @@
value: {} value: {}
}); });
}) })
.declareMethod("getRemoteSettings", function () {
return {
"xmla": {
"urls": ["https://d1.erp5.ru/saiku/xmla"],
"properties": {"DataSourceInfo": "FoodMart", "Catalog": "FoodMart", "Cube": "Sales"}
}
};
})
.allowPublicAcquisition("notifyValid", function (arr, scope) { .allowPublicAcquisition("notifyValid", function (arr, scope) {
}) })
.allowPublicAcquisition("notifyInvalid", function (arr, scope) { .allowPublicAcquisition("notifyInvalid", function (arr, scope) {
}) })
.declareMethod("rerender", function () {
return this.getDeclaredGadget("olap_wizard")
.push(function (gadget) {
return gadget.rerender();
});
})
.declareMethod("render", function (opt) { .declareMethod("render", function (opt) {
if (!opt) { if (!opt) {
opt = {}; opt = {};
...@@ -382,7 +387,7 @@ ...@@ -382,7 +387,7 @@
.push(function (gadget) { .push(function (gadget) {
gadget_settings = gadget; gadget_settings = gadget;
return RSVP.all([ return RSVP.all([
getCurrentConnectionSettings(gadget), getCurrentConnectionSettings(g, gadget),
gadget.getSubGadget(sub_scope) gadget.getSubGadget(sub_scope)
]); ]);
}) })
...@@ -457,7 +462,7 @@ ...@@ -457,7 +462,7 @@
if ("urn:jio:remote_connections.json" === url) { if ("urn:jio:remote_connections.json" === url) {
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return getConnections(); return g.getRemoteSettings();
}) })
.push(function (connections) { .push(function (connections) {
var key, var key,
......
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