Commit eac740bd authored by Roque's avatar Roque

erp5_web_project_ui: drop some project info gadget render parameters

parent 95964e76
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: {"project_title":here.getTitle(), "jio_key": here.getRelativeUrl(), "home_page_preference": here.getPortalObject().portal_preferences.getPreferredPublicationSection() }</string> </value> <value> <string>python: {"jio_key": here.getRelativeUrl(), "publication_section": here.getPortalObject().portal_preferences.getPreferredPublicationSection() }</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
return view_list.filter(d => d.name === name)[0].href; return view_list.filter(d => d.name === name)[0].href;
} }
function setLatestTestResult(gadget, project_title, svg_element, project_id) { function setLatestTestResult(gadget, svg_element, project_jio_key) {
var query = createProjectQuery(project_id, var query = createProjectQuery(project_jio_key,
[["portal_type", "Test Result"]]); [["portal_type", "Test Result"]]);
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: query, query: query,
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
})); }));
} }
function getWebPageInfo(gadget, project_jio_key, home_page_preference) { function getWebPageInfo(gadget, project_jio_key, publication_section) {
var id, var id,
content, content,
edit_view, edit_view,
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
key: "publication_section__relative_url", key: "publication_section__relative_url",
operator: "=", operator: "=",
type: "simple", type: "simple",
value: "publication_section/" + home_page_preference value: "publication_section/" + publication_section
})); }));
query = Query.objectToSearchText(new ComplexQuery({ query = Query.objectToSearchText(new ComplexQuery({
operator: "AND", operator: "AND",
...@@ -210,8 +210,7 @@ ...@@ -210,8 +210,7 @@
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var state_dict = { var state_dict = {
jio_key: options.jio_key || "", jio_key: options.jio_key || "",
project_title: options.project_title, publication_section: options.publication_section
home_page_preference: options.home_page_preference
}; };
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
...@@ -223,7 +222,7 @@ ...@@ -223,7 +222,7 @@
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
getWebPageInfo(gadget, modification_dict.jio_key, modification_dict.home_page_preference), getWebPageInfo(gadget, modification_dict.jio_key, modification_dict.publication_section),
gadget.getDeclaredGadget("editor"), gadget.getDeclaredGadget("editor"),
gadget.getSetting("hateoas_url") gadget.getSetting("hateoas_url")
]); ]);
...@@ -285,8 +284,7 @@ ...@@ -285,8 +284,7 @@
} }
enableLink(document.getElementById("document_link"), url_list[8]); enableLink(document.getElementById("document_link"), url_list[8]);
enableLink(document.getElementById("activity_link"), url_list[9]); enableLink(document.getElementById("activity_link"), url_list[9]);
setLatestTestResult(gadget, modification_dict.project_title, setLatestTestResult(gadget, document.getElementById("test_result_svg"), modification_dict.jio_key);
document.getElementById("test_result_svg"), modification_dict.jio_key);
}); });
}) })
......
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