Commit 100c1ecc authored by Sven Franck's avatar Sven Franck

finished ticketing

parent 9d49ad29
...@@ -33,7 +33,11 @@ ...@@ -33,7 +33,11 @@
"theme": "slapos-white", "theme": "slapos-white",
"view_dict": { "view_dict": {
"default": [ "default": [
{
"generate": "gadget",
"type": "listbox",
"href": "ticket_status"
},
{ {
"generate": "gadget", "generate": "gadget",
"type": "fieldlist", "type": "fieldlist",
......
...@@ -715,47 +715,36 @@ ...@@ -715,47 +715,36 @@
* @param {object} response Object object passed on to next element * @param {object} response Object object passed on to next element
**/ **/
"ticket_status": function (reply) { "ticket_status": function (reply) {
var config, property, query, href, i, reply, pass = reply.pass; var fetch, config, property, query, href, i, reply, pass = reply.pass;
if (storage) { if (storage) {
config = {
"url": storage.items.dict.url,
"type": "GET",
"data": JSON.stringify({"_id":""})
};
// access storage // access storage
return jIO.util.ajax(config) fetch = reply.pass.value || reply.pass.state.query.force;
.then(function(response) {
return jIO.util.ajax({ return storage.items.get({"_id": fetch})
"url": util.parse(response.target.responseText)._links.me.href .then(function(answer) {
}); query = util.parse(answer).data._links.slapos_jump._query;
}).then(function (answer) {
console.log(util.parse(answer.target.responseText)) if (pass.config.initial_query === undefined) {
// reply = util.parse(answer.target.responseText)._links.slapos_jump; pass.config.initial_query = {};
// for (i = 0; i < reply.length; i += 1) { }
// if (reply[i].name === "current_ticket") { pass.config.initial_query.query = query;
// query = reply[i]._query; pass.config.initial_query.skip_type = true;
// } pass.preserve_lookup = reply.pass.value;
// }
// if (query === undefined) { // set a flag to now run allDocs
// query = reply.href; pass.force_allDocs = true;
// }
// if (pass.config.initial_query === undefined) { // pass hacked query back into chain
// pass.config.initial_query = {}; if (reply.response) {
// } return {
// pass.config.initial_query.skip_type = true; "response": util.parse(reply.response),
// pass.config.initial_query.query = query; "pass": pass
// // pass hacked query back into chain };
// if (reply.response) { }
// return { return {
// "response": util.parse(reply.response), "pass": pass
// "pass": pass }
// };
// }
// return {
// "pass": pass
// }
}).fail(util.error); }).fail(util.error);
} }
return (reply); return (reply);
......
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