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

demo olap_wizard use getRemoteSettings

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