Commit 6e2f2e3e authored by francois's avatar francois

Merge branch 'master' of https://lab.nexedi.com/nexedi/erp5 into francois

parents 42599ad6 0eed2ec0
......@@ -76,9 +76,13 @@ def Base_executeJupyter(self, python_expression=None, reference=None, \
title=title,
reference=reference,
batch_mode=True)
# Add new Data Notebook Line to the Data Notebook
data_notebook_line = data_notebook.DataNotebook_addDataNotebookLine(
# By default, store_history is True
store_history = kw.get('store_history', True)
data_notebook_line = None
if store_history:
# Add new Data Notebook Line to the Data Notebook
data_notebook_line = data_notebook.DataNotebook_addDataNotebookLine(
notebook_code=python_expression,
batch_mode=True)
......@@ -138,10 +142,11 @@ def Base_executeJupyter(self, python_expression=None, reference=None, \
u'status': u'error',
u'mime_type': result['mime_type']}
serialized_result = json.dumps(result)
data_notebook_line.edit(
notebook_code_result = result['code_result'],
mime_type = result['mime_type'])
if data_notebook_line is not None:
data_notebook_line.edit(
notebook_code_result = result['code_result'],
mime_type = result['mime_type'])
return serialized_result
......
import json
# This script provides the backend-functionality of the Juypter Notebook RenderJS Extension.
# Due to the internal protocol of the ERP5Kernel and the ERP5-Jupyter-Backend messages between
# Javascript in the client and the ERP5Kernel are exchange via objections containing
# Javascript code as _repr_html_.
# Here a schematic overview of the messaging:
# 1. Extension-Function is called in the notebook (e.g. loadGadget("gadget", "https://someurl.com/gadget"))
# 2. Code is processed by the ERP5Kernel (client)
# 3. Code is sent to the ERP5-Backend
# 4. The required logic is handled by this script in the backend
# 5. This script returns an object with _repr_html_ containing the JS-response for the client
# 6. The ERP5-Backend sends a response to the ERP5Kernel (client)
# 7. The ERP5Kernel interprets the object with _repr_html_ as text/html message and injects it into the notebook
# 8. Now the Javascript code is executed as part of the (client) extension (e.g. a renderJS-gadget is loaded into the page)
class RJSExtension:
def __init__(self):
pass
# Create the original load_gadget with modified rsvp, renderjs
# Because jupyter notebook has already loaded when this can be called
# a manual initialization of the whole renderJS setup is required
#
# First the libs rsvp, renderjs-gadget-global and renderjs (patched)
# are injected into the page. The patch on renderjs itself is to enable
# the following manual bootstrap
# After the scripts are present, a div is appended containing the
# loading_gadget.
# After everything is inplace, rJS.manualBootstrap initializes the
# loading_gadget in exactly the same way as when rJS is normally initialized
# (on-load)
def initRenderJS(self):
script = '''
<script>
var loadingDiv = document.querySelector(".loading_gadget");
if(loadingDiv == null) {
console.log("~~ Initializing RenderJS!");
$.getScript("/nbextensions/renderjs_nbextension/rsvp-2.0.4.js", function() {
console.log("~~ loading_gadget: rsvp.js loaded");
$.getScript("/nbextensions/renderjs_nbextension/rjs_gadget_global_js.js", function() {
console.log("~~ loading_gadget: renderjs-gadget-global.js loaded");
$.getScript("/nbextensions/renderjs_nbextension/renderjs-latest.js", function() {
console.log("~~ loading_gadget: renderjs.js loaded");
$("#notebook-container").append('<div data-gadget-url="/nbextensions/renderjs_nbextension/loading_gadget.html" data-gadget-scope="public"></div>');
rJS.manualBootstrap();
});
});
});
} else {
console.log("~~ Renderjs seems to be initialized already!");
}
</script>'''
return RJSHtmlMessage(script)
# Load a gadget given a unique ref and URL to the HTML file of the gadget
# -> Fires an event which loading_gadget listens on and passes on the URL
def loadGadget(self, ref, gadgetUrl):
script = '''
<script>
var load_event = new CustomEvent("load_gadget",
{ "detail": { "url": "''' + gadgetUrl + '", "gadgetId": "' + ref + '''" }});
var loadingDiv = document.querySelector(".loading_gadget");
if(loadingDiv != null) {
loadingDiv.dispatchEvent(load_event);
} else {
console.log("~~ load: RenderJS init required first!");
}
</script>
'''
return RJSHtmlMessage(script)
# Fires an event with
# * the ref of the gadget
# * the name of the declared_method
# * the arguments to be passed to the declared_method
# The arguments are packed into a json string and passed to js as such
def callDeclaredMethod(self, ref, method_name, *args):
j_str = json.dumps(args)
script = '''
<script>
var call_event = new CustomEvent("call_gadget",
{ "detail": {
"gadgetId": "''' + ref + '''",
"methodName": "''' + method_name + '''",
"methodArgs": ''' + "'" + j_str + "'" + '''
}});
var loadingDiv = document.querySelector(".loading_gadget");
if(loadingDiv != null) {
loadingDiv.dispatchEvent(call_event);
} else {
console.log("~~ call: RenderJS init required first!");
}
</script>
'''
return RJSHtmlMessage(script)
# Fires an event to the destroy this gadget
# Only thing passed is the ref of the gadget
def destroyGadget(self, ref):
script = '''
<script>
var destroy_event = new CustomEvent("destroy_gadget",
{ "detail": { "gadgetId": "''' + ref + '''" }});
var loadingDiv = document.querySelector(".loading_gadget");
if(loadingDiv != null) {
loadingDiv.dispatchEvent(destroy_event);
} else {
console.log("~~ destroy: RenderJS init required first!");
}
</script>
'''
return RJSHtmlMessage(script)
class RJSHtmlMessage:
'''
Represents a HTML-injection into the frontend. Returning such an object from the ERP5
backend is sufficient, as the _repr_html_ will be called internally.
'''
def __init__(self, html):
self.html = html
def _repr_html_(self):
return self.html
obj = RJSExtension()
return obj
<?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_loadRenderJSExtension</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -44,7 +44,7 @@
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
<string>View</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" 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>
<string>Owner</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>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>ce5a57e429d1510b8871c6582d2aa9b9</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_panel.png</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>filename</string> </key>
<value> <string>erp5.png</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>63</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_panel_png</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Panel Logo</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>151</int> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1487069105.74</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="7" aka="AAAAAAAAAAc=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.20613.6378.6058</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1487069520.38</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -108,7 +108,7 @@
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
# generated on Thu, 20 Dec 2016 15:00:00 GMT XXX\n
# generated on Wed, 01 Mar 2017 15:00:00 GMT\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
......@@ -197,6 +197,7 @@ gadget_erp5_page_worklist.html\n
gadget_erp5_page_worklist.js\n
gadget_erp5_panel.html\n
gadget_erp5_panel.js\n
gadget_erp5_panel.png?format=png\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_pt_form_list.html\n
......@@ -368,7 +369,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.4318.43275.52838</string> </value>
<value> <string>957.46857.4036.21879</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -386,7 +387,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1482249891.22</float>
<float>1488385456.73</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -42,6 +42,10 @@
};
}
function initPanelOptions(gadget) {
gadget.props.panel_argument_list = {};
}
function route(my_root_gadget, my_scope, my_method, argument_list) {
return RSVP.Queue()
.push(function () {
......@@ -67,6 +71,13 @@
});
}
function updatePanel(gadget) {
return gadget.getDeclaredGadget("panel")
.push(function (panel_gadget) {
return panel_gadget.render(gadget.props.panel_argument_list);
});
}
function increaseLoadingCounter(gadget) {
return new RSVP.Queue()
.push(function () {
......@@ -148,6 +159,10 @@
if (error instanceof Error) {
console.error(error.stack);
}
if (gadget.props === undefined) {
// Gadget has not yet been correctly initialized
throw error;
}
// XXX Improve error rendering
gadget.props.content_element.innerHTML = "<br/><br/><br/><pre></pre>";
gadget.props.content_element.querySelector('pre').textContent =
......@@ -235,13 +250,11 @@
return jio_gadget.createJio(setting.jio_storage_description);
})
.push(function () {
return gadget.getDeclaredGadget('panel');
})
.push(function (panel_gadget) {
return panel_gadget.render();
return panel_gadget.render({});
})
.push(function () {
return gadget.getDeclaredGadget('router');
})
......@@ -407,6 +420,12 @@
});
})
.allowPublicAcquisition("updatePanel", function (param_list) {
var gadget = this;
initPanelOptions(gadget);
gadget.props.panel_argument_list = param_list[0];
})
.allowPublicAcquisition('triggerPanel', function () {
return route(this, "panel", "toggle");
})
......@@ -487,7 +506,10 @@
content_container.appendChild(main_gadget.element);
element.appendChild(content_container);
return updateHeader(gadget);
return RSVP.all([
updateHeader(gadget),
updatePanel(gadget)
]);
// XXX Drop notification
// return header_gadget.notifyLoaded();
}
......@@ -500,7 +522,10 @@
return page_gadget.render(gadget.state.options);
})
.push(function () {
return updateHeader(gadget);
return RSVP.all([
updateHeader(gadget),
updatePanel(gadget)
]);
});
})
// Render the page
......@@ -512,6 +537,7 @@
// By default, init the header options to be empty
// (ERP5 title by default + sidebar)
initHeaderOptions(gadget);
initPanelOptions(gadget);
return new RSVP.Queue()
.push(function () {
return increaseLoadingCounter(gadget);
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.5832.50053.43878</string> </value>
<value> <string>957.35152.14703.9045</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482250162.82</float>
<float>1487941504.18</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,6 +4,8 @@
<!--
data-i18n=No records
data-i18n=Records
data-i18n=Hide Rows
data-i18n=Submit
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
......@@ -149,10 +151,10 @@
<script id="listbox-template" type="text/x-handlebars-template">
<div class="ui-table-header ui-header ui-bar-c ui-corner-all">
<h1 data-i18n="{{title}}" class="ui-title ui-override-theme">{{title}}</h1>
<h1 data-i18n="{{title}}" class="ui-title ui-override-theme">{{title}}<span> <span class="listboxloader ui-icon-spinner ui-btn-icon-left"></span></span></h1>
<!--div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls"-->
<button data-rel="hide" data-i18n="Hide Rows" name="Hide" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left {{hide_class}}">Hide Rows</button>
<button data-rel="hide" data-i18n="{{hide_button_text}}" name="{{hide_button_name}}" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left {{hide_class}}">{{hide_button_text}}</button>
<!--/div>
</div>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>953.48474.52969.47820</string> </value>
<value> <string>958.1079.25051.23586</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1474554275.61</float>
<float>1489595378.88</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -37,19 +37,12 @@
.getElementById("error-message-template")
.innerHTML,
error_message_template = Handlebars.compile(error_message_source),
variable = {};
variable = {},
loading_class_list = ['ui-icon-spinner', 'ui-btn-icon-left'],
disabled_class = 'ui-disabled';
function renderListboxThead(gadget, template) {
return gadget.translateHtml(template({
head_value: gadget.props.head_value,
show_anchor: gadget.state.show_anchor,
line_icon: gadget.state.line_icon
}));
}
function renderEditableField(gadget, element) {
function renderEditableField(gadget, element, column_list) {
var i,
promise_list = [],
uid_value_dict = {},
......@@ -74,37 +67,38 @@
column = element_list[i].getAttribute("column");
line = element_list[i].getAttribute("line");
if (gadget.props.listbox_uid_dict.key === undefined) {
gadget.props.listbox_uid_dict.key = gadget.props.result.data.rows[line].value["listbox_uid:list"].key;
gadget.props.listbox_uid_dict.value = [gadget.props.result.data.rows[line].value["listbox_uid:list"].value];
uid_value_dict[gadget.props.result.data.rows[line].value["listbox_uid:list"].value] = null;
gadget.props.listbox_uid_dict.key = gadget.state.allDocs_result.data.rows[line].value["listbox_uid:list"].key;
gadget.props.listbox_uid_dict.value = [gadget.state.allDocs_result.data.rows[line].value["listbox_uid:list"].value];
uid_value_dict[gadget.state.allDocs_result.data.rows[line].value["listbox_uid:list"].value] = null;
} else {
uid_value = gadget.props.result.data.rows[line].value["listbox_uid:list"].value;
uid_value = gadget.state.allDocs_result.data.rows[line].value["listbox_uid:list"].value;
if (!uid_value_dict.hasOwnProperty(uid_value)) {
uid_value_dict[uid_value] = null;
gadget.props.listbox_uid_dict.value.push(uid_value);
}
}
promise_list.push(renderSubCell(element_list[i],
gadget.props.result.data.rows[line].value[gadget.state.column_list[column][0]] || ""));
gadget.state.allDocs_result.data.rows[line].value[column_list[column][0]] || ""));
}
return RSVP.all(promise_list);
}
function renderListboxTbody(gadget, template) {
var tmp;
function renderListboxTbody(gadget, template, body_value) {
var tmp,
column_list = JSON.parse(gadget.state.column_list_json);
return gadget.translateHtml(template(
{
"body_value": gadget.props.body_value,
"body_value": body_value,
"show_anchor": gadget.state.show_anchor,
"column_list": gadget.state.column_list
"column_list": column_list
}
))
.push(function (my_html) {
tmp = document.createElement("tbody");
tmp.innerHTML = my_html;
return renderEditableField(gadget, tmp);
return renderEditableField(gadget, tmp, column_list);
})
.push(function () {
var table = gadget.element.querySelector("table"),
......@@ -115,15 +109,15 @@
}
function renderListboxTfoot(gadget) {
function renderListboxTfoot(gadget, foot) {
return gadget.translateHtml(listbox_tfoot_template(
{
"colspan": gadget.props.foot.colspan,
"previous_classname": gadget.props.foot.previous_classname,
"previous_url": gadget.props.foot.previous_url,
"record": gadget.props.foot.record,
"next_classname": gadget.props.foot.next_classname,
"next_url": gadget.props.foot.next_url
"colspan": foot.colspan,
"previous_classname": foot.previous_classname,
"previous_url": foot.previous_url,
"record": foot.record,
"next_classname": foot.next_classname,
"next_url": foot.next_url
}
));
}
......@@ -161,6 +155,8 @@
i,
sort_column_list = [],
search_column_list = [],
query_string,
url_query,
queue;
//only display which is in listbox's column list
......@@ -187,6 +183,17 @@
}
search_column_list.push(["searchable_text", "Searchable Text"]);
url_query = options.extended_search;
query_string = new URI(field_json.query).query(true).query;
if (url_query) {
//query_string = field_json.column_list.reduce(buildQueryString, ' AND (').replace(new RegExp("OR " + '$'), ')');
if (query_string) {
query_string = '(' + query_string + ') AND (' + url_query + ')';
} else {
query_string = url_query;
}
}
queue = RSVP.Queue();
if (!variable.translated_records) {
queue
......@@ -204,7 +211,7 @@
queue
.push(function () {
// Cancel previous line rendering to not conflict with the asynchronous render for now
return gadget.renderContent(true);
return gadget.fetchLineContent(true);
})
.push(function () {
// XXX Fix in case of multiple listboxes
......@@ -220,77 +227,293 @@
editable: field_json.editable,
begin_from: parseInt(result_list[0] || '0', 10) || 0,
sort_list: result_list[1] || [],
sort_list_json: JSON.stringify(result_list[1] || []),
show_anchor: field_json.show_anchor,
line_icon: field_json.line_icon,
query: field_json.query,
query_string: query_string,
lines: field_json.lines,
list_method: field_json.list_method,
list_method_template: field_json.list_method_template,
column_list: field_json.column_list,
sort_column_list: sort_column_list,
search_column_list: search_column_list,
column_list_json: JSON.stringify(field_json.column_list),
sort_column_list_json: JSON.stringify(sort_column_list),
search_column_list_json: JSON.stringify(search_column_list),
hide_sort: field_json.sort_column_list.length ? "" : "ui-disabled",
field_id: options.field_id,
extended_search: options.extended_search,
hide_class: options.hide_enabled ? "" : "ui-disabled",
command: field_json.command || 'index'
command: field_json.command || 'index',
// Force line calculation in any case
allDocs_result: undefined,
// No error message
has_error: false,
show_line_selector: false
});
})
.push(function () {
// Force line calculation in any case
return gadget.renderContent();
});
return queue;
})
.onStateChange(function () {
.onStateChange(function (modification_dict) {
var gadget = this,
head_value = [],
head_value_list = [],
class_value,
sort_list,
column_list,
tmp,
i,
j;
for (i = 0; i < gadget.state.column_list.length; i += 1) {
class_value = "";
for (j = 0; j < gadget.state.sort_list.length; j += 1) {
tmp = gadget.state.sort_list[j];
if (tmp[0] === gadget.state.column_list[i][0]) {
if (tmp[1] === "ascending") {
class_value = "ui-icon ui-icon-arrow-up";
} else {
class_value = "ui-icon ui-icon-arrow-down";
j,
result_queue = new RSVP.Queue();
/*
if (modification_dict.hasOwnProperty('error_text') && this.state.error_text !== undefined) {
// XXX TODO
this.element.querySelector('tfoot').textContent =
"Unsupported list method: '" + this.state.list_method + "'";
loading_element_classList.remove.apply(loading_element_classList, loading_class_list);
return;
}
*/
if (gadget.state.has_error) {
return result_queue
.push(function () {
var options = {extended_search: undefined};
options[gadget.state.key + "_sort_list:json"] = undefined;
return gadget.getUrlFor({
command: 'store_and_change',
options: options
});
})
.push(function (url) {
return gadget.translateHtml(error_message_template({
reset_url: url
}));
})
.push(function (html) {
gadget.element.querySelector(".document_table").innerHTML = html;
});
}
if ((modification_dict.hasOwnProperty('sort_list_json')) ||
(modification_dict.hasOwnProperty('column_list_json')) ||
(modification_dict.hasOwnProperty('title')) ||
(modification_dict.hasOwnProperty('has_error')) ||
(modification_dict.hasOwnProperty('show_line_selector')) ||
(modification_dict.hasOwnProperty('hide_sort')) ||
(modification_dict.hasOwnProperty('hide_class'))) {
sort_list = JSON.parse(gadget.state.sort_list_json);
column_list = JSON.parse(gadget.state.column_list_json);
for (i = 0; i < column_list.length; i += 1) {
class_value = "";
for (j = 0; j < sort_list.length; j += 1) {
tmp = sort_list[j];
if (tmp[0] === column_list[i][0]) {
if (tmp[1] === "ascending") {
class_value = "ui-icon ui-icon-arrow-up";
} else {
class_value = "ui-icon ui-icon-arrow-down";
}
break;
}
break;
}
head_value_list.push({
"data-i18n": column_list[i][1],
"class_value": class_value,
"text": column_list[i][1]
});
}
head_value.push({
"data-i18n": gadget.state.column_list[i][1],
"class_value": class_value,
"text": gadget.state.column_list[i][1]
});
result_queue
.push(function () {
var listbox_thead_template,
hide_button_text,
hide_button_name;
if (gadget.state.show_line_selector) {
listbox_thead_template = listbox_show_thead_template;
hide_button_text = 'Submit';
hide_button_name = 'SelectRows';
} else {
listbox_thead_template = listbox_hidden_thead_template;
hide_button_text = 'Hide Rows';
hide_button_name = 'Hide';
}
return RSVP.all([
gadget.translateHtml(listbox_template({
hide_class: gadget.state.hide_class,
hide_sort: gadget.state.hide_sort,
title: gadget.state.title,
hide_button_text: hide_button_text,
hide_button_name: hide_button_name
})),
gadget.translateHtml(listbox_thead_template({
head_value: head_value_list,
show_anchor: gadget.state.show_anchor,
line_icon: gadget.state.line_icon
}))
]);
})
.push(function (result_list) {
gadget.element.querySelector(".document_table").innerHTML = result_list[0];
gadget.element.querySelector(".thead").innerHTML = result_list[1];
});
}
gadget.props.head_value = head_value;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.translateHtml(listbox_template({
hide_class: gadget.state.hide_class,
hide_sort: gadget.state.hide_sort,
title: gadget.state.title
})),
renderListboxThead(gadget, listbox_hidden_thead_template)
]);
})
.push(function (result_list) {
gadget.element.querySelector(".document_table").innerHTML = result_list[0];
gadget.element.querySelector(".thead").innerHTML = result_list[1];
});
if (gadget.state.allDocs_result === undefined) {
// Trigger line content calculation
result_queue
.push(function () {
var loading_element_classList = gadget.element.querySelector(".listboxloader").classList,
tbody_classList = gadget.element.querySelector("table").querySelector("tbody").classList;
// Set the loading icon and trigger line calculation
loading_element_classList.add.apply(loading_element_classList, loading_class_list);
tbody_classList.add(disabled_class);
return gadget.fetchLineContent(false);
});
} else if ((modification_dict.hasOwnProperty('show_line_selector')) ||
(modification_dict.hasOwnProperty('allDocs_result'))) {
// Render the listbox content
result_queue
.push(function () {
var lines = gadget.state.lines,
promise_list = [],
allDocs_result = gadget.state.allDocs_result,
counter;
column_list = JSON.parse(gadget.state.column_list_json);
if (lines === 0) {
lines = allDocs_result.data.total_rows;
counter = allDocs_result.data.total_rows;
} else {
counter = Math.min(allDocs_result.data.total_rows, lines);
}
sort_list = JSON.parse(gadget.state.sort_list_json);
for (i = 0; i < counter; i += 1) {
promise_list.push(
gadget.getUrlFor({
command: gadget.state.command,
options: {
jio_key: allDocs_result.data.rows[i].id,
uid: allDocs_result.data.rows[i].value.uid,
selection_index: gadget.state.begin_from + i,
query: gadget.state.query_string,
list_method_template: gadget.state.list_method_template,
"sort_list:json": sort_list
}
})
);
}
return new RSVP.Queue()
.push(function () {
return RSVP.all(promise_list);
})
.push(function (result_list) {
var value,
body_value = [],
tr_value = [],
tmp_url,
listbox_tbody_template;
for (i = 0; i < counter; i += 1) {
tmp_url = result_list[i];
tr_value = [];
for (j = 0; j < column_list.length; j += 1) {
value = allDocs_result.data.rows[i].value[column_list[j][0]] || "";
tr_value.push({
"type": value.type,
"editable": value.editable && gadget.state.editable,
"href": tmp_url,
"text": value,
"line": i,
"column": j
});
}
body_value.push({
"value": allDocs_result.data.rows[i].value.uid,
"jump": tmp_url,
"tr_value": tr_value,
"line_icon": gadget.state.line_icon
});
}
if (gadget.state.show_line_selector) {
listbox_tbody_template = listbox_show_tbody_template;
} else {
listbox_tbody_template = listbox_hidden_tbody_template;
}
return renderListboxTbody(gadget, listbox_tbody_template, body_value);
})
.push(function () {
var prev_param = {},
next_param = {};
function setNext() {
if (allDocs_result.data.rows.length > lines) {
next_param[gadget.state.key + '_begin_from'] = gadget.state.begin_from + lines;
}
}
if (gadget.state.begin_from === 0) {
setNext();
} else {
prev_param[gadget.state.key + '_begin_from'] = gadget.state.begin_from - lines;
setNext();
}
return RSVP.all([
gadget.getUrlFor({command: 'change', options: prev_param}),
gadget.getUrlFor({command: 'change', options: next_param})
]);
})
.push(function (url_list) {
var foot = {};
foot.colspan = column_list.length + gadget.state.show_anchor +
(gadget.state.line_icon ? 1 : 0);
foot.previous_classname = "ui-btn ui-icon-carat-l ui-btn-icon-left responsive ui-first-child";
foot.previous_url = url_list[0];
foot.next_classname = "ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child";
foot.next_url = url_list[1];
if ((gadget.state.begin_from === 0) && (counter === 0)) {
foot.record = variable.translated_no_record;
} else if ((allDocs_result.data.rows.length <= lines) && (gadget.state.begin_from === 0)) {
foot.record = counter + " " + variable.translated_records;
} else {
foot.record = variable.translated_records + " " + (((gadget.state.begin_from + lines) / lines - 1) * lines + 1) + " - " + (((gadget.state.begin_from + lines) / lines - 1) * lines + counter);
}
if (gadget.state.begin_from === 0) {
foot.previous_classname += " ui-disabled";
}
if (allDocs_result.data.rows.length <= lines) {
foot.next_classname += " ui-disabled";
}
return renderListboxTfoot(gadget, foot);
})
.push(function (my_html) {
gadget.element.querySelector(".tfoot").innerHTML = my_html;
var loading_element_classList = gadget.element.querySelector(".listboxloader").classList;
loading_element_classList.remove.apply(loading_element_classList, loading_class_list);
});
});
}
return result_queue;
})
.declareMethod('getListboxInfo', function () {
......@@ -298,7 +521,7 @@
//construct search panel
//hardcoded begin_from key to define search position
return {
search_column_list: this.state.search_column_list,
search_column_list: JSON.parse(this.state.search_column_list_json),
begin_from: this.state.key + "_begin_from"
};
})
......@@ -306,199 +529,64 @@
//////////////////////////////////////////////
// render the listbox in an asynchronous way
//////////////////////////////////////////////
.declareJob('renderContent', function (only_cancel) {
var gadget = this,
// props = gadget.props,
// field_json = props.field_json,
begin_from = this.state.begin_from,
url_query = this.state.extended_search,
query_string,
lines = this.state.lines,
select_list = [],
dataset,
counter,
limit_options,
i;
.declareJob('fetchLineContent', function (only_cancel) {
if (only_cancel) {
return;
}
if (this.state.query === undefined) {
gadget.element.querySelector('tfoot').textContent =
"Unsupported list method: '" + this.state.list_method + "'";
return;
/*
return this.changeState({
error_text: "Unsupported list method: '" + this.state.list_method + "'"
});
*/
return this.changeState({
has_error: true
});
}
// function buildQueryString(previous, next) {
// return previous + next[0] + ':= "' + url_query + '" OR ';
// }
query_string = new URI(this.state.query).query(true).query;
if (url_query) {
//query_string = field_json.column_list.reduce(buildQueryString, ' AND (').replace(new RegExp("OR " + '$'), ')');
if (query_string) {
query_string = '(' + query_string + ') AND (' + url_query + ')';
} else {
query_string = url_query;
}
}
var gadget = this,
select_list = [],
limit_options,
column_list = JSON.parse(gadget.state.column_list_json),
i;
for (i = 0; i < this.state.column_list.length; i += 1) {
select_list.push(this.state.column_list[i][0]);
for (i = 0; i < column_list.length; i += 1) {
select_list.push(column_list[i][0]);
}
select_list.push("uid");
if (lines === 0) {
if (gadget.state.lines === 0) {
limit_options = undefined;
} else {
limit_options = [begin_from, lines + 1];
limit_options = [gadget.state.begin_from, gadget.state.lines + 1];
}
return gadget.jio_allDocs({
// XXX Not jIO compatible, but until a better api is found...
"list_method_template": this.state.list_method_template,
"query": query_string,
"query": gadget.state.query_string,
"limit": limit_options,
"select_list": select_list,
"sort_on": gadget.state.sort_list
"sort_on": JSON.parse(gadget.state.sort_list_json)
})
.push(function (result) {
var promise_list = [result];
if (lines === 0) {
lines = result.data.total_rows;
counter = result.data.total_rows;
} else {
counter = Math.min(result.data.total_rows, lines);
}
for (i = 0; i < counter; i += 1) {
promise_list.push(
gadget.getUrlFor({
command: gadget.state.command,
options: {
jio_key: result.data.rows[i].id,
uid: result.data.rows[i].value.uid,
selection_index: begin_from + i,
query: query_string,
list_method_template: gadget.state.list_method_template,
"sort_list:json": gadget.state.sort_list
}
})
);
}
return new RSVP.Queue()
.push(function () {
return RSVP.all(promise_list);
})
.push(function (result_list) {
var j,
allDocs_result = result_list[0],
value,
body_value = [],
tr_value = [],
tmp_url;
dataset = allDocs_result;
for (i = 0; i < counter; i += 1) {
tmp_url = result_list[i + 1];
tr_value = [];
for (j = 0; j < gadget.state.column_list.length; j += 1) {
value = allDocs_result.data.rows[i].value[gadget.state.column_list[j][0]] || "";
tr_value.push({
"type": value.type,
"editable": value.editable && gadget.state.editable,
"href": tmp_url,
"text": value,
"line": i,
"column": j
});
}
body_value.push({
"value": allDocs_result.data.rows[i].value.uid,
"jump": tmp_url,
"tr_value": tr_value,
"line_icon": gadget.state.line_icon
});
}
gadget.props.body_value = body_value;
gadget.props.result = result;
return renderListboxTbody(gadget, listbox_hidden_tbody_template);
})
.push(function () {
var prev_param = {},
next_param = {};
function setNext() {
if (dataset.data.rows.length > lines) {
next_param[gadget.state.key + '_begin_from'] = begin_from + lines;
}
}
if (begin_from === 0) {
setNext();
} else {
prev_param[gadget.state.key + '_begin_from'] = begin_from - lines;
setNext();
}
return RSVP.all([
gadget.getUrlFor({command: 'change', options: prev_param}),
gadget.getUrlFor({command: 'change', options: next_param})
]);
})
.push(function (url_list) {
var foot = {};
foot.colspan = gadget.state.column_list.length + gadget.state.show_anchor +
(gadget.state.line_icon ? 1 : 0);
foot.default_colspan = foot.colspan;
foot.previous_classname = "ui-btn ui-icon-carat-l ui-btn-icon-left responsive ui-first-child";
foot.previous_url = url_list[0];
foot.next_classname = "ui-btn ui-icon-carat-r ui-btn-icon-right responsive ui-last-child";
foot.next_url = url_list[1];
if ((begin_from === 0) && (counter === 0)) {
foot.record = variable.translated_no_record;
} else if ((dataset.data.rows.length <= lines) && (begin_from === 0)) {
foot.record = counter + " " + variable.translated_records;
} else {
foot.record = variable.translated_records + " " + (((begin_from + lines) / lines - 1) * lines + 1) + " - " + (((begin_from + lines) / lines - 1) * lines + counter);
}
if (begin_from === 0) {
foot.previous_classname += " ui-disabled";
}
if (dataset.data.rows.length <= lines) {
foot.next_classname += " ui-disabled";
}
gadget.props.foot = foot;
return renderListboxTfoot(gadget);
})
.push(function (my_html) {
gadget.element.querySelector(".tfoot").innerHTML = my_html;
});
return gadget.changeState({
allDocs_result: result
});
}, function (error) {
// do not crash interface if allDocs fails
//this will catch all error, not only search criteria invalid error
if (error instanceof RSVP.CancellationError) {
throw error;
}
// do not crash interface if allDocs fails
//this will catch all error, not only search criteria invalid error
console.warn(error);
var options = {extended_search: undefined};
options[gadget.state.key + "_sort_list:json"] = undefined;
return gadget.getUrlFor({
command: 'store_and_change',
options: options
})
.push(function (url) {
return gadget.translateHtml(error_message_template({
reset_url: url
}));
})
.push(function (html) {
gadget.element.querySelector(".document_table").innerHTML = html;
});
return gadget.changeState({
has_error: true
});
});
})
.declareMethod("getContent", function (options) {
......@@ -538,93 +626,77 @@
var gadget = this,
sort_button = gadget.element.querySelector('button[name="Sort"]'),
hide_button = gadget.element.querySelector('button[name="Hide"]'),
select_button = gadget.element.querySelector('button[name="SelectRows"]'),
url,
options = {};
options = {},
all_hide_element_list,
hide_element_list = [],
query_list = [],
search_query,
i;
if (evt.target === sort_button) {
evt.preventDefault();
url = "gadget_erp5_sort_editor.html";
options.sort_column_list = gadget.state.sort_column_list;
options.sort_list = gadget.state.sort_list;
options.sort_column_list = JSON.parse(gadget.state.sort_column_list_json);
options.sort_list = JSON.parse(gadget.state.sort_list_json);
options.key = gadget.state.key + "_sort_list:json";
return gadget.renderEditorPanel(url, options);
}
if (evt.target === hide_button) {
evt.preventDefault();
return new RSVP.Queue()
.push(function () {
var i,
all_hide_elements,
query_list = [],
search_query,
thead_template,
tbody_template,
hide_button_html,
hide_elements = [];
if (gadget.props.foot.colspan === gadget.props.foot.default_colspan) {
thead_template = listbox_show_thead_template;
tbody_template = listbox_show_tbody_template;
hide_button_html = "Submit";
gadget.props.foot.colspan += 1;
} else {
//hide closed
//maybe submit
all_hide_elements = gadget.element.querySelectorAll(".hide_element");
for (i = 0; i < all_hide_elements.length; i += 1) {
if (!all_hide_elements[i].checked) {
hide_elements.push(all_hide_elements[i]);
}
}
if (hide_elements.length) {
for (i = 0; i < hide_elements.length; i += 1) {
query_list.push(new SimpleQuery({
key: "catalog.uid",
type: "simple",
operator: "!=",
value: hide_elements[i].getAttribute("value")
}));
}
if (gadget.state.extended_search) {
search_query = QueryFactory.create(gadget.state.extended_search);
}
if (search_query) {
query_list.push(search_query);
}
search_query = new ComplexQuery({
operator: "AND",
query_list: query_list,
type: "complex"
});
return gadget.redirect({
command: 'store_and_change',
options: {
"extended_search": Query.objectToSearchText(search_query)
}
});
}
return gadget.changeState({
show_line_selector: true
});
}
if (evt.target === select_button) {
evt.preventDefault();
//hide closed
//maybe submit
all_hide_element_list = gadget.element.querySelectorAll(".hide_element");
for (i = 0; i < all_hide_element_list.length; i += 1) {
if (!all_hide_element_list[i].checked) {
hide_element_list.push(all_hide_element_list[i]);
}
}
if (hide_element_list.length) {
for (i = 0; i < hide_element_list.length; i += 1) {
query_list.push(new SimpleQuery({
key: "catalog.uid",
type: "simple",
operator: "!=",
value: hide_element_list[i].getAttribute("value")
}));
}
if (gadget.state.extended_search) {
search_query = QueryFactory.create(gadget.state.extended_search);
}
if (search_query) {
query_list.push(search_query);
}
search_query = new ComplexQuery({
operator: "AND",
query_list: query_list,
type: "complex"
});
gadget.props.foot.colspan -= 1;
hide_button_html = "Hide Rows";
thead_template = listbox_hidden_thead_template;
tbody_template = listbox_hidden_tbody_template;
return gadget.redirect({
command: 'store_and_change',
options: {
"extended_search": Query.objectToSearchText(search_query)
}
return new RSVP.Queue()
.push(function () {
return RSVP.all([
renderListboxThead(gadget, thead_template),
renderListboxTbody(gadget, tbody_template),
renderListboxTfoot(gadget, listbox_tfoot_template),
gadget.translate(hide_button_html)
]);
})
.push(function (all_innerHTML) {
//change hide button's text
hide_button.innerHTML = all_innerHTML[3];
gadget.element.querySelector(".thead").innerHTML = all_innerHTML[0];
gadget.element.querySelector(".tfoot").innerHTML = all_innerHTML[2];
});
});
}
return gadget.changeState({
show_line_selector: false
});
}
}, false, false)
.allowPublicAcquisition("notifyInvalid", function () {
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.15532.4001.22118</string> </value>
<value> <string>958.1409.21281.2338</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1482835694.43</float>
<float>1489590055.78</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -337,10 +337,19 @@ textarea {
white-space: normal;
vertical-align: top;
transition: height 0.2s ease-out;
height: 4em;
}
textarea:focus {
height: 20em;
@media only screen and (max-width: 45em) {
textarea {
height: 4em;
}
textarea:focus {
height: 20em;
}
}
@media only screen and (min-width: 45em) and (max-width: 90em), only screen and (min-width: 90em) {
textarea {
min-height: 10em;
}
}
::-webkit-input-placeholder {
color: #575757;
......@@ -475,29 +484,76 @@ div[data-gadget-scope='panel'] div[data-role="header"] a::before {
display: none;
}
}
div[data-gadget-scope='panel'] div[data-gadget-scope='erp5_searchfield'] {
padding: 3pt 12pt;
}
div[data-gadget-scope='panel'] div[data-gadget-scope='erp5_searchfield'] button {
color: #FFFFFF;
}
div[data-gadget-scope='panel'] div[data-gadget-scope='erp5_searchfield'] input[type="search"] {
color: #FFFFFF !important;
background-color: #777777 !important;
}
div[data-gadget-scope='panel'] img {
text-align: left;
height: 100%;
}
div[data-gadget-scope='panel'] ul {
div[data-gadget-scope='panel'] ul:first-child {
margin-top: 30pt;
}
div[data-gadget-scope='panel'] ul li a {
color: #FFFFFF;
display: block;
padding: 3pt;
padding-left: 12pt;
display: block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
div[data-gadget-scope='panel'] ul li a:hover,
div[data-gadget-scope='panel'] ul li a:active {
background-color: #2b2b2b;
}
div[data-gadget-scope='panel'] ul li a::before {
width: 24pt;
}
div[data-gadget-scope='panel'] ul li a:hover,
div[data-gadget-scope='panel'] ul li a:active {
div[data-gadget-scope='panel'] dl {
background-color: #777777;
color: #1F1F1F;
transform-origin: 50% 0;
transform: scaleY(0);
transition: transform 0.2s ease-out;
}
div[data-gadget-scope='panel'] dl:not(:empty) {
transform: scaleY(1);
}
div[data-gadget-scope='panel'] dl dt {
padding: 3pt;
padding-left: 12pt;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
div[data-gadget-scope='panel'] dl dt::before {
width: 24pt;
}
div[data-gadget-scope='panel'] dl dd a {
color: #FFFFFF;
display: block;
padding: 3pt;
padding-left: 12pt;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
padding-left: 36pt;
}
div[data-gadget-scope='panel'] dl dd a:hover,
div[data-gadget-scope='panel'] dl dd a:active {
background-color: #2b2b2b;
}
div[data-gadget-scope='panel'] dl dd a::before {
width: 24pt;
}
/**********************************************
* Gadget: editor panel
**********************************************/
......@@ -855,7 +911,9 @@ div[data-gadget-scope='header'] .ui-header ul {
}
.gadget-content input[type='submit'] {
padding: 6pt;
background-color: #444444;
margin-top: 30pt;
margin-right: 12pt;
background-color: #FF6600;
color: #FFFFFF;
border-radius: 0.325em;
border-width: 1px;
......@@ -864,10 +922,10 @@ div[data-gadget-scope='header'] .ui-header ul {
}
.gadget-content input[type='submit']:hover,
.gadget-content input[type='submit']:focus {
background-color: #5e5e5e;
background-color: #ff8533;
}
.gadget-content input[type='submit']:active {
background-color: #777777;
background-color: #ffa366;
}
@media only screen and (min-width: 90em) {
.gadget-content {
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.17327.55379.35737</string> </value>
<value> <string>957.46743.737.30583</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1482940671.94</float>
<float>1488377833.8</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -19,13 +19,22 @@
</div>
</div>
<div class="panel_img">
<img class="ui-title" alt="ERP5" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAAA/CAMAAADaDqrIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMEM5NUE4MzQ5NjQxMUUzOUZEQUU2NUY1RTI1RjdCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMEM5NUE4NDQ5NjQxMUUzOUZEQUU2NUY1RTI1RjdCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAwQzk1QTgxNDk2NDExRTM5RkRBRTY1RjVFMjVGN0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAwQzk1QTgyNDk2NDExRTM5RkRBRTY1RjVFMjVGN0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+J9MJsAAAAwBQTFRF///////M//+Z//9m//8z//8A/8z//8zM/8yZ/8xm/8wz/8wA/5n//5nM/5mZ/5lm/5kz/5kA/2b//2bM/2aZ/2Zm/2Yz/2YA/zP//zPM/zOZ/zNm/zMz/zMA/wD//wDM/wCZ/wBm/wAz/wAAzP//zP/MzP+ZzP9mzP8zzP8AzMz/zMzMzMyZzMxmzMwzzMwAzJn/zJnMzJmZzJlmzJkzzJkAzGb/zGbMzGaZzGZmzGYzzGYAzDP/zDPMzDOZzDNmzDMzzDMAzAD/zADMzACZzABmzAAzzAAAmf//mf/Mmf+Zmf9mmf8zmf8Amcz/mczMmcyZmcxmmcwzmcwAmZn/mZnMmZmZmZlmmZkzmZkAmWb/mWbMmWaZmWZmmWYzmWYAmTP/mTPMmTOZmTNmmTMzmTMAmQD/mQDMmQCZmQBmmQAzmQAAZv//Zv/MZv+ZZv9mZv8zZv8AZsz/ZszMZsyZZsxmZswzZswAZpn/ZpnMZpmZZplmZpkzZpkAZmb/ZmbMZmaZZmZmZmYzZmYAZjP/ZjPMZjOZZjNmZjMzZjMAZgD/ZgDMZgCZZgBmZgAzZgAAM///M//MM/+ZM/9mM/8zM/8AM8z/M8zMM8yZM8xmM8wzM8wAM5n/M5nMM5mZM5lmM5kzM5kAM2b/M2bMM2aZM2ZmM2YzM2YAMzP/MzPMMzOZMzNmMzMzMzMAMwD/MwDMMwCZMwBmMwAzMwAAAP//AP/MAP+ZAP9mAP8zAP8AAMz/AMzMAMyZAMxmAMwzAMwAAJn/AJnMAJmZAJlmAJkzAJkAAGb/AGbMAGaZAGZmAGYzAGYAADP/ADPMADOZADNmADMzADMAAAD/AADMAACZAABmAAAzAAAAHHa7K3/AOojESZHJWZvNaKTSd63Whrbblb/fpMjks9Howtrt4e320uTx8Pb6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdfKHSQAAAOh0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ALItoLoAAAJkSURBVHja7NlZsqsgEABQ979C5kGGddxo4os0Q8BAynoFn0nUU23TNGRB9xzLdE3XdE3XdP2fLnIzF2VSrsYvC72HizAh9eZ5DVuOl15S4/jWwC+kDC8HPzCSJVHcRY8QXV2PwQuujUYTsYrvYlBv1yKLrsXHsPghnvR3Lazoip/JKuwpF8sm6/bY01Ow9CBlTXi53PNoRcUktEZT1NV1PIPnXAjtMJIMlzerFIzU1dVWF7aPj3Tetae4gjdxktG2et/qQjJ4kZFrv6ED4bK4eR1qduHzvEi4+PbGwD0EGu9CQQLFrv1F4jBc6BcuW3YhkPiPX1hOfxQvnHfh0HVMRqc4HuqiQf5k3mO6dq1s8Hx0H/Le5kq9YaNcxAcrZLpOvAv+ClcgNcZFtnrucd5Fwx4mXj0drnbBYXMuJmFDAV3Uhm4qlbHh3ddOrmholHNxFTVC+xTl2mf6pI4uVe4LwSp0DPGOmh/hAnM94bKZjkHlWuiLeV+cTab4luMKk82wy/Px2fLJskvKUk03hRf9RZ0wiYiZ4uVwVwTb9E71y0XboTYXGuTaa33Y47W5zBjXM3P11y7TfR2ycFdxyaW7uwSc5m0un9ix91m3TWJfW+1ijfW+wcVAfjS5dOP62LyvZZdcLHnA1MkFAtbgwq+Vm47po8OA1buwyy/a1ec5urzveAes2sV8kfW963mFaHNhlT0b6+Yi5+StchH1CtaK0ThXELDPLiyOPZHldzm/J1z9O/B14g7/K+DtkP7U8ivSeD4xaPCTSQvy+YIfubZWzRgtRe1iMP+3mq7pmq7p6jv+BBgAPrgi/TzwWzkAAAAASUVORK5CYII="/>
<img class="ui-title" alt="ERP5" src="gadget_erp5_panel.png?format=png"/>
</div>
</div>
</script>
<script id="panel-template-body" type="text/x-handlebars-template">
<div class="ui-content">
<form class="dialog_form">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_searchfield.html"
data-gadget-scope="erp5_searchfield"
data-gadget-sandbox="public"></div>
</form>
<ul data-role="listview" class="ui-listview" data-enhanced="true">
<li class="ui-first-child"><a href="#" class="ui-btn ui-btn-icon-left ui-icon-home" data-i18n="Home">Home</a></li>
<li><a href="{{module_href}}" class="ui-btn ui-btn-icon-left ui-icon-puzzle-piece" data-i18n="Modules" accesskey="m">Modules</a></li>
......@@ -35,9 +44,25 @@
<li><a href="{{preference_href}}" class="ui-btn ui-btn-icon-left ui-icon-gear" data-i18n="Preferences">Preferences</a></li>
<li class="ui-last-child"><a href="{{logout_href}}" class="ui-btn ui-btn-icon-left ui-icon-power-off" data-i18n="Logout" accesskey="o">Logout</a></li>
</ul>
<dl></dl>
</div>
</script>
<script id="panel-template-body-desktop" type="text/x-handlebars-template">
<dt class="ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-eye" data-i18n="Views">Views</dt>
{{#each view_list}}
<dd data-role="listview" data-theme="c" data-inset="true" class="document-listview">
<a data-i18n="{{title}}" class="ui-body-inherit" href="{{href}}">{{title}}</a>
</dd>
{{/each}}
<dt class="ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-cogs" data-i18n="Decisions">Decisions</dt>
{{#each workflow_list}}
<dd data-role="listview" data-theme="c" data-inset="true" class="document-listview">
<a data-i18n="{{title}}" class="ui-body-inherit" href="{{href}}">{{title}}</a>
</dd>
{{/each}}
</script>
<!-- custom script -->
<script src="gadget_erp5_panel.js" type="text/javascript"></script>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.21.64518.52172</string> </value>
<value> <string>957.46848.56526.7116</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1482156493.04</float>
<float>1488384141.54</float>
<string>UTC</string>
</tuple>
</state>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, Handlebars, RSVP, Node */
(function (window, rJS, Handlebars, RSVP, Node) {
/*global window, document, rJS, Handlebars, RSVP, Node, loopEventListener */
(function (window, document, rJS, Handlebars, RSVP, Node, loopEventListener) {
"use strict";
/////////////////////////////////////////////////////////////////
......@@ -14,17 +14,22 @@
.innerHTML),
panel_template_body = Handlebars.compile(template_element
.getElementById("panel-template-body")
.innerHTML);
.innerHTML),
panel_template_body_desktop = Handlebars.compile(template_element
.getElementById("panel-template-body-desktop")
.innerHTML);
gadget_klass
.setState({
visible: false
visible: false,
desktop: false
})
//////////////////////////////////////////////
// acquired method
//////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -40,48 +45,165 @@
});
})
.declareMethod('render', function () {
var g = this;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
g.getUrlFor({command: 'display', options: {page: "front"}}),
g.getUrlFor({command: 'display', options: {page: "history"}}),
g.getUrlFor({command: 'display', options: {page: "preference"}}),
g.getUrlFor({command: 'display', options: {page: "logout"}}),
g.getUrlFor({command: 'display', options: {page: "search"}}),
g.getUrlFor({command: 'display', options: {page: "worklist"}})
]);
})
.push(function (all_result) {
// XXX: Customize panel header!
return g.translateHtml(
panel_template_header() +
panel_template_body({
"module_href": all_result[0],
"history_href": all_result[1],
"preference_href": all_result[2],
"logout_href": all_result[3],
"search_href": all_result[4],
"worklist_href": all_result[5]
})
);
})
.push(function (my_translated_or_plain_html) {
g.element.querySelector("div").innerHTML = my_translated_or_plain_html;
});
.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
});
})
.onStateChange(function () {
if (this.state.visible) {
if (!this.element.classList.contains('visible')) {
this.element.classList.toggle('visible');
.onStateChange(function (modification_dict) {
var context = this,
gadget = this,
queue = new RSVP.Queue(),
tmp_element;
if (modification_dict.hasOwnProperty("visible")) {
if (this.state.visible) {
if (!this.element.classList.contains('visible')) {
this.element.classList.toggle('visible');
}
} else {
if (this.element.classList.contains('visible')) {
this.element.classList.remove('visible');
}
}
} else {
if (this.element.classList.contains('visible')) {
this.element.classList.remove('visible');
}
if (modification_dict.hasOwnProperty("global")) {
queue
.push(function () {
return RSVP.all([
context.getUrlFor({command: 'display', options: {page: "front"}}),
context.getUrlFor({command: 'display', options: {page: "history"}}),
context.getUrlFor({command: 'display', options: {page: "preference"}}),
context.getUrlFor({command: 'display', options: {page: "logout"}}),
context.getUrlFor({command: 'display', options: {page: "search"}}),
context.getUrlFor({command: 'display', options: {page: "worklist"}})
]);
})
.push(function (result_list) {
// XXX: Customize panel header!
return context.translateHtml(
panel_template_header() +
panel_template_body({
"module_href": result_list[0],
"history_href": result_list[1],
"preference_href": result_list[2],
"logout_href": result_list[3],
"search_href": result_list[4],
"worklist_href": result_list[5]
})
);
})
.push(function (my_translated_or_plain_html) {
tmp_element = document.createElement('div');
tmp_element.innerHTML = my_translated_or_plain_html;
return context.declareGadget('gadget_erp5_searchfield.html', {
scope: "erp5_searchfield",
element: tmp_element.querySelector('[data-gadget-scope="erp5_searchfield"]')
});
})
.push(function (search_gadget) {
return search_gadget.render({
focus: false
});
})
.push(function () {
context.element.querySelector("div").appendChild(tmp_element);
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]
});
}
gadget.element.querySelector("dl").innerHTML = panel_template_body_desktop({
workflow_list: result_workflow_list,
view_list: result_view_list
});
});
}
}
return queue;
})
/////////////////////////////////////////////////////////////////
......@@ -92,6 +214,64 @@
(evt.target.tagName === 'BUTTON')) {
return this.toggle();
}
}, false, false);
}, false, false)
.declareJob('listenResize', function () {
// resize should be only trigger after the render method
// as displaying the panel rely on external gadget (for translation for example)
var result,
event,
context = this;
function extractSizeAndDispatch() {
if (window.matchMedia("(min-width: 90em)").matches) {
return context.changeState({
desktop: true
});
}
return context.changeState({
desktop: false
});
}
result = loopEventListener(window, 'resize', false,
extractSizeAndDispatch);
event = document.createEvent("Event");
event.initEvent('resize', true, true);
window.dispatchEvent(event);
return result;
})
.allowPublicAcquisition('notifyChange', function () {
// 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();
})
.push(function (data) {
var options = {
page: "search"
};
if (data.search) {
options.extended_search = data.search;
}
// 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, rJS, Handlebars, RSVP, Node));
}(window, document, rJS, Handlebars, RSVP, Node, loopEventListener));
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.32296.8972.20241</string> </value>
<value> <string>957.46809.34243.17971</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479992698.26</float>
<float>1488381715.57</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -26,12 +26,12 @@
<!-- XXX action, method, fieldset -->
<form class="dialog_form">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="erp5_form"
data-gadget-sandbox="public">
</div>
<input class="dialogconfirm" data-theme="b" data-inline="true" type="submit" data-i18n="[value]Proceed" value="Proceed" data-icon="check" />
<a class="dialogcancel" data-i18n="Cancel">Cancel</a>
</form>
</body>
</html>
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.14163.7437.54408</string> </value>
<value> <string>957.40660.8707.11059</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1482749950.28</float>
<float>1488277468.66</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -26,7 +26,7 @@
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('triggerSubmit', function () {
this.element.querySelector('button').click();
this.element.querySelector('input[type="submit"]').click();
})
.declareMethod('render', function (options) {
......@@ -51,21 +51,16 @@
view_list = this.state.erp5_document._links.action_workflow || [];
title = this.state.form_definition.title;
for (i = 0; i < view_list.length; i += 1) {
if (view_list[i].name === this.state.view) {
title = view_list[i].title;
}
}
// XXX hardcoded...
switch (form_gadget.state.title) {
switch (title) {
case "Create User":
icon = " ui-icon-user";
break;
case "Create Document":
icon = " ui-icon-file-o";
break;
case "Change State":
case "Validate Workflow Action":
icon = " ui-icon-share-alt";
break;
case "Submit":
......@@ -76,10 +71,25 @@
break;
}
for (i = 0; i < view_list.length; i += 1) {
if (view_list[i].href === this.state.view) {
title = view_list[i].title;
}
}
// Calculate the h3 properties
return form_gadget.translate(title)
.push(function (translated_title) {
selector.textContent = "\u00A0" + translated_title;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
form_gadget.translate(form_gadget.state.form_definition.title),
form_gadget.translate(title),
]);
})
.push(function (translated_title_list) {
form_gadget.element.querySelector('input.dialogconfirm').value = translated_title_list[1];
selector.textContent = "\u00A0" + translated_title_list[0];
selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon;
// Render the erp5_from
......@@ -102,10 +112,10 @@
]);
})
.push(function (all_result) {
form_gadget.element.querySelector('a.dialogcancel').href = all_result[0];
return form_gadget.updateHeader({
cancel_url: all_result[0],
page_title: all_result[1],
submit_action: true
page_title: all_result[1]
});
});
})
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.14161.10627.9233</string> </value>
<value> <string>957.40691.44097.35481</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1482749961.0</float>
<float>1488273849.34</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -25,6 +25,7 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("updatePanel", "updatePanel")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -131,6 +132,17 @@
element.appendChild(fragment);
});
}
})
.push(function () {
var jio_key = gadget.state.options.jio_key;
/*jslint regexp: true*/
if (/^[^\/]+_module\/.+$/.test(jio_key)) {
/*jslint regexp: false*/
return gadget.updatePanel({
erp5_document: JSON.parse(gadget.state.erp5_document),
editable: gadget.state.options.editable
});
}
});
})
.allowPublicAcquisition("displayFormulatorValidationError", function (param_list) {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.44527.39200.57275</string> </value>
<value> <string>958.2825.24067.48281</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1476793905.11</float>
<float>1489674820.97</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -98,6 +98,27 @@
return this.changeState(state_dict);
})
.declareJob('detachChangeState', function (value_uid, catalog_index) {
var gadget = this;
return gadget.jio_allDocs({
"query": Query.objectToSearchText(new SimpleQuery({
key: "catalog.uid",
value: value_uid
})),
"limit": [0, 1],
"select_list": [catalog_index]
})
.push(function (result) {
return gadget.changeState({
value_text: result.data.rows[0]
.value[catalog_index]
});
})
.push(function () {
return gadget.notifyChange();
});
})
.onStateChange(function (modification_dict) {
var gadget = this,
queue = new RSVP.Queue(),
......@@ -145,20 +166,8 @@
// User selected a document from a listbox
if ((gadget.state.value_uid) && (!gadget.state.value_text)) {
plane.className = SEARCHING_CLASS_STR;
return gadget.jio_allDocs({
"query": Query.objectToSearchText(new SimpleQuery({
key: "catalog.uid",
value: gadget.state.value_uid,
limit: [0, 1]
})),
"select_list": [gadget.state.catalog_index]
})
.push(function (result) {
return gadget.changeState({
value_text: result.data.rows[0]
.value[gadget.state.catalog_index]
});
});
return gadget.detachChangeState(gadget.state.value_uid,
gadget.state.catalog_index);
}
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.62393.33328.52019</string> </value>
<value> <string>958.2831.13618.12219</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1481711639.59</float>
<float>1489675175.72</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -9,7 +9,8 @@
/////////////////////////////////////////////////////////////////
.declareMethod('render', function (options) {
var state_dict = {
extended_search: options.extended_search || ""
extended_search: options.extended_search || "",
focus: options.focus
};
return this.changeState(state_dict);
......@@ -20,8 +21,13 @@
return gadget.getDeclaredGadget('input')
.push(function (input_gadget) {
var focus = false;
if (!gadget.state.extended_search) {
focus = true;
var focus;
if (gadget.state.focus === undefined) {
if (gadget.state.extended_search) {
focus = false;
} else {
focus = true;
}
}
return input_gadget.render({
type: "search",
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.17336.1268.55074</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1476194269.08</float>
<float>1488381059.63</float>
<string>UTC</string>
</tuple>
</state>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.46086.45265.8004</string> </value>
<value> <string>957.34970.6736.36846</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1484732189.17</float>
<float>1488211502.0</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -420,9 +420,19 @@ textarea {
vertical-align: top;
transition: height @transition-timing;
height: 4em;
&:focus {
height: 20em;
// On smartphone, display the textarea small
// and increase its size when focused
// This behaviour should not be activated on bigscreen,
// as it make it unusable (difficult to search text for example)
@media @smartphone {
height: 4em;
&:focus {
height: 20em;
}
}
@media @tablet, @desktop {
min-height: 10em;
}
}
......@@ -566,34 +576,83 @@ div[data-gadget-scope='panel'] {
}
}
div[data-gadget-scope='erp5_searchfield'] {
padding: @half-margin-size @double-margin-size;
button {
color: @white;
}
input[type="search"] {
color: @white !important;
background-color: @grey !important;
}
}
img {
text-align: left;
height: 100%;
}
.alignwithicon() {
padding: @half-margin-size;
padding-left: @double-margin-size;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&::before {
// Use width instead of padding-right
// To keep text aligned
width: @quadruple-margin-size;
}
}
.alignwithouticon() {
.alignwithicon();
padding-left: @double-margin-size + @quadruple-margin-size;
}
.linkpanel() {
color: @white;
display: block;
&:hover, &:active {
background-color: darken(@panelbackgroundcolor, 10%);
}
}
ul {
margin-top: @headerheight;
&:first-child {
margin-top: @headerheight;
}
li {
a {
color: @white;
padding: @half-margin-size;
padding-left: @double-margin-size;
display: block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
.linkpanel();
.alignwithicon();
}
}
}
&::before {
// Use width instead of padding-right
// To keep text aligned
width: @quadruple-margin-size;
}
&:hover, &:active {
background-color: darken(@panelbackgroundcolor, 10%);
dl {
background-color: @grey;
color: @black;
// Animate when content is added
transform-origin: 50% 0;
transform: scaleY(0);
&:not(:empty) {
transform: scaleY(1);
}
transition: transform @transition-timing;
dt {
.alignwithicon();
}
dd {
a {
.linkpanel();
.alignwithouticon();
}
}
}
}
......@@ -973,8 +1032,10 @@ div[data-gadget-scope='header'] .ui-header {
input[type='submit'] {
padding: @margin-size;
margin-top: @headerheight;
margin-right: @double-margin-size;
background-color: @panelbackgroundcolor;
background-color: @coloraccent;
color: @white;
border-radius: @radius;
......@@ -984,10 +1045,10 @@ div[data-gadget-scope='header'] .ui-header {
min-width: 8em;
&:hover, &:focus {
background-color: lighten(@panelbackgroundcolor, 10%);
background-color: lighten(@coloraccent, 10%);
}
&:active {
background-color: lighten(@panelbackgroundcolor, 20%);
background-color: lighten(@coloraccent, 20%);
}
}
......
web_site_module/renderjs_runner
web_page_module/rjs_**
\ No newline at end of file
web_page_module/rjs_**
image_module/rjs_*
\ No newline at end of file
web_site_module/renderjs_runner
web_page_module/rjs_**
\ No newline at end of file
web_page_module/rjs_**
image_module/rjs_*
\ No newline at end of file
image_module/rjs_*
web_page_module/rjs_*
web_site_module/renderjs_runner
web_site_module/renderjs_runner/**
\ No newline at end of file
......@@ -316,19 +316,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
</tbody></table>
</body>
......
......@@ -43,23 +43,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -79,23 +63,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -115,21 +115,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Title 0</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>verifyElementPresent</td>
......@@ -196,19 +182,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Title 9</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>verifyElementPresent</td>
......@@ -274,19 +248,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
</tbody></table>
</body>
......
......@@ -140,19 +140,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
......@@ -220,19 +208,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
......@@ -322,18 +298,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
</tbody></table>
......
......@@ -178,17 +178,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
......@@ -271,19 +261,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
</tbody></table>
</body>
......
......@@ -198,18 +198,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
......@@ -405,19 +394,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
</tbody></table>
</body>
......
......@@ -115,17 +115,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
......@@ -225,19 +215,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
</tbody></table>
</body>
......
......@@ -147,22 +147,13 @@
<tr>
<td>click</td>
<td>//button[@data-i18n='Hide Rows']</td>
<td>//button[@name='SelectRows']</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
......@@ -218,22 +209,13 @@
<tr>
<td>click</td>
<td>//button[@data-i18n='Hide Rows']</td>
<td>//button[@name='SelectRows']</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
......
......@@ -43,23 +43,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -73,23 +57,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -115,25 +115,9 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="search"]</td>
<td>quantity: invalide</td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(@class, "search_button")]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'quantity: invalide'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
......@@ -166,12 +150,9 @@
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: ''">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
</tbody></table>
......
......@@ -92,6 +92,8 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementNotPresent</td>
<td>link=Title 9</td>
......
......@@ -53,21 +53,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_dialog.html']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -53,21 +53,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_dialog.html']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -53,21 +53,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_dialog.html']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -42,21 +42,8 @@
</tr>
<!-- Header has a save button -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>pause</td>
<td>1000</td>
......
......@@ -59,36 +59,19 @@
<td>//a[@data-i18n='Next']</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>search</td>
<td>Title 10</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'Title 10'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>assertTextPresent</td>
<td>Title 10</td>
......@@ -101,16 +84,9 @@
</tr>
<!-- Pagination keeps search query -->
<tr>
<td>type</td>
<td>search</td>
<td>%</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: '%'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//span[@data-i18n='Records 1 - 3']</td>
......
......@@ -59,17 +59,27 @@
<!-- Warning is removed if page changed -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Add']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit' and contains(@class, 'ui-icon-check')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit' and contains(@class, 'ui-icon-check')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit' and contains(@class, 'ui-icon-warning')]</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit' and contains(@class, 'ui-icon-warning')]</td>
<td></td>
</tr>
......
......@@ -85,11 +85,10 @@
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n="Proceed"]</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_dialog.html']//input[@class='dialogconfirm' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Foo: Title 1"]</td>
......
......@@ -37,26 +37,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name='field_your_portal_type']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -67,26 +50,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name='field_your_portal_type']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -25,16 +25,9 @@
</tr>
<!-- Enter a search query to store the state -->
<tr>
<td>type</td>
<td>search</td>
<td>title</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>pause</td>
<td>1000</td>
......@@ -82,18 +75,17 @@
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//input[@value='title' and @type='search' and @name='search']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//input[@value='title' and @type='search' and @name='search']</td>
<td>waitForTextPresent</td>
<td>Foo Module</td>
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -30,27 +30,10 @@
</tr>
<!-- Enter a search query to create a selection parameter -->
<tr>
<td>type</td>
<td>search</td>
<td>title</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='field_listbox']//a[text()='Title 1' and contains(@href, '#!index')]</td>
......@@ -83,16 +66,9 @@
<td>//div[@data-gadget-scope='header']//a[text()='Add' and contains(@href, '#!change') and contains(@href, 'view%3Dcreate_a_document')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//button[text()='Proceed' and @type='submit']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
......@@ -188,11 +164,11 @@
<td>Foos</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//input[@value='title' and @type='search' and @name='search']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
......
......@@ -63,26 +63,9 @@
</tr>
<!-- Enter a search query to create a selection parameter -->
<tr>
<td>type</td>
<td>search</td>
<td>title</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 3</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 3</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<!-- Sort -->
<tr>
......@@ -129,17 +112,16 @@
</tr>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 3</td>
<td>waitForElementPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 3</td>
<td>waitForElementNotPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<!-- Go to the first element -->
<tr>
<td>click</td>
......
......@@ -30,27 +30,10 @@
</tr>
<!-- Enter a search query to create a selection parameter -->
<tr>
<td>type</td>
<td>search</td>
<td>title</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='field_listbox']//a[text()='Title 1' and contains(@href, '#!index')]</td>
......@@ -90,11 +73,9 @@
<td>Foos</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//input[@value='title' and @type='search' and @name='search']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
......
......@@ -30,21 +30,9 @@
</tr>
<!-- Enter a search query to create a selection parameter -->
<tr>
<td>type</td>
<td>search</td>
<td>title</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
......@@ -89,11 +77,9 @@
<td>Foos</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//input[@value='title' and @type='search' and @name='search']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
......
......@@ -63,22 +63,10 @@
</tr>
<!-- Enter a search query to create a selection parameter -->
<tr>
<td>type</td>
<td>search</td>
<td>title</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'title'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
......@@ -130,8 +118,13 @@
</tr>
<tr>
<td>waitForTextNotPresent</td>
<td>Title 3</td>
<td>waitForElementPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tr>
......
......@@ -85,14 +85,14 @@
<tr>
<td>waitForElementPresent</td>
<td>//button[text() = 'jixu']</td>
<td>//input[@value = 'yanzhen']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[text() = 'jixu']</td>
<td>//input[@value = 'yanzhen']</td>
<td></td>
</tr>
......
......@@ -108,26 +108,7 @@
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text() = 'foo_mokuai']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
......
......@@ -28,37 +28,9 @@
<td></td>
</tr>
<tr>
<td>type</td>
<td>search</td>
<td>translated_portal_type: "Web Script"</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='gongbukexiugai']</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'translated_portal_type: &#x22;Web Script&#x22;'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
......
......@@ -45,24 +45,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text() ='jixu']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[text() ='jixu']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
......
......@@ -45,24 +45,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text() ='jixu']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[text() ='jixu']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
......
......@@ -39,21 +39,8 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -30,32 +30,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="field_your_portal_type"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="field_your_portal_type"]</td>
<td>label=Test Suite</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -39,22 +39,8 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
......
......@@ -37,21 +37,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -69,22 +57,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -160,34 +135,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(@class, "search_button")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,23 +39,8 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -247,73 +232,58 @@
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="search"]</td>
<td>click</td>
<td>//tbody/tr[1]//a</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="search"]</td>
<td>waitForElementPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-warning ui-btn-icon-left ui-first-child ui-last-child "]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(@class, "search_button")]</td>
<td></td>
<td>verifyValue</td>
<td>//input[@name="field_my_title"]</td>
<td>TEST</td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td>assertChecked</td>
<td>//input[@name="field_my_frozen"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tbody/tr[1]</td>
<td></td>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//fieldset[1]//input</td>
<td>A New Foo</td>
</tr>
<tr>
<td>click</td>
<td>//tbody/tr[1]//a</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_my_title"]</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="field_my_title"]</td>
<td>TEST</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//fieldset[2]//input</td>
<td>2</td>
</tr>
<tr>
<td>assertChecked</td>
<td>//input[@name="field_my_frozen"]</td>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//fieldset[3]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>verifyValue</td>
......@@ -321,14 +291,10 @@
<td>A New Foo</td>
</tr>
<tr>
<td>verifyValue</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//fieldset[2]//input</td>
<td>2</td>
<td>TEST</td>
</tr>
<tr>
......@@ -337,8 +303,6 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -39,23 +39,8 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -39,23 +39,8 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -37,21 +37,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -69,22 +57,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -109,22 +84,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -232,7 +194,7 @@
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="search"]</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_list.html']//input[@name="search"]</td>
<td></td>
</tr>
......@@ -302,38 +264,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>waitForTextPresent</td>
<td>Select Template</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(@class, "search_button")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<tr>
<td>waitForElementPresent</td>
......@@ -468,27 +404,9 @@
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="search"]</td>
<td>id:2</td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(@class, "search_button")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block tal:define="search_query python: 'id:2'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/search_in_form_list" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,22 +39,8 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -178,33 +164,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(@class, "search_button")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<tr>
<td>waitForElementPresent</td>
......@@ -227,7 +187,7 @@
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_my_successor_title"]</td>
<td>//button[@class="responsive ui-btn ui-icon-warning ui-btn-icon-left ui-first-child ui-last-child "]</td>
<td></td>
</tr>
......@@ -246,7 +206,11 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>verifyValue</td>
<td>//input[@name="field_my_successor_title"]</td>
<td>TEST</td>
</tr>
</tbody></table>
</body>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -71,22 +59,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -111,22 +86,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......@@ -169,7 +131,6 @@
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_my_short_title"]</td>
......@@ -466,15 +427,12 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_my_short_title"]</td>
<td></td>
</tr>
<tr>
<td>verifyNotValue</td>
<td>//input[@name="field_my_short_title"]</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -39,21 +39,9 @@
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -43,26 +43,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -82,23 +63,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -237,18 +202,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -57,23 +57,8 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
......@@ -90,24 +75,7 @@
<!-- create 2 Foo lines, one has same id as parent -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -146,25 +114,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Foo Line</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......@@ -223,19 +173,9 @@
<td>//a[@data-i18n='Delete']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>deleted</td>
......@@ -302,18 +242,8 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
......@@ -369,18 +299,8 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
......
......@@ -32,8 +32,8 @@
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Sale Invoice Transaction</td>
</tr>
<tr>
......@@ -42,19 +42,7 @@
<td>label=Sale Invoice Transaction</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -77,21 +77,9 @@
<td>//select[@name='field_your_portal_type']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='field_your_portal_type']</td>
<td>label=Bar</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForTextPresent</td>
<td>Save</td>
......
......@@ -36,7 +36,13 @@
<tal:block metal:define-macro="clear_query">
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//input[@name='search']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Previous']</td>
......@@ -45,7 +51,7 @@
<tr>
<td>type</td>
<td>search</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//input[@name='search']</td>
<td></td>
</tr>
......@@ -57,10 +63,10 @@
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
......@@ -72,8 +78,7 @@
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="submit_search_filter">
......@@ -127,5 +132,77 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
</tal:block>
<tal:block metal:define-macro="submit_dialog">
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]//input[@class='dialogconfirm' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]//input[@class='dialogconfirm' and @type='submit']</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="search_in_form_list">
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//input[@name='search']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//input[@name='search']</td>
<td tal:content="search_query"></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope='erp5_searchfield']//button[contains(@class, 'search_button')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="check_search_in_form_list">
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//input[@name='search']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td tal:content="python: &quot;//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope='erp5_searchfield']//input[@value='%s' and @type='search' and @name='search']&quot; % search_query"></td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="wait_for_content_loaded">
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//button[@class="responsive ui-btn ui-icon-spinner ui-btn-icon-left ui-first-child ui-last-child ui-disabled ui-icon-spin"]</td>
<td></td>
</tr>
</tal:block>
</tal:block>
\ No newline at end of file
......@@ -81,7 +81,7 @@
return new RSVP.Queue()
.push(function () {
var field_element_list =
gadget.element.querySelectorAll("[data-gadget-url]"),
gadget.element.querySelectorAll("[data-gadget-value]"),
field_element,
field_scope,
field_url,
......@@ -98,7 +98,7 @@
(!gadget.state.rejected_dict.hasOwnProperty(field_scope))) {
field_list.push({
sandbox: field_element.getAttribute("data-gadget-sandbox"),
editable: field_element.getAttribute("data-gadget-editable"),
editable: (field_element.getAttribute("data-gadget-editable") !== null),
key: field_element.getAttribute("data-gadget-editable"),
value: field_element.getAttribute("data-gadget-value")
});
......@@ -120,7 +120,7 @@
sub_value = field_list[i].value;
sub_key = field_list[i].key;
promise_list.push(
result_list[i].render({key: sub_key, value: sub_value})
result_list[i].render({key: sub_key, value: sub_value, editable: field_list[i].editable})
.push(undefined, displayFieldError)
/* XXX Highlight the gadget element with a small colored
* error message. Clicking on the element could unroll
......
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