Commit cd369929 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: fix navigation after move back to graphic

parent 41b64275
...@@ -1203,16 +1203,16 @@ ...@@ -1203,16 +1203,16 @@
} }
if (gadget.state.option_list.length > 0 && if (gadget.state.option_list.length > 0 &&
gadget.state.enable_graphic) { gadget.state.enable_graphic) {
if (gadget.state.enable_graphic) { domsugar(gadget.element.querySelector(".graphic_section"), [
domsugar(gadget.element.querySelector(".graphic_section"), [ domsugar("div", {"class": "graphic_area"})
domsugar("div", {"class": "graphic_area"}) ]);
]);
}
} }
}); });
}); });
if (gadget.state.enable_graphic && if (gadget.state.enable_graphic &&
gadget.state.graphic_type && gadget.state.graphic_type &&
!gadget.state.extended_search &&
gadget.state.option_list.length > 0 && gadget.state.option_list.length > 0 &&
gadget.state.graphic_type !== "") { gadget.state.graphic_type !== "") {
result_queue result_queue
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.49449.8762.59733</string> </value> <value> <string>997.49726.7840.16145</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1643148086.35</float> <float>1643213057.93</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
return RSVP.all([ return RSVP.all([
form_gadget.getDeclaredGadget("erp5_searchfield"), form_gadget.getDeclaredGadget("erp5_searchfield"),
erp5_form.getGraphicType() erp5_form.getGraphicType()
]) ]);
}) })
.push(function (result_list) { .push(function (result_list) {
var search_gadget = result_list[0], var search_gadget = result_list[0],
...@@ -190,6 +190,7 @@ ...@@ -190,6 +190,7 @@
} }
search_options.graphic_type = result_list[1]; search_options.graphic_type = result_list[1];
search_options.jio_key = form_gadget.state.jio_key;
return search_gadget.render(search_options); return search_gadget.render(search_options);
}) })
...@@ -323,6 +324,7 @@ ...@@ -323,6 +324,7 @@
return gadget.renderEditorPanel( return gadget.renderEditorPanel(
"gadget_erp5_graphic_editor.html", { "gadget_erp5_graphic_editor.html", {
graphic_option_list: result_dict.graphic_option_list, graphic_option_list: result_dict.graphic_option_list,
jio_key: gadget.state.jio_key,
graphic_type: result_list[1] graphic_type: result_list[1]
}); });
}); });
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.49226.31411.58880</string> </value> <value> <string>997.50436.16456.55552</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1643150091.84</float> <float>1643208720.28</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
var state_dict = { var state_dict = {
extended_search: options.extended_search || "", extended_search: options.extended_search || "",
enable_graphic: options.enable_graphic || false, enable_graphic: options.enable_graphic || false,
graphic_type: options.graphic_type graphic_type: options.graphic_type,
jio_key: options.jio_key
}; };
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
len, len,
button_container = gadget.element.querySelector('div.search_parsed_value'), button_container = gadget.element.querySelector('div.search_parsed_value'),
button_graphic = gadget.element.querySelector(".graphic-button"), button_graphic = gadget.element.querySelector(".graphic-button"),
select_button_graphic = gadget.element.querySelector(".change-graphic-button"), change_button_graphic = gadget.element.querySelector(".change-graphic-button"),
graphic_css_class = "ui-screen-hidden", graphic_css_class = "ui-screen-hidden",
button, button,
operator = 'AND', operator = 'AND',
...@@ -59,15 +60,15 @@ ...@@ -59,15 +60,15 @@
continue_full_text_query_search = true; continue_full_text_query_search = true;
if (gadget.state.extended_search) { if (gadget.state.extended_search) {
console.log(modification_dict);
if (modification_dict.enable_graphic && if (modification_dict.enable_graphic &&
modification_dict.graphic_type && modification_dict.extended_search &&
button_graphic) { modification_dict.graphic_type) {
button_graphic.classList.add(graphic_css_class); button_graphic.classList.remove(graphic_css_class);
select_button_graphic.classList.remove(graphic_css_class); change_button_graphic.classList.add(graphic_css_class);
} else { } else {
button_graphic.classList.remove(graphic_css_class); button_graphic.classList.remove(graphic_css_class);
select_button_graphic.classList.add(graphic_css_class); change_button_graphic.classList.add(graphic_css_class);
} }
// Parse the raw query // Parse the raw query
...@@ -130,13 +131,13 @@ ...@@ -130,13 +131,13 @@
button_graphic && !button_graphic.classList.contains( button_graphic && !button_graphic.classList.contains(
graphic_css_class)) { graphic_css_class)) {
button_graphic.classList.add(graphic_css_class); button_graphic.classList.add(graphic_css_class);
select_button_graphic.classList.remove(graphic_css_class); change_button_graphic.classList.remove(graphic_css_class);
} else if (select_button_graphic && } else if (change_button_graphic &&
modification_dict.enable_graphic && modification_dict.enable_graphic &&
!modification_dict.extended_search ){ !modification_dict.extended_search ){
select_button_graphic.classList.remove(graphic_css_class); change_button_graphic.classList.remove(graphic_css_class);
} }
console.log(modification_dict);
button_container.innerHTML = ''; button_container.innerHTML = '';
len = query_text_list.length; len = query_text_list.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
...@@ -262,15 +263,15 @@ ...@@ -262,15 +263,15 @@
return this.triggerSubmit({focus_on: parseInt(evt.target.value, 10)}); return this.triggerSubmit({focus_on: parseInt(evt.target.value, 10)});
} else if (evt.target.classList.contains("graphic-button")) { } else if (evt.target.classList.contains("graphic-button")) {
return gadget.redirect({ return gadget.redirect({
command: "store_and_change", command: "display_with_history",
options: { options: {
jio_key: gadget.state.jio_key,
graphic_type: gadget.state.graphic_type graphic_type: gadget.state.graphic_type
} }
}); });
} else if (evt.target.classList.contains("change-graphic-button")) { } else if (evt.target.classList.contains("change-graphic-button")) {
return gadget.triggerListboxGraphicSelection(); return gadget.triggerListboxGraphicSelection();
} }
} }
}, false, false); }, false, false);
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.49459.47071.9267</string> </value> <value> <string>997.50526.4785.59750</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1643150086.6</float> <float>1643213115.75</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -16,14 +16,21 @@ ...@@ -16,14 +16,21 @@
.declareAcquiredMethod("getUrlParameter", "getUrlParameter") .declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.allowPublicAcquisition("chartItemClick", function (params) { .allowPublicAcquisition("chartItemClick", function (params) {
var gadget = this; var gadget = this;
return gadget.getSearchCriteria(params[0][0], params[0][1]) return new RSVP.Queue(RSVP.all([
.push(function (result) { gadget.getSearchCriteria(params[0][0], params[0][1]),
gadget.getUrlParameter("graphic_type")
]))
.push(function (result_list) {
var options = {
extended_search: result_list[0],
jio_key: gadget.state.jio_key
}
if (result_list[1]) {
options.graphic_type = result_list[1];
}
return gadget.redirect({ return gadget.redirect({
command: 'display_with_history', command: 'display_with_history',
options: { options: options
jio_key: gadget.state.jio_key,
extended_search: result
}
}); });
}); });
}) })
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.48057.37984.27733</string> </value> <value> <string>997.50503.16089.7338</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1643148004.23</float> <float>1643211674.58</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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