From 095256fd8a78f37b796a2f32a20710bfa7ad6cc8 Mon Sep 17 00:00:00 2001 From: Rafael Monnerat <rafael@nexedi.com> Date: Wed, 10 Apr 2019 19:47:26 +0000 Subject: [PATCH] slapos_jio: Add Attention Point Gadget --- .../rjs_gadget_erp5_attention_point_css.css | 14 ++ .../rjs_gadget_erp5_attention_point_css.xml | 113 ++++++++++++ .../rjs_gadget_erp5_attention_point_html.html | 49 +++++ .../rjs_gadget_erp5_attention_point_html.xml | 113 ++++++++++++ .../rjs_gadget_erp5_attention_point_js.js | 101 +++++++++++ .../rjs_gadget_erp5_attention_point_js.xml | 109 +++++++++++ ..._gadget_erp5_page_slap_computer_list_js.js | 6 + ...gadget_erp5_page_slap_computer_list_js.xml | 4 +- ...rjs_gadget_erp5_page_slap_controller_js.js | 4 + ...js_gadget_erp5_page_slap_controller_js.xml | 4 +- ...s_gadget_erp5_page_slap_invoice_list_js.js | 6 + ..._gadget_erp5_page_slap_invoice_list_js.xml | 4 +- ...s_gadget_erp5_page_slap_network_list_js.js | 6 + ..._gadget_erp5_page_slap_network_list_js.xml | 4 +- ...s_gadget_erp5_page_slap_project_list_js.js | 6 + ..._gadget_erp5_page_slap_project_list_js.xml | 4 +- ...s_gadget_erp5_page_slap_service_list_js.js | 6 + ..._gadget_erp5_page_slap_service_list_js.xml | 6 +- .../rjs_gadget_erp5_page_slap_site_list_js.js | 6 + ...rjs_gadget_erp5_page_slap_site_list_js.xml | 6 +- ...js_gadget_erp5_page_slap_ticket_list_js.js | 6 + ...s_gadget_erp5_page_slap_ticket_list_js.xml | 4 +- .../rjs_gadget_erp5_page_slapos_js.js | 6 + .../rjs_gadget_erp5_page_slapos_js.xml | 6 +- .../rjs_gadget_slapos_appcache.xml | 7 +- .../rjs_gadget_slapos_panel_html.html | 7 + .../rjs_gadget_slapos_panel_html.xml | 6 +- .../rjs_gadget_slapos_panel_js.js | 171 +++++++----------- .../rjs_gadget_slapos_panel_js.xml | 6 +- .../Base_getAttentionPointList.py | 3 + .../Base_getAttentionPointList.xml | 62 +++++++ master/bt5/slapos_jio/bt/template_path_list | 3 + 32 files changed, 720 insertions(+), 138 deletions(-) create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.css create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.xml create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.html create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.xml create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.js create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.xml create mode 100644 master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py create mode 100644 master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.xml diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.css b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.css new file mode 100644 index 000000000..7e4a7d7d2 --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.css @@ -0,0 +1,14 @@ +.attention-point { + border: 1px solid #FF0004; + border-radius: 5%; + color: #FF0004; + padding: 5px; + margin: 5px; +} +.no-alert { + border: 1px solid #228B22; + border-radius: 5%; + color: #228B22; + padding: 5px; + margin: 5px; +} \ No newline at end of file diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.xml new file mode 100644 index 000000000..15b684dc4 --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_css.xml @@ -0,0 +1,113 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Web Style" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Access_contents_information_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Change_local_roles_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_View_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_md5</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>content_type</string> </key> + <value> <string>text/css</string> </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>gadget_erp5_attention_point.css</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>rjs_gadget_erp5_attention_point_css</string> </value> + </item> + <item> + <key> <string>language</string> </key> + <value> <string>en</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Web Style</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Gadget ERP5 Attention Point CSS</string> </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>001</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.html b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.html new file mode 100644 index 000000000..3f2453aae --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html> +<!-- + data-i18n=Warnings + data-i18n=No Alert! +--> + <head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width" /> + <title>Information</title> + <!-- renderjs --> + <script src="rsvp.js"></script> + <script src="renderjs.js"></script> + <script src="handlebars.js"></script> + <!-- custom script --> + <script src="gadget_erp5_attention_point.js" type="text/javascript"></script> + <link rel="stylesheet" type="text/css" href="gadget_erp5_attention_point.css"> + <script id="attention_point-item-template" type="text/x-handlebars-template"> + {{#each option}} + <div class={{css_class}}>{{text}}</div> + {{/each}} + </script> + <script id="attention_point-template" type="text/x-handlebars-template"> + <div class="ui-panel-inner"> + <div data-role="header" role="banner" class="ui-header ui-bar-inherit"> + <div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right"> + <div class="ui-controlgroup-controls"> + <button data-rel="save" data-i18n="Submit" type="submit" class="submit responsive ui-last-child ui-btn ui-btn-icon-left"></button> + </div> + </div> + <h1 class="ui-title" role="heading" data-i18n="Warnings" aria-level="1">Warnings</h1> + <div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left"> + <div class="ui-controlgroup-controls"> + <button data-i18n="Close" data-rel="close" type="submit" class="close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times">Close</button> + </div> + </div> + </div> + <section class="ui-body-c ui-content-section"> + <div class="attention_point_item_container ui-controlgroup ui-corner_all"></div> + </section> + </div> + </script> + </head> + <body> + <form class="attention_point_editor"> + <div class="container"></div> + </form> + </body> +</html> \ No newline at end of file diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.xml new file mode 100644 index 000000000..50b70f589 --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_html.xml @@ -0,0 +1,113 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Web Page" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Access_contents_information_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Change_local_roles_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_View_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_md5</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>content_type</string> </key> + <value> <string>text/html</string> </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>gadget_erp5_attention_point.html</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>rjs_gadget_erp5_attention_point_html</string> </value> + </item> + <item> + <key> <string>language</string> </key> + <value> <string>en</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Web Page</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Gadget Attention Point</string> </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>001</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.js new file mode 100644 index 000000000..c4b8cf2ab --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.js @@ -0,0 +1,101 @@ +/*jslint indent: 2, maxerr: 3, nomen: true */ +/*global window, document, rJS, RSVP, Handlebars*/ +(function (window, document, rJS, RSVP, Handlebars) { + "use strict"; + var gadget_klass = rJS(window), + template_element = gadget_klass.__template_element, + attention_point_item_template = Handlebars.compile(template_element + .getElementById("attention_point-item-template") + .innerHTML), + attention_point_template = Handlebars.compile(template_element + .getElementById("attention_point-template") + .innerHTML); + Handlebars.registerHelper('equal', function (left_value, right_value, options) { + if (arguments.length < 3) { + throw new Error("Handlebars Helper equal needs 2 parameters"); + } + if (left_value !== right_value) { + return options.inverse(this); + } + return options.fn(this); + }); + function createAttentionPointTemplate(gadget, attention_point) { + return gadget.translateHtml(attention_point_item_template({ + option: [{ + text: attention_point[0], + css_class: attention_point[1] + }] + })); + } + gadget_klass + ////////////////////////////////////////////// + // acquired method + ////////////////////////////////////////////// + .declareAcquiredMethod("translateHtml", "translateHtml") + .declareAcquiredMethod("redirect", "redirect") + .declareAcquiredMethod("trigger", "trigger") + .onStateChange(function onStateChange() { + var gadget = this, + div = document.createElement("div"), + container = gadget.element.querySelector(".container"); + return gadget.translateHtml(attention_point_template()) + .push(function (translated_html) { + div.innerHTML = translated_html; + return RSVP.all(gadget.state.attention_point_list + .map(function (attention_point) { + return createAttentionPointTemplate(gadget, attention_point); + }) + ); + }) + .push(function (result_list) { + var i, + subdiv, + attention_point_item_container = div.querySelector('.attention_point_item_container'); + for (i = 0; i < result_list.length; i += 1) { + subdiv = document.createElement("div"); + subdiv.innerHTML = result_list[i]; + attention_point_item_container.appendChild(subdiv); + } + while (container.firstChild) { + container.removeChild(container.firstChild); + } + container.appendChild(div); + }); + }) + .declareMethod('render', function render(options) { + return this.changeState({ + attention_point_list: options.attention_point_list || [], + key: options.key + }); + }) + .onEvent('click', function click(evt) { + if (evt.target.classList.contains('close')) { + evt.preventDefault(); + return this.trigger(); + } + }, false, false) + .onEvent('submit', function submit() { + var gadget = this, + sort_list = gadget.element.querySelectorAll(".attention_point_item_container"), + sort_query = [], + select_list, + sort_item, + options = {}, + i; + for (i = 0; i < sort_list.length; i += 1) { + sort_item = sort_list[i]; + select_list = sort_item.querySelectorAll("select"); + sort_query[i] = [select_list[0][select_list[0].selectedIndex].value, + select_list[1][select_list[1].selectedIndex].value]; + } + if (i === 0) { + options[gadget.state.key] = undefined; + } else { + options[gadget.state.key] = sort_query; + } + return gadget.redirect({ + command: 'store_and_change', + options: options + }); + }); +}(window, document, rJS, RSVP, Handlebars)); \ No newline at end of file diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.xml new file mode 100644 index 000000000..dec96437d --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_attention_point_js.xml @@ -0,0 +1,109 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Web Script" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Access_contents_information_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Change_local_roles_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_View_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_md5</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>gadget_erp5_attention_point.js</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>rjs_gadget_erp5_attention_point_js</string> </value> + </item> + <item> + <key> <string>language</string> </key> + <value> <string>en</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Web Script</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Gadget Attention Point JS</string> </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>001</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.js index 846ed0a1a..c33815dbb 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -117,6 +118,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "computer_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slap_add_computer"}}), diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.xml index 2c1edcaa5..ca073fd02 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_list_js.xml @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>972.38797.10404.27528</string> </value> + <value> <string>974.61498.11899.44253</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1545935797.99</float> + <float>1554901061.9</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.js index 60943a824..ae781de70 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.js @@ -10,6 +10,7 @@ ///////////////////////////////////////////////////////////////// .declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_put", "jio_put") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") ///////////////////////////////////////////////////////////////// @@ -82,6 +83,9 @@ doc: gadget.state.doc, editable: gadget.state.editable }); + }) + .push(function () { + return gadget.updatePanel({jio_key: gadget.state.jio_key}); }); }); diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.xml index 851ebe640..67e080ab5 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_controller_js.xml @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>964.64854.62654.27545</string> </value> + <value> <string>972.32024.53732.34406</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1516644220.55</float> + <float>1554855524.15</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.js index 704fc7c0d..84997d6b9 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -148,6 +149,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "accounting_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slapos"}}) diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.xml index 6eeec61b2..68e3f68da 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_invoice_list_js.xml @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>972.32024.53732.34406</string> </value> + <value> <string>974.61498.36227.27835</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1552960106.68</float> + <float>1554901051.44</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.js index 0eaddfe5b..1c5202e59 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -110,6 +111,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "computer_network_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slap_add_network"}}), diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.xml index 6c4ced3f4..d8f6fa77c 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_network_list_js.xml @@ -241,7 +241,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>972.38848.17221.24388</string> </value> + <value> <string>974.61513.15083.40157</string> </value> </item> <item> <key> <string>state</string> </key> @@ -259,7 +259,7 @@ </tuple> <state> <tuple> - <float>1545936199.72</float> + <float>1554901041.21</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.js index a5a90f76c..b6ea3005c 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -121,6 +122,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "project_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slap_add_project"}}), diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.xml index 2fc4f0377..89cd52014 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_project_list_js.xml @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>974.29228.49487.5973</string> </value> + <value> <string>974.61500.28585.34065</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1554315644.91</float> + <float>1554901016.21</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.js index 252c7e7bf..c9104a89b 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -111,6 +112,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "hosting_subscription_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slap_select_software_product"}}), diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.xml index 189f39dde..41962857d 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_service_list_js.xml @@ -216,7 +216,7 @@ </item> <item> <key> <string>actor</string> </key> - <value> <string>superrafael</string> </value> + <value> <string>zope</string> </value> </item> <item> <key> <string>comment</string> </key> @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>974.50694.51828.32204</string> </value> + <value> <string>974.61501.898.16708</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1554254296.08</float> + <float>1554900916.8</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.js index 21e1cae0e..b0d9c0865 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -120,6 +121,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "organisation_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slap_add_organisation"}}), diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.xml index 11cab4be9..e8cec30c6 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_site_list_js.xml @@ -216,7 +216,7 @@ </item> <item> <key> <string>actor</string> </key> - <value> <string>superrafael</string> </value> + <value> <string>zope</string> </value> </item> <item> <key> <string>comment</string> </key> @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>974.29228.49487.5973</string> </value> + <value> <string>974.61497.27931.35481</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1554317319.46</float> + <float>1554900905.51</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.js index add4a6541..dbe81f6fb 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.js @@ -5,6 +5,7 @@ rJS(window) .declareAcquiredMethod("updateHeader", "updateHeader") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("getSetting", "getSetting") @@ -84,6 +85,11 @@ } }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: "support_request_module" + }); + }) .push(function (result) { return RSVP.all([ gadget.getUrlFor({command: "change", options: {"page": "slap_add_ticket"}}), diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.xml index 7d579a37d..1bcc8af64 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js.xml @@ -230,7 +230,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>965.32073.19438.59528</string> </value> + <value> <string>974.61510.55768.19899</string> </value> </item> <item> <key> <string>state</string> </key> @@ -248,7 +248,7 @@ </tuple> <state> <tuple> - <float>1522772191.41</float> + <float>1554901834.87</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.js index 800b9e948..433304334 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.js @@ -21,6 +21,7 @@ // Acquired methods ///////////////////////////////////////////////////////////////// .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") + .declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("translateHtml", "translateHtml") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("updateHeader", "updateHeader") @@ -229,6 +230,11 @@ }); }); }) + .push(function () { + return gadget.updatePanel({ + jio_key: false + }); + }) .push(function () { return gadget.updateHeader({ page_title: 'Dashboard' diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.xml index 21cba6b02..074b809cb 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slapos_js.xml @@ -227,7 +227,7 @@ </item> <item> <key> <string>actor</string> </key> - <value> <string>superrafael</string> </value> + <value> <string>zope</string> </value> </item> <item> <key> <string>comment</string> </key> @@ -241,7 +241,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>974.51826.62399.12902</string> </value> + <value> <string>974.61525.54996.33297</string> </value> </item> <item> <key> <string>state</string> </key> @@ -259,7 +259,7 @@ </tuple> <state> <tuple> - <float>1554320110.18</float> + <float>1554901947.77</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_appcache.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_appcache.xml index 2f87ebb12..06ff23c59 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_appcache.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_appcache.xml @@ -379,6 +379,9 @@ gadget_erp5_panel_shortcut.html\n gadget_erp5_panel_shortcut.js\n gadget_erp5_pt_form_slapos_index.html\n gadget_erp5_pt_form_slapos_index.js\n +gadget_erp5_attention_point.html\n +gadget_erp5_attention_point.css\n +gadget_erp5_attention_point.js\n gadget_slapos_computer_map.html\n gadget_slapos_computer_map.js\n gadget_slapos_computer_status.css\n @@ -555,7 +558,7 @@ NETWORK:\n </item> <item> <key> <string>serial</string> </key> - <value> <string>972.38681.356.33024</string> </value> + <value> <string>974.29171.1584.24746</string> </value> </item> <item> <key> <string>state</string> </key> @@ -573,7 +576,7 @@ NETWORK:\n </tuple> <state> <tuple> - <float>1552960501.44</float> + <float>1554923957.36</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.html b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.html index 8d9b5cb6f..e04213ef6 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.html +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.html @@ -24,6 +24,9 @@ </div> </script> + <script id="panel-template-warning-link" type="text/x-handlebars-template"> + <li><a href="#" id="attention-point-link" class="ui-btn-icon-notext ui-icon-warning attention-point-link">Warnings ({{amount}})</a></li> + </script> <script id="panel-template-body" type="text/x-handlebars-template"> <div class="ui-content"> <ul data-role="listview" class="ui-listview" data-enhanced="true"> @@ -47,6 +50,10 @@ <div data-gadget-url="gadget_erp5_panel_shortcut.html" data-gadget-scope="erp5_panel_shortcut" data-gadget-sandbox="public"></div> + <dl></dl> + <ul data-role="listview" class="ui-listview ul-attention-point" data-enhanced="true"> + <li></li> + </ul> </div> </script> <!-- custom script --> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.xml index 346b5c1d9..a04bc7df6 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_html.xml @@ -220,7 +220,7 @@ </item> <item> <key> <string>actor</string> </key> - <value> <string>ERP5TypeTestCase</string> </value> + <value> <string>zope</string> </value> </item> <item> <key> <string>comment</string> </key> @@ -234,7 +234,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>965.45193.17797.6212</string> </value> + <value> <string>974.61786.203.13243</string> </value> </item> <item> <key> <string>state</string> </key> @@ -252,7 +252,7 @@ </tuple> <state> <tuple> - <float>1519396467.53</float> + <float>1554918794.64</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.js index f11d13b0e..3a7cafaf9 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.js @@ -14,6 +14,9 @@ .innerHTML), panel_template_body = Handlebars.compile(template_element .getElementById("panel-template-body") + .innerHTML), + panel_template_warning_link = Handlebars.compile(template_element + .getElementById("panel-template-warning-link") .innerHTML); gadget_klass @@ -25,7 +28,10 @@ // acquired method ////////////////////////////////////////////// .declareAcquiredMethod("getUrlFor", "getUrlFor") + .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("translateHtml", "translateHtml") + .declareAcquiredMethod("translate", "translate") + .declareAcquiredMethod("renderEditorPanel", "renderEditorPanel") .declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("redirect", "redirect") @@ -44,28 +50,10 @@ }) .declareMethod('render', function (options) { - var erp5_document = options.erp5_document, - workflow_list, - view_list; - if (erp5_document !== undefined) { - workflow_list = erp5_document._links.action_workflow || []; - view_list = erp5_document._links.action_object_view || []; - if (workflow_list.constructor !== Array) { - workflow_list = [workflow_list]; - } - if (view_list.constructor !== Array) { - view_list = [view_list]; - } - // Prevent has much as possible to modify the DOM panel - // stateChange prefer to compare strings - workflow_list = JSON.stringify(workflow_list); - view_list = JSON.stringify(view_list); - } return this.changeState({ - workflow_list: workflow_list, - view_list: view_list, global: true, - editable: options.editable + editable: true, + jio_key: options.jio_key }); }) @@ -73,6 +61,7 @@ var context = this, gadget = this, queue = new RSVP.Queue(), + jio_key = modification_dict.jio_key, tmp_element; if (modification_dict.hasOwnProperty("visible")) { @@ -139,70 +128,12 @@ return context.listenResize(); }); } - - if ((this.state.global === true) && - (modification_dict.hasOwnProperty("desktop") || - modification_dict.hasOwnProperty("editable") || - modification_dict.hasOwnProperty("workflow_list") || - modification_dict.hasOwnProperty("view_list"))) { - if (!(this.state.desktop && (this.state.view_list !== undefined))) { - queue - .push(function () { - gadget.element.querySelector("dl").textContent = ''; - }); - } else { - queue - .push(function () { - var i = 0, - promise_list = [], - workflow_list = JSON.parse(gadget.state.workflow_list), - view_list = JSON.parse(gadget.state.view_list); - - for (i = 0; i < workflow_list.length; i += 1) { - promise_list.push( - gadget.getUrlFor({ - command: 'change', - options: { - view: workflow_list[i].href, - page: undefined - } - }) - ); - } - for (i = 0; i < view_list.length; i += 1) { - promise_list.push( - gadget.getUrlFor({ - command: 'change', - options: { - view: view_list[i].href, - page: undefined - } - }) - ); - } - return RSVP.all(promise_list); - }) - .push(function (result_list) { - var i, - result_workflow_list = [], - result_view_list = [], - workflow_list = JSON.parse(gadget.state.workflow_list), - view_list = JSON.parse(gadget.state.view_list); - - for (i = 0; i < workflow_list.length; i += 1) { - result_workflow_list.push({ - title: workflow_list[i].title, - href: result_list[i] - }); - } - for (i = 0; i < view_list.length; i += 1) { - result_view_list.push({ - title: view_list[i].title, - href: result_list[i + workflow_list.length] - }); - } - }); - } + // Check for Alerts to pop + if (!(jio_key === undefined || jio_key === null)) { + queue + .push(function () { + return context.calculateMyAttentionPointList(jio_key, false); + }); } return queue; @@ -216,6 +147,10 @@ (evt.target.tagName === 'BUTTON')) { return this.toggle(); } + if (this.element.querySelector('a[id="attention-point-link"]') === evt.target) { + evt.preventDefault(); + return this.calculateMyAttentionPointList(this.state.jio_key, true); + } }, false, false) .declareJob('listenResize', function () { @@ -246,34 +181,52 @@ // Typing a search query should not modify the header status return; }) - .onEvent('submit', function () { - var gadget = this; - return gadget.getDeclaredGadget("erp5_searchfield") - .push(function (search_gadget) { - return search_gadget.getContent(); + .declareJob("calculateMyAttentionPointList", function (jio_key, force_open) { + var context = this, + queue = new RSVP.Queue(), + attention_point_ul = document.querySelector('ul.ul-attention-point'), + seen_attention_point_dict = JSON.parse(window.sessionStorage.getItem('seen_attention_point_dict') || "{}"); + return queue + .push(function () { + return context.getSetting('hateoas_url'); }) - .push(function (data) { - var options = { - page: "search" - }; - if (data.search) { - options.extended_search = data.search; + .push(function (hateoas_url) { + if (jio_key === false || jio_key === undefined || jio_key === null) { + return [[], 'No Alert']; + } + return RSVP.all([context.jio_getAttachment( + jio_key, + hateoas_url + jio_key + '/Base_getAttentionPointList' + ), + context.translate('No Alert!') + ]); + }) + .push(function (result_list) { + var attention_point_list = result_list[0], + no_alert_caption = result_list[1]; + if (attention_point_list.length > 0) { + if (!Boolean(document.querySelector('#attention-point-link'))) { + attention_point_ul.innerHTML = panel_template_warning_link({ + amount: attention_point_list.length + }); + } + if (force_open || (JSON.stringify(seen_attention_point_dict[jio_key]) != JSON.stringify(attention_point_list))) { + seen_attention_point_dict[jio_key] = attention_point_list; + window.sessionStorage.setItem('seen_attention_point_dict', JSON.stringify(seen_attention_point_dict)); + return context.renderEditorPanel("gadget_erp5_attention_point.html", { + attention_point_list: attention_point_list + }); + } + } else { + attention_point_ul.innerHTML = "<li></li>"; + if (force_open) { + return context.renderEditorPanel("gadget_erp5_attention_point.html", { + attention_point_list: [[no_alert_caption, 'no-alert']] + }); + } } - // Remove focus from the search field - document.activeElement.blur(); - return gadget.redirect({command: 'display', options: options}); }); - - }, false, true) - - .onEvent('blur', function (evt) { - // XXX Horrible hack to clear the search when focus is lost - // This does not follow renderJS design, as a gadget should not touch - // another gadget content - if (evt.target.type === 'search') { - evt.target.value = ""; - } - }, true, false); + }); }(window, document, rJS, Handlebars, RSVP, Node, loopEventListener)); diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.xml index 7d5545dc2..199d79837 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_panel_js.xml @@ -227,7 +227,7 @@ </item> <item> <key> <string>actor</string> </key> - <value> <string>ERP5TypeTestCase</string> </value> + <value> <string>zope</string> </value> </item> <item> <key> <string>comment</string> </key> @@ -241,7 +241,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>966.41526.6603.40089</string> </value> + <value> <string>974.61794.16321.5393</string> </value> </item> <item> <key> <string>state</string> </key> @@ -259,7 +259,7 @@ </tuple> <state> <tuple> - <float>1522944680.15</float> + <float>1554920653.43</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py new file mode 100644 index 000000000..4c966304e --- /dev/null +++ b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py @@ -0,0 +1,3 @@ +from json import dumps + +return dumps([]) diff --git a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.xml b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.xml new file mode 100644 index 000000000..9a782509a --- /dev/null +++ b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Base_getAttentionPointList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio/bt/template_path_list b/master/bt5/slapos_jio/bt/template_path_list index 218458f8b..d2c2c4cc2 100644 --- a/master/bt5/slapos_jio/bt/template_path_list +++ b/master/bt5/slapos_jio/bt/template_path_list @@ -1,6 +1,9 @@ image_module/gadget_slapos_panel_png web_page_module/gadget_erp5_page_slap_reject_upgrade_decision_html web_page_module/gadget_erp5_page_slap_reject_upgrade_decision_js +web_page_module/rjs_gadget_erp5_attention_point_css +web_page_module/rjs_gadget_erp5_attention_point_html +web_page_module/rjs_gadget_erp5_attention_point_js web_page_module/rjs_gadget_erp5_page_map_css web_page_module/rjs_gadget_erp5_page_map_html web_page_module/rjs_gadget_erp5_page_map_js -- 2.30.9