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

rerender again if rerender change

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