Commit eb88c798 authored by Sven Franck's avatar Sven Franck

hack: fixed pagination and search for hateoasstorage listbox

parent 08d8f99b
...@@ -31,13 +31,14 @@ ...@@ -31,13 +31,14 @@
* @param {object} response Object object passed on to next element * @param {object} response Object object passed on to next element
**/ **/
"subscription_details": function (reply) { "subscription_details": function (reply) {
var config, property, query, href, pass = reply.pass; var config, property, query, fetch, href, pass = reply.pass;
if (storage) { if (storage) {
// access storage // access storage
return storage.items.get({"_id": reply.pass.value}) fetch = reply.pass.value || reply.pass.state.query.force;
return storage.items.get({"_id": fetch})
.then(function(answer) { .then(function(answer) {
console.log(util.parse(answer).data)
query = util.parse(answer).data._links.slapos_jump._query; query = util.parse(answer).data._links.slapos_jump._query;
if (pass.config.initial_query === undefined) { if (pass.config.initial_query === undefined) {
...@@ -45,6 +46,7 @@ ...@@ -45,6 +46,7 @@
} }
pass.config.initial_query.query = query; pass.config.initial_query.query = query;
pass.config.initial_query.skip_type = true; pass.config.initial_query.skip_type = true;
pass.preserve_lookup = reply.pass.value;
// set a flag to now run allDocs // set a flag to now run allDocs
pass.force_allDocs = true; pass.force_allDocs = true;
...@@ -4993,6 +4995,11 @@ ...@@ -4993,6 +4995,11 @@
config.state.selected = []; config.state.selected = [];
} }
// HACK: overwrite query
if (config.state.preserve_lookup) {
config.state.query.force = config.state.preserve_lookup;
}
// update gadget // update gadget
app.setContent( app.setContent(
{"generate": "gadget", "reference": config.id, "href": config.state.href}, {"generate": "gadget", "reference": config.id, "href": config.state.href},
...@@ -5855,7 +5862,7 @@ ...@@ -5855,7 +5862,7 @@
* @return {object} response object/promise * @return {object} response object/promise
*/ */
app.fetchDataQuery = function (reply) { app.fetchDataQuery = function (reply) {
var parsed, pass = reply.pass; var parsed, pass = reply.pass, key, value;
if (pass.skip === undefined && if (pass.skip === undefined &&
(pass.no_auth || (pass.auth && pass.active_login))) { (pass.no_auth || (pass.auth && pass.active_login))) {
...@@ -5882,11 +5889,20 @@ ...@@ -5882,11 +5889,20 @@
pass.field_list = storage.makeSelectList(pass.config.scheme); pass.field_list = storage.makeSelectList(pass.config.scheme);
} }
} }
// HACK:
if (pass.force_allDocs) {
if (pass.preserve_lookup) {
pass.state.preserve_lookup = pass.preserve_lookup;
}
} else {
key = pass.config.property_dict.initial_query_url_identifier;
value = pass.value;
}
pass.state.query = app.generateQueryObject( pass.state.query = app.generateQueryObject(
pass.config.initial_query, pass.config.initial_query,
pass.type, pass.type,
pass.force_allDocs ? null : pass.config.property_dict.initial_query_url_identifier, key,
pass.force_allDocs ? null : pass.value, value,
pass.field_list pass.field_list
); );
} }
......
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