Commit 047c01d4 authored by Boris Kocherov's avatar Boris Kocherov

rerender again if rerender change

parent 75c1683c
......@@ -365,6 +365,7 @@
action = arr[0].action,
used_diemensions,
url = arr[0].ref,
allRerender,
y;
function rerender(sub_scope) {
......@@ -379,6 +380,21 @@
queue = RSVP.Queue();
}
function rerender_once(connection_settings, sub_gadget) {
return sub_gadget.getContent()
.push(function (content) {
console.log(content);
return generateChoiceSchema(connection_settings, used_diemensions, content);
})
.push(function (schema) {
return gadget_settings.rerender({
scope: sub_scope,
schema: schema,
ignore_incorrect: true
});
});
}
queue
.push(function () {
return g.getDeclaredGadget("olap_wizard");
......@@ -388,20 +404,25 @@
return RSVP.all([
getCurrentConnectionSettings(gadget),
gadget.getSubGadget(sub_scope)
.push(function (z) {
return z.getContent();
})
]);
})
.push(function (arr) {
return generateChoiceSchema(arr[0], used_diemensions, arr[1]);
})
.push(function (schema) {
return gadget_settings.rerender({
scope: sub_scope,
schema: schema,
ignore_incorrect: true
});
var connection_settings = arr[0],
sub_gadget = arr[1];
return rerender_once(connection_settings, sub_gadget)
.push(function (changed) {
if (changed.length > 0) {
if (changed.indexOf('/dimension') >= 0) {
return allRerender();
}
return rerender_once(connection_settings, sub_gadget);
}
})
.push(function (changed) {
if (changed.length > 0) {
return rerender_once(connection_settings, sub_gadget);
}
});
})
.push(function () {
// return g.notifyChange();
......@@ -409,15 +430,18 @@
});
}
function allRerender() {
allRerender = function () {
return get_used_dimensions(g)
.push(function (v) {
used_diemensions = v;
return RSVP.all(g.props.choices.map(function (q) {
return rerender(q);
}));
})
.push(function () {
return [];
});
}
};
if ("urn:jio:remote_connections.json" === url) {
return allRerender();
......
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