Commit e21968ba authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Calculate link to render developer actions and support raw urls in ERP5JS UI

Calculate link to allow Nexedi developers access the ERP5 fields, forms and form actions from it.

* erp5 form gadget handle links to access from and form action
* label field gadget handle links to access field configuration, title
and descriptions translations
* page action handle all links to access workflows and portal type document
* add generic function to merge action with raw actions by group

* Add sample of action that allow uses access slideshow from ERP5JS
parent 9651e553
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Testing.ZopeTestCase.PortalTestCase import PortalTestCase
class TestWorklist(ERP5TypeTestCase): class TestWorklist(ERP5TypeTestCase):
...@@ -262,7 +261,22 @@ class TestWorklist(ERP5TypeTestCase): ...@@ -262,7 +261,22 @@ class TestWorklist(ERP5TypeTestCase):
self.logMessage("Check %s worklist" % user_id) self.logMessage("Check %s worklist" % user_id)
self.loginByUserName(user_id) self.loginByUserName(user_id)
result = workflow_tool.listActions(object=document) result = workflow_tool.listActions(object=document)
self.assertEqual(result, []) self.assertEqual(len(result), 2)
action, = [r for r in result if r["id"] == "onlyjio_validation_workflow"]
self.assertEqual(action["name"], "Validation Workflow")
self.assertTrue(
action["url"].endswith("/portal_workflow/validation_workflow/manage_properties"),
action
)
self.assertEqual(action["category"], "object_onlyjio_jump_raw")
action, = [r for r in result if r["id"] == "onlyjio_edit_workflow"]
self.assertEqual(action["name"], "Edit Workflow")
self.assertTrue(
action["url"].endswith("/portal_workflow/edit_workflow/manage_properties"),
action
)
self.assertEqual(action["category"], "object_onlyjio_jump_raw")
for role, user_id_list in (('Assignor', ('foo', 'manager')), for role, user_id_list in (('Assignor', ('foo', 'manager')),
('Assignee', ('foo', 'bar'))): ('Assignee', ('foo', 'bar'))):
......
portal = context.getPortalObject()
type_info = portal.portal_types.getTypeInfo(context)
if type_info is not None and type_info.Base_getSourceVisibility():
translate = context.Base_translateString
return type_info.Base_redirect(
keep_items={
"portal_status_message": "%s: %s" % (
translate("Portal Type"),
translate(type_info.getTitle()))
})
<?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>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_redirectToPortalTypeDocument</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -49,6 +49,7 @@ When handling form, we can expect field values to be stored in REQUEST.form in t ...@@ -49,6 +49,7 @@ When handling form, we can expect field values to be stored in REQUEST.form in t
from ZTUtils import make_query from ZTUtils import make_query
import json import json
import urllib
from base64 import urlsafe_b64encode, urlsafe_b64decode from base64 import urlsafe_b64encode, urlsafe_b64decode
from DateTime import DateTime from DateTime import DateTime
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
...@@ -337,8 +338,13 @@ url_template_dict = { ...@@ -337,8 +338,13 @@ url_template_dict = {
} }
default_document_uri_template = url_template_dict["jio_get_template"] default_document_uri_template = url_template_dict["jio_get_template"]
Base_translateString = context.getPortalObject().Base_translateString portal = context.getPortalObject()
portal_absolute_url = portal.absolute_url()
preference_tool = portal.portal_preferences
Base_translateString = portal.Base_translateString
preferred_html_style_developer_mode = preference_tool.getPreferredHtmlStyleDevelopperMode()
preferred_html_style_translator_mode = preference_tool.getPreferredHtmlStyleTranslatorMode()
def getRealRelativeUrl(document): def getRealRelativeUrl(document):
return '/'.join(portal.portal_url.getRelativeContentPath(document)) return '/'.join(portal.portal_url.getRelativeContentPath(document))
...@@ -414,7 +420,9 @@ def getFieldDefault(form, field, key, value=MARKER): ...@@ -414,7 +420,9 @@ def getFieldDefault(form, field, key, value=MARKER):
return value return value
def renderField(traversed_document, field, form, value=MARKER, meta_type=None, key=None, key_prefix=None, selection_params=None, request_field=True): def renderField(traversed_document, field, form, value=MARKER, meta_type=None,
key=None, key_prefix=None, selection_params=None,
request_field=True, form_relative_url=None):
"""Extract important field's attributes into `result` dictionary.""" """Extract important field's attributes into `result` dictionary."""
if selection_params is None: if selection_params is None:
selection_params = {} selection_params = {}
...@@ -446,6 +454,26 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k ...@@ -446,6 +454,26 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
"description": field.get_value("description"), "description": field.get_value("description"),
} }
if preferred_html_style_developer_mode:
result["edit_field_href"] = '%s/%s/manage_main' % (form_relative_url, field.id)
if preferred_html_style_translator_mode:
erp5_ui = portal.Localizer.erp5_ui
selected_language = erp5_ui.get_selected_language()
result["translate_title_href"] = '%s/manage_messages?%s' % (
'/'.join(erp5_ui.getPhysicalPath()),
urllib.urlencode({"regex": "^%s$" % field.title(),
"lang": selected_language})
)
field_description = field.Field_getDescription()
if field_description:
result["translate_description_href"] = '%s/manage_messages?%s' % (
'/'.join(erp5_ui.getPhysicalPath()),
urllib.urlencode({"regex": "^%s$" % field_description,
"lang": selected_language})
)
if "Field" in meta_type: if "Field" in meta_type:
# fields have default value and can be required (unlike boxes) # fields have default value and can be required (unlike boxes)
result["required"] = field.get_value("required") if field.has_value("required") else None result["required"] = field.get_value("required") if field.has_value("required") else None
...@@ -737,7 +765,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k ...@@ -737,7 +765,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
"root_url": site_root.absolute_url(), "root_url": site_root.absolute_url(),
"script_id": script.id, "script_id": script.id,
"relative_url": getRealRelativeUrl(traversed_document).replace("/", "%2F"), "relative_url": getRealRelativeUrl(traversed_document).replace("/", "%2F"),
"form_relative_url": "%s/%s" % (getFormRelativeUrl(form), field.id), "form_relative_url": "%s/%s" % (form_relative_url, field.id),
"list_method": list_method_name, "list_method": list_method_name,
"default_param_json": urlsafe_b64encode( "default_param_json": urlsafe_b64encode(
json.dumps(ensureSerializable(list_method_query_dict))), json.dumps(ensureSerializable(list_method_query_dict))),
...@@ -873,7 +901,10 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k ...@@ -873,7 +901,10 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
for editable_attribute, _ in field.get_value('editable_attributes')] for editable_attribute, _ in field.get_value('editable_attributes')]
result.update({ result.update({
'data': field.render(key=key, value=value, REQUEST=REQUEST, render_format='list'), 'data': field.render(key=key, value=value, REQUEST=REQUEST, render_format='list'),
'template_field_dict': {template_field: renderField(traversed_document, getattr(form, template_field), form) 'template_field_dict': {template_field: renderField(traversed_document,
getattr(form, template_field),
form,
form_relative_url=form_relative_url)
for template_field in template_field_names for template_field in template_field_names
if template_field in form}, if template_field in form},
}) })
...@@ -1040,7 +1071,10 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti ...@@ -1040,7 +1071,10 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
if not field.get_value("enabled"): if not field.get_value("enabled"):
continue continue
try: try:
response_dict[field.id] = renderField(traversed_document, field, form, key_prefix=key_prefix, selection_params=selection_params, request_field=not use_relation_form_page_template) response_dict[field.id] = renderField(traversed_document, field, form, key_prefix=key_prefix,
selection_params=selection_params,
request_field=not use_relation_form_page_template,
form_relative_url=form_relative_url)
if field_errors.has_key(field.id): if field_errors.has_key(field.id):
response_dict[field.id]["error_text"] = field_errors[field.id].getMessage(Base_translateString) response_dict[field.id]["error_text"] = field_errors[field.id].getMessage(Base_translateString)
except AttributeError as error: except AttributeError as error:
...@@ -1207,6 +1241,15 @@ def renderFormDefinition(form, response_dict): ...@@ -1207,6 +1241,15 @@ def renderFormDefinition(form, response_dict):
response_dict["update_action"] = form.update_action response_dict["update_action"] = form.update_action
response_dict["update_action_title"] = Base_translateString(form.update_action_title) response_dict["update_action_title"] = Base_translateString(form.update_action_title)
if preferred_html_style_developer_mode:
form_relative_url = getFormRelativeUrl(form)
response_dict["edit_form_href"] = '%s/manage_main' % form_relative_url
if form.action:
response_dict["edit_form_action_href"] = '%s/%s/manage_main' % (
site_root.getId(),
form.action)
def statusLevelToString(level): def statusLevelToString(level):
"""Transform any level format to lowercase string representation""" """Transform any level format to lowercase string representation"""
if isinstance(level, (str, unicode)): if isinstance(level, (str, unicode)):
...@@ -1291,7 +1334,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1291,7 +1334,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# Always inform about portal # Always inform about portal
"portal": { "portal": {
"href": default_document_uri_template % { "href": default_document_uri_template % {
"root_url": portal.absolute_url(), "root_url": portal_absolute_url,
# XXX the portal has an empty getRelativeUrl. Make it still compatible # XXX the portal has an empty getRelativeUrl. Make it still compatible
# with restrictedTraverse # with restrictedTraverse
"relative_url": portal.getId(), "relative_url": portal.getId(),
...@@ -1460,7 +1503,6 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1460,7 +1503,6 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
'_view': embedded_dict '_view': embedded_dict
} }
# Extract & modify action URLs
for erp5_action_key in erp5_action_dict.keys(): for erp5_action_key in erp5_action_dict.keys():
erp5_action_list = [] erp5_action_list = []
for view_action in erp5_action_dict[erp5_action_key]: for view_action in erp5_action_dict[erp5_action_key]:
...@@ -1477,7 +1519,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1477,7 +1519,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
"object_list_action", "object_jio_jump") "object_list_action", "object_jio_jump")
if (erp5_action_key == view_action_type or if (erp5_action_key == view_action_type or
erp5_action_key in global_action_type or erp5_action_key in global_action_type or
"_jio" in erp5_action_key): "_jio" in erp5_action_key) and not erp5_action_key.endswith("_raw"):
# select correct URL template based on action_type and form page template # select correct URL template based on action_type and form page template
url_template_key = "traverse_generator" url_template_key = "traverse_generator"
......
...@@ -199,6 +199,7 @@ ...@@ -199,6 +199,7 @@
return sub_gadget.render({ return sub_gadget.render({
label: false, label: false,
development_link: false,
field_type: column.type, field_type: column.type,
field_json: field_json field_json: field_json
}); });
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.53736.24127.53674</string> </value> <value> <string>990.15674.6574.27784</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1581614139.33</float> <float>1614297317.85</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_form.js" type="text/javascript"></script> <script src="gadget_erp5_form.js" type="text/javascript"></script>
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>969.41882.58371.33382</string> </value> <value> <string>987.52327.33749.63539</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1536679144.45</float> <float>1605646543.35</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, document, rJS, RSVP*/ /*global window, document, rJS, RSVP, domsugar*/
/** Form is one of a complicated gadget! /** Form is one of a complicated gadget!
* *
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* changed in FormBox gadget which renders form as a subgadget * changed in FormBox gadget which renders form as a subgadget
**/ **/
(function (window, document, rJS, RSVP) { (function (window, document, rJS, RSVP, domsugar) {
"use strict"; "use strict";
/** /**
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
} else { } else {
// XXX Investigate why removing this break everything // XXX Investigate why removing this break everything
// There is not reason to always create a DOM element // There is not reason to always create a DOM element
field_element = document.createElement("div"); field_element = domsugar("div");
} }
return label_gadget.render(suboptions); return label_gadget.render(suboptions);
}) })
...@@ -82,12 +82,10 @@ ...@@ -82,12 +82,10 @@
function addGroup(group, rendered_document, form_definition, form_gadget, modification_dict) { function addGroup(group, rendered_document, form_definition, form_gadget, modification_dict) {
// XXX: > Romain: fieldset will be needed later for menus var group_name = group[0],
var fieldset_element = document.createElement("div"), field_list = group[1],
group_name = group[0], // XXX: > Romain: fieldset will be needed later for menus
field_list = group[1]; fieldset_element = domsugar("div", {"class": group_name});
fieldset_element.setAttribute("class", group_name);
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -112,6 +110,14 @@ ...@@ -112,6 +110,14 @@
}); });
} }
function addDeveloperAction(class_name, title_href, title) {
return domsugar("a", {
"class": class_name,
href: title_href,
title: title
});
}
rJS(window) rJS(window)
.ready(function (g) { .ready(function (g) {
...@@ -170,6 +176,13 @@ ...@@ -170,6 +176,13 @@
} }
} }
if (options.form_definition.hasOwnProperty("edit_form_href")) {
hash += "edit_form";
}
if (options.form_definition.hasOwnProperty("edit_form_action_href")) {
hash += "edit_form_action";
}
return this.changeState({ return this.changeState({
erp5_document: options.erp5_document, erp5_document: options.erp5_document,
form_definition: options.form_definition, form_definition: options.form_definition,
...@@ -198,7 +211,7 @@ ...@@ -198,7 +211,7 @@
if (modification_dict.title) { if (modification_dict.title) {
if (tmp === null) { if (tmp === null) {
// create new title element for existing title // create new title element for existing title
tmp = document.createElement("h3"); tmp = domsugar("h3");
this.element.insertBefore(tmp, this.element.firstChild); this.element.insertBefore(tmp, this.element.firstChild);
} }
tmp.textContent = modification_dict.title; tmp.textContent = modification_dict.title;
...@@ -216,11 +229,14 @@ ...@@ -216,11 +229,14 @@
})); }));
}) })
.push(function (result_list) { .push(function (result_list) {
var dom_element = form_gadget.element.querySelector(".field_container"),
dev_element_list,
parent_element,
field_href,
j;
if (modification_dict.hasOwnProperty('hash')) { if (modification_dict.hasOwnProperty('hash')) {
var dom_element = form_gadget.element parent_element = document.createDocumentFragment();
.querySelector(".field_container"),
j,
parent_element = document.createDocumentFragment();
// Add all fieldset into the fragment // Add all fieldset into the fragment
for (j = 0; j < result_list.length; j += 1) { for (j = 0; j < result_list.length; j += 1) {
parent_element.appendChild(result_list[j]); parent_element.appendChild(result_list[j]);
...@@ -229,6 +245,30 @@ ...@@ -229,6 +245,30 @@
dom_element.removeChild(dom_element.firstChild); dom_element.removeChild(dom_element.firstChild);
} }
dom_element.appendChild(parent_element); dom_element.appendChild(parent_element);
dev_element_list = form_gadget.element.querySelectorAll(
":scope > .edit-form, :scope > .edit-form-action"
);
for (j = 0; j < dev_element_list.length; j += 1) {
form_gadget.element.removeChild(dev_element_list[j]);
}
if (form_definition.hasOwnProperty("edit_form_href")) {
field_href = addDeveloperAction(
"edit-form ui-icon-edit ui-btn-icon-left",
form_definition.edit_form_href,
"Edit this form"
);
form_gadget.element.insertBefore(field_href, dom_element);
}
if (form_definition.hasOwnProperty("edit_form_action_href")) {
field_href = addDeveloperAction(
"edit-form-action ui-icon-external-link ui-btn-icon-left",
form_definition.edit_form_action_href,
"Edit this form's action"
);
form_gadget.element.insertBefore(field_href, dom_element);
}
} }
}); });
}) })
...@@ -308,4 +348,4 @@ ...@@ -308,4 +348,4 @@
}, {mutex: 'changestate'}); }, {mutex: 'changestate'});
}(window, document, rJS, RSVP)); }(window, document, rJS, RSVP, domsugar));
\ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>979.61953.36209.9762</string> </value> <value> <string>990.57432.47622.47940</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1574329059.87</float> <float>1616447651.73</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, RSVP, SimpleQuery, ComplexQuery, Query, /*global window, RSVP, SimpleQuery, ComplexQuery, Query,
ensureArray */ ensureArray, Array*/
/*jslint indent: 2, maxerr: 3, nomen: true, unparam: true, continue: true */ /*jslint indent: 2, maxerr: 3, nomen: true, unparam: true, continue: true */
(function (window, RSVP, SimpleQuery, ComplexQuery, Query, (function (window, RSVP, SimpleQuery, ComplexQuery, Query,
ensureArray) { ensureArray, Array) {
"use strict"; "use strict";
/////////////////////////////// ///////////////////////////////
...@@ -164,6 +164,127 @@ ...@@ -164,6 +164,127 @@
/////////////////////////////// ///////////////////////////////
// Handle listbox action list // Handle listbox action list
/////////////////////////////// ///////////////////////////////
function mergeGlobalActionWithRawActionList(jio_key, view, jump_view,
link_list, group_id_list,
command_mapping,
editable_mapping) {
var i, j, group,
action_type,
current_href,
class_name,
options,
command,
group_mapping = {},
url_mapping = {},
default_command_mapping = {
"view": "display_with_history",
"action_object_jio_jump": "display_dialog_with_history",
"action_object_jio_action": "display_with_history_and_cancel",
"action_object_view": "display_with_history",
"action_workflow": "display_dialog_with_history",
"action_object_clone_action": "display_with_history_and_cancel",
"action_object_delete_action": "display_with_history_and_cancel"
};
editable_mapping = editable_mapping || {};
command_mapping = command_mapping || {};
function addRawUrlToGroupMapping(group, action_type) {
var index;
if (link_list.hasOwnProperty(action_type)) {
if (!group_mapping.hasOwnProperty(group)) {
group_mapping[group] = [];
}
if (link_list[action_type] instanceof Array) {
for (index = 0; index < link_list[action_type].length; index += 1) {
if (link_list[action_type][index].href) {
link_list[action_type][index].action_type = action_type;
group_mapping[group].push(link_list[action_type][index]);
}
}
} else {
link_list[action_type].action_type = action_type;
group_mapping[group].push(link_list[action_type]);
}
}
}
for (i = 0; i < group_id_list.length; i += 1) {
group = group_id_list[i];
if (group instanceof Array) {
action_type = group[0];
group_mapping[action_type] = ensureArray(link_list[action_type]);
addRawUrlToGroupMapping(action_type, action_type + "_raw");
if (group.length > 1) {
for (j = 1; j < group.length; j += 1) {
if (link_list.hasOwnProperty(group[j])) {
group_mapping[action_type] = group_mapping[
action_type
].concat(
ensureArray(link_list[group[j]])
);
}
addRawUrlToGroupMapping(action_type,
group[j] + "_raw");
}
}
} else {
group_mapping[group] = ensureArray(
link_list[group]
);
addRawUrlToGroupMapping(group, group + "_raw");
}
}
for (group in group_mapping) {
if (group_mapping.hasOwnProperty(group)) {
if (!url_mapping.hasOwnProperty(group)) {
url_mapping[group] = [];
}
for (i = 0; i < group_mapping[group].length; i += 1) {
class_name = "";
current_href = group_mapping[group][i].href;
if (view === 'view' && group_mapping[group][i].name === view) {
class_name = 'active';
} else if (current_href === view) {
class_name = 'active';
} else if (jump_view && ((current_href === jump_view) ||
(current_href === view))) {
class_name = 'active';
}
if (group_mapping[group][i].action_type &&
group_mapping[group][i].action_type.indexOf("_raw") !== -1) {
command = "raw";
options = {
title: group_mapping[group][i].title,
url: group_mapping[group][i].href
};
} else {
command = command_mapping[group] || default_command_mapping[group];
options = {
title: group_mapping[group][i].title,
class_name: class_name,
jio_key: jio_key,
view: group_mapping[group][i].href,
editable: editable_mapping[group]
};
}
if (group === "view") {
// Views in ERP5 must be forms but because of
// OfficeJS we keep it empty for different default
options.page = undefined;
}
url_mapping[group].push({
command: command,
absolute_url: command === "raw" ? true : false,
options: options
});
}
}
}
return url_mapping;
}
function getListboxClipboardActionList() { function getListboxClipboardActionList() {
var action_list = ensureArray(this.state.erp5_document._links.action_object_list_action || []), var action_list = ensureArray(this.state.erp5_document._links.action_object_list_action || []),
i, i,
...@@ -311,8 +432,9 @@ ...@@ -311,8 +432,9 @@
.allowPublicAcquisition("triggerListboxClipboardAction", .allowPublicAcquisition("triggerListboxClipboardAction",
triggerListboxClipboardAction); triggerListboxClipboardAction);
} }
window.mergeGlobalActionWithRawActionList = mergeGlobalActionWithRawActionList;
window.triggerListboxClipboardAction = triggerListboxClipboardAction; window.triggerListboxClipboardAction = triggerListboxClipboardAction;
window.declareGadgetClassCanHandleListboxClipboardAction = window.declareGadgetClassCanHandleListboxClipboardAction =
declareGadgetClassCanHandleListboxClipboardAction; declareGadgetClassCanHandleListboxClipboardAction;
}(window, RSVP, SimpleQuery, ComplexQuery, Query, ensureArray)); }(window, RSVP, SimpleQuery, ComplexQuery, Query, ensureArray, Array));
\ No newline at end of file \ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>986.51245.10858.8089</string> </value> <value> <string>990.47062.36646.8226</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602058138.58</float> <float>1615825369.82</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -6,10 +6,16 @@ ...@@ -6,10 +6,16 @@
<title>ERP5 Label Field</title> <title>ERP5 Label Field</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_label_field.html"> <link rel="http://www.renderjs.org/rel/interface" href="interface_label_field.html">
<link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_form_content_provider.html"> <link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_form_content_provider.html">
<!--
data-i18n=Translate this field title
data-i18n=Translate this field description
data-i18n=Edit this field
-->
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_label_field.js" type="text/javascript"></script> <script src="gadget_erp5_label_field.js" type="text/javascript"></script>
</head> </head>
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.11191.7445.40789</string> </value> <value> <string>990.15674.6574.27784</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1536679172.23</float> <float>1614643876.56</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, document, rJS*/ /*global window, document, rJS, domsugar, HTMLLabelElement*/
/*jslint indent: 2, maxerr: 3 */ /*jslint indent: 2, maxerr: 3 */
/** /**
* Label gadget takes care of displaying validation errors and label. * Label gadget takes care of displaying validation errors and label.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* - class "horizontal_align_form_box" will prevent any label to show as well * - class "horizontal_align_form_box" will prevent any label to show as well
* *
*/ */
(function (window, document, rJS) { (function (window, document, rJS, domsugar, HTMLLabelElement) {
"use strict"; "use strict";
var SCOPE = 'field'; var SCOPE = 'field';
...@@ -76,6 +76,19 @@ ...@@ -76,6 +76,19 @@
return field_url; return field_url;
} }
function addDeveloperAction(class_name, title_href, title, root_element) {
var field_href = domsugar("a", {
"class": class_name,
href: title_href,
title: title
});
if (root_element.constructor === HTMLLabelElement) {
root_element.appendChild(field_href);
} else {
root_element.insertBefore(field_href, root_element.querySelector("div"));
}
}
rJS(window) rJS(window)
.setState({ .setState({
label_text: '', label_text: '',
...@@ -85,6 +98,10 @@ ...@@ -85,6 +98,10 @@
display_error_text: false, display_error_text: false,
first_call: false first_call: false
}) })
//////////////////////////////////////////////
// acquired method
//////////////////////////////////////////////
.declareAcquiredMethod("getTranslationList", "getTranslationList")
.declareMethod('render', function render(options) { .declareMethod('render', function render(options) {
var state_dict = { var state_dict = {
...@@ -98,6 +115,7 @@ ...@@ -98,6 +115,7 @@
hidden: options.field_json.hidden, hidden: options.field_json.hidden,
css_class: options.field_json.css_class css_class: options.field_json.css_class
}; };
// RenderJS would overwrite default value with empty variables :-( // RenderJS would overwrite default value with empty variables :-(
// So we have to mitigate this behaviour // So we have to mitigate this behaviour
if (state_dict.label === undefined) { if (state_dict.label === undefined) {
...@@ -109,11 +127,15 @@ ...@@ -109,11 +127,15 @@
.onStateChange(function onStateChange(modification_dict) { .onStateChange(function onStateChange(modification_dict) {
var gadget = this, var gadget = this,
options = modification_dict.options || {},
field_json = options.field_json,
field_gadget,
span, span,
css_class, css_class,
i, i,
queue, queue,
new_div; new_div;
if (modification_dict.hasOwnProperty('first_call')) { if (modification_dict.hasOwnProperty('first_call')) {
gadget.props = { gadget.props = {
container_element: gadget.element.querySelector('div'), container_element: gadget.element.querySelector('div'),
...@@ -176,15 +198,12 @@ ...@@ -176,15 +198,12 @@
} }
} }
} }
if (modification_dict.hasOwnProperty('options')) { if (modification_dict.hasOwnProperty('options')) {
if (this.state.field_url) { if (this.state.field_url) {
if (modification_dict.hasOwnProperty('field_url')) { if (modification_dict.hasOwnProperty('field_url')) {
//if (!modification_dict.hasOwnProperty('first_call')) {
gadget.props.container_element.removeChild( gadget.props.container_element.removeChild(
gadget.props.container_element.querySelector('div') gadget.props.container_element.querySelector('div')
); );
//}
new_div = document.createElement('div'); new_div = document.createElement('div');
span = gadget.props.container_element.lastElementChild; span = gadget.props.container_element.lastElementChild;
if ((span !== null) && (span.tagName.toLowerCase() !== 'span')) { if ((span !== null) && (span.tagName.toLowerCase() !== 'span')) {
...@@ -205,8 +224,79 @@ ...@@ -205,8 +224,79 @@
} else { } else {
queue = gadget.getDeclaredGadget(SCOPE); queue = gadget.getDeclaredGadget(SCOPE);
} }
queue
.push(function (declared_gadget) {
field_gadget = declared_gadget;
});
if (field_json && gadget.state.options.development_link !== false) {
queue
.push(function () {
return gadget.getTranslationList([
"Edit this field",
"Translate this field title",
"Translate this field description"
]);
})
.push(function (translation_list) {
var root_element,
field;
if (gadget.state.label === true) {
root_element = gadget.props.label_element;
} else {
root_element = field_gadget.element;
}
if (field_json.hasOwnProperty('edit_field_href') &&
!root_element.querySelector(".edit-field")) {
addDeveloperAction(
"edit-field ui-icon-edit ui-btn-icon-left",
field_json.edit_field_href,
translation_list[0],
root_element
);
} else if (!field_json.hasOwnProperty('edit_field_href')) {
field = root_element.querySelector(".edit-field");
if (field) {
root_element.removeChild(field);
}
}
if (field_json.hasOwnProperty('translate_title_href') &&
!root_element.querySelector(".translate-title")) {
addDeveloperAction(
"translate-title ui-icon-language ui-btn-icon-left",
field_json.translate_title_href,
translation_list[1],
root_element
);
} else if (!field_json.hasOwnProperty('translate_title_href')) {
field = root_element.querySelector(".translate-title");
if (field) {
root_element.removeChild(field);
}
}
if (field_json.hasOwnProperty('translate_description_href') &&
!root_element.querySelector(".translate-description")) {
addDeveloperAction(
"translate-description ui-icon-language ui-btn-icon-left",
field_json.translate_description_href,
translation_list[2],
root_element
);
} else if (!field_json.hasOwnProperty('translate_description_href')) {
field = root_element.querySelector(".translate-description");
if (field) {
root_element.removeChild(field);
}
}
return;
});
}
return queue return queue
.push(function (field_gadget) { .push(function () {
return field_gadget.render(gadget.state.options); return field_gadget.render(gadget.state.options);
}); });
} }
...@@ -268,4 +358,4 @@ ...@@ -268,4 +358,4 @@
return this.changeState({first_call: true, error_text: error_text}); return this.changeState({first_call: true, error_text: error_text});
}); });
}(window, document, rJS)); }(window, document, rJS, domsugar, HTMLLabelElement));
\ No newline at end of file \ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>989.58905.49586.62361</string> </value> <value> <string>990.29860.51853.55159</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1614349412.76</float> <float>1614802629.65</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -265,7 +265,8 @@ ...@@ -265,7 +265,8 @@
return cell_gadget.render({ return cell_gadget.render({
field_type: sub_field_json.type, field_type: sub_field_json.type,
field_json: sub_field_json, field_json: sub_field_json,
label: false label: false,
development_link: false
}); });
}); });
} }
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>george</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>986.62778.43816.35430</string> </value> <value> <string>990.17151.25214.12134</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1601472016.81</float> <float>1614290750.17</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Shared * Shared
**********************************************/ **********************************************/
/********************************************** /**********************************************
* http://meyerweb.com/eric/tools/css/reset/ * http://meyerweb.com/eric/tools/css/reset/
* v2.0 | 20110126 * v2.0 | 20110126
* License: none (public domain) * License: none (public domain)
**********************************************/ **********************************************/
...@@ -1870,6 +1870,20 @@ ul.ui-list-grid > li li { ...@@ -1870,6 +1870,20 @@ ul.ui-list-grid > li li {
padding: 3pt 6pt; padding: 3pt 6pt;
} }
/********************************************** /**********************************************
* Developer mode actions
**********************************************/
.edit-form,
.edit-form-action,
.edit-field,
.translate-title,
.translate-description {
margin-left: 3pt;
color: hsl(0, 0%, 42%);
}
.translate-description {
border: 1px solid rgba(0, 0, 0, 0.3);
}
/**********************************************
* Icons * Icons
**********************************************/ **********************************************/
.ui-btn-icon-top::before, .ui-btn-icon-top::before,
...@@ -3287,4 +3301,4 @@ hmtl .ui-icon-carat-u::before { ...@@ -3287,4 +3301,4 @@ hmtl .ui-icon-carat-u::before {
} }
.ui-icon-clone::before { .ui-icon-clone::before {
content: "\f24d"; content: "\f24d";
} }
\ No newline at end of file
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>990.31225.42814.19421</string> </value> <value> <string>990.39798.46778.32068</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1614875251.37</float> <float>1616592920.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, RSVP, domsugar, calculatePageTitle, ensureArray */ /*global window, rJS, RSVP, domsugar, calculatePageTitle,
console, mergeGlobalActionWithRawActionList */
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, domsugar, calculatePageTitle, ensureArray) { (function (window, rJS, RSVP, domsugar, calculatePageTitle,
mergeGlobalActionWithRawActionList) {
"use strict"; "use strict";
function generateSection(title, icon, view_list) { function generateSection(title, icon, view_list) {
var i, var i,
dom_list = []; dom_list = [];
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
dom_list.push(domsugar('li', [domsugar('a', { dom_list.push(domsugar('li', [domsugar('a', {
href: view_list[i].link, href: view_list[i].link,
...@@ -65,28 +66,42 @@ ...@@ -65,28 +66,42 @@
// what view we are at. If no view available than fallback to "links". // what view we are at. If no view available than fallback to "links".
return gadget.jio_getAttachment(gadget.state.jio_key, gadget.state.view || "links") return gadget.jio_getAttachment(gadget.state.jio_key, gadget.state.view || "links")
.push(function (jio_attachment) { .push(function (jio_attachment) {
var i, j,
url_for_kw_list = [],
url_mapping = mergeGlobalActionWithRawActionList(
gadget.state.jio_key,
gadget.state.view,
gadget.state.jump_view,
jio_attachment._links,
[
"action_workflow",
[
"action_object_jio_action",
"action_object_jio_button",
"action_object_jio_fast_input"
],
"action_object_clone_action",
"action_object_delete_action"
],
{
"action_workflow": "display_with_history_and_cancel"
},
{
action_object_clone_action: true
}
);
erp5_document = jio_attachment; erp5_document = jio_attachment;
var i,
j,
url_for_kw_list = [];
group_list = [ group_list = [
// Action list, editable, icon url_mapping.action_workflow, 'random',
ensureArray(erp5_document._links.action_workflow), undefined, 'random', url_mapping.action_object_jio_action, 'gear',
ensureArray(erp5_document._links.action_object_jio_action) url_mapping.action_object_clone_action, 'clone',
.concat(ensureArray(erp5_document._links.action_object_jio_button)) url_mapping.action_object_delete_action, 'trash-o'
.concat(ensureArray(erp5_document._links.action_object_jio_fast_input)), undefined, 'gear', ];
ensureArray(erp5_document._links.action_object_clone_action), true, 'clone',
ensureArray(erp5_document._links.action_object_delete_action), undefined, 'trash-o']; for (i = 0; i < group_list.length; i += 2) {
for (i = 0; i < group_list.length; i += 3) {
for (j = 0; j < group_list[i].length; j += 1) { for (j = 0; j < group_list[i].length; j += 1) {
url_for_kw_list.push({command: 'display_with_history_and_cancel', options: { url_for_kw_list.push(group_list[i][j]);
jio_key: gadget.state.jio_key,
view: group_list[i][j].href,
editable: group_list[i + 1]
}});
} }
} }
...@@ -106,21 +121,20 @@ ...@@ -106,21 +121,20 @@
dom_list = [], dom_list = [],
link_list; link_list;
for (i = 0; i < group_list.length; i += 3) { for (i = 0; i < group_list.length; i += 2) {
link_list = []; link_list = [];
for (j = 0; j < group_list[i].length; j += 1) { for (j = 0; j < group_list[i].length; j += 1) {
link_list.push({ link_list.push({
title: group_list[i][j].title, title: group_list[i][j].options.title,
link: result_dict.url_list[k] link: result_dict.url_list[k]
}); });
k += 1; k += 1;
} }
dom_list.push( dom_list.push(
generateSection(result_dict.translation_list[i / 3], group_list[i + 2], link_list) generateSection(result_dict.translation_list[i / 2], group_list[i + 1], link_list)
); );
} }
domsugar(gadget.element, dom_list); domsugar(gadget.element, dom_list);
return gadget.updateHeader({ return gadget.updateHeader({
...@@ -133,4 +147,5 @@ ...@@ -133,4 +147,5 @@
return; return;
}); });
}(window, rJS, RSVP, domsugar, calculatePageTitle, ensureArray)); }(window, rJS, RSVP, domsugar, calculatePageTitle,
mergeGlobalActionWithRawActionList));
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.55016.12244.41318</string> </value> <value> <string>990.5865.43433.1774</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1582128763.98</float> <float>1613612772.39</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -24,7 +24,10 @@ ...@@ -24,7 +24,10 @@
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script> <script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_global.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_panel.js" type="text/javascript"></script> <script src="gadget_erp5_panel.js" type="text/javascript"></script>
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>989.49479.12222.40430</string> </value> <value> <string>989.60900.17207.44100</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1612876311.33</float> <float>1612990906.08</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */ /*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */
/*global window, document, rJS, RSVP, Node, asBoolean , ensureArray*/ /*global window, document, rJS, RSVP, Node, asBoolean , ensureArray,
(function (window, document, rJS, RSVP, Node, asBoolean, ensureArray) { mergeGlobalActionWithRawActionList*/
(function (window, document, rJS, RSVP, Node, asBoolean, ensureArray,
mergeGlobalActionWithRawActionList) {
"use strict"; "use strict";
function appendDt(fragment, dt_title, dt_icon, function appendDt(fragment, dt_title, dt_icon,
...@@ -22,9 +24,12 @@ ...@@ -22,9 +24,12 @@
dd_element = document.createElement('dd'); dd_element = document.createElement('dd');
dd_element.setAttribute('class', 'document-listview'); dd_element.setAttribute('class', 'document-listview');
a_element = document.createElement('a'); a_element = document.createElement('a');
a_element.setAttribute('class', action_list[i].class_name); if (action_list[i].options && action_list[i].options.class_name) {
// Avoid add class='undefined' in HTML
a_element.setAttribute('class', action_list[i].options.class_name);
}
a_element.href = href_list[index + i]; a_element.href = href_list[index + i];
a_element.textContent = action_list[i].title; a_element.textContent = action_list[i].options.title;
dd_element.appendChild(a_element); dd_element.appendChild(a_element);
fragment.appendChild(dd_element); fragment.appendChild(dd_element);
} }
...@@ -66,11 +71,11 @@ ...@@ -66,11 +71,11 @@
display_workflow_list, display_workflow_list,
context = this, context = this,
workflow_list, workflow_list,
group_mapping,
view_list, view_list,
action_list, action_list,
clone_list, clone_list,
jump_list, jump_list;
i;
if (visible === undefined) { if (visible === undefined) {
visible = context.state.visible; visible = context.state.visible;
...@@ -83,46 +88,35 @@ ...@@ -83,46 +88,35 @@
} }
if ((erp5_document !== undefined) && (jio_key !== undefined)) { if ((erp5_document !== undefined) && (jio_key !== undefined)) {
workflow_list = ensureArray(erp5_document._links.action_workflow); group_mapping = mergeGlobalActionWithRawActionList(jio_key,
view_list = ensureArray(erp5_document._links.action_object_view); view, jump_view,
action_list = ensureArray(erp5_document._links.action_object_jio_action) erp5_document._links, [
.concat(ensureArray(erp5_document._links.action_object_jio_button)) "action_workflow",
.concat(ensureArray(erp5_document._links.action_object_jio_fast_input)); "action_object_view", [
clone_list = ensureArray(erp5_document._links.action_object_clone_action); "action_object_jio_action",
jump_list = ensureArray(erp5_document._links.action_object_jio_jump); "action_object_jio_button",
"action_object_jio_fast_input"
],
"action_object_clone_action",
"action_object_jio_jump"
], {
"action_object_jio_action": "display_dialog_with_history",
"action_object_clone_action": "display_dialog_with_history"
}, {
"action_object_clone_action": true
});
if (view === 'view') { workflow_list = JSON.stringify(group_mapping.action_workflow);
for (i = 0; i < view_list.length; i += 1) { view_list = JSON.stringify(group_mapping.action_object_view);
view_list[i].class_name = view_list[i].name === view ? 'active' : ''; action_list = JSON.stringify(group_mapping.action_object_jio_action);
} clone_list = JSON.stringify(group_mapping.action_object_clone_action);
} else { jump_list = JSON.stringify(group_mapping.action_object_jio_jump);
for (i = 0; i < workflow_list.length; i += 1) {
workflow_list[i].class_name = workflow_list[i].href === view ? 'active' : '';
}
for (i = 0; i < view_list.length; i += 1) {
view_list[i].class_name = view_list[i].href === view ? 'active' : '';
}
for (i = 0; i < action_list.length; i += 1) {
action_list[i].class_name = action_list[i].href === view ? 'active' : '';
}
for (i = 0; i < clone_list.length; i += 1) {
clone_list[i].class_name = clone_list[i].href === view ? 'active' : '';
}
for (i = 0; i < jump_list.length; i += 1) {
jump_list[i].class_name = ((jump_list[i].href === jump_view) || (jump_list[i].href === view)) ? 'active' : '';
}
}
// 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);
action_list = JSON.stringify(action_list);
clone_list = JSON.stringify(clone_list);
jump_list = JSON.stringify(jump_list);
} }
if (extra_menu_list !== undefined) { if (extra_menu_list !== undefined) {
extra_menu_list = JSON.stringify(extra_menu_list); extra_menu_list = JSON.stringify(extra_menu_list);
} }
return context.getUrlParameter('editable') return context.getUrlParameter('editable')
.push(function (editable) { .push(function (editable) {
return context.changeState({ return context.changeState({
...@@ -142,10 +136,8 @@ ...@@ -142,10 +136,8 @@
}); });
}); });
}) })
.onStateChange(function onStateChange(modification_dict) { .onStateChange(function onStateChange(modification_dict) {
var i, var i,
context = this,
gadget = this, gadget = this,
workflow_list, workflow_list,
view_list, view_list,
...@@ -171,7 +163,7 @@ ...@@ -171,7 +163,7 @@
if (modification_dict.hasOwnProperty("global")) { if (modification_dict.hasOwnProperty("global")) {
queue queue
.push(function () { .push(function () {
return context.getDeclaredGadget('erp5_searchfield'); return gadget.getDeclaredGadget('erp5_searchfield');
}) })
.push(function (search_gadget) { .push(function (search_gadget) {
return search_gadget.render({ return search_gadget.render({
...@@ -186,7 +178,7 @@ ...@@ -186,7 +178,7 @@
// Update the global links // Update the global links
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
context.getUrlForList([ gadget.getUrlForList([
{command: 'display'}, {command: 'display'},
{command: 'display', options: {page: "front"}}, {command: 'display', options: {page: "front"}},
{command: 'display', options: {page: "worklist"}}, {command: 'display', options: {page: "worklist"}},
...@@ -195,7 +187,7 @@ ...@@ -195,7 +187,7 @@
{command: 'display', options: {page: "preference"}}, {command: 'display', options: {page: "preference"}},
{command: 'display', options: {page: "logout"}} {command: 'display', options: {page: "logout"}}
]), ]),
context.getTranslationList([ gadget.getTranslationList([
'Editable', 'Editable',
'Home', 'Home',
'Modules', 'Modules',
...@@ -205,7 +197,7 @@ ...@@ -205,7 +197,7 @@
'Preferences', 'Preferences',
'Logout' 'Logout'
]), ]),
context.getDeclaredGadget("erp5_checkbox") gadget.getDeclaredGadget("erp5_checkbox")
]); ]);
}) })
.push(function (result_list) { .push(function (result_list) {
...@@ -222,7 +214,7 @@ ...@@ -222,7 +214,7 @@
'sliders', null, 'sliders', null,
'power-off', 'o' 'power-off', 'o'
], ],
ul_element = context.element.querySelector("ul"); ul_element = gadget.element.querySelector("ul");
for (i = 0; i < result_list[0].length; i += 1) { for (i = 0; i < result_list[0].length; i += 1) {
// <li><a href="URL" class="ui-btn-icon-left ui-icon-ICON" data-i18n="TITLE" accesskey="KEY"></a></li> // <li><a href="URL" class="ui-btn-icon-left ui-icon-ICON" data-i18n="TITLE" accesskey="KEY"></a></li>
...@@ -244,7 +236,7 @@ ...@@ -244,7 +236,7 @@
ul_element.appendChild(ul_fragment); ul_element.appendChild(ul_fragment);
// Update the checkbox field value // Update the checkbox field value
if (context.state.editable) { if (gadget.state.editable) {
editable_value = ['editable']; editable_value = ['editable'];
} }
return result_list[2].render({field_json: { return result_list[2].render({field_json: {
...@@ -269,64 +261,23 @@ ...@@ -269,64 +261,23 @@
modification_dict.hasOwnProperty("jio_key") || modification_dict.hasOwnProperty("jio_key") ||
modification_dict.hasOwnProperty("view_list") || modification_dict.hasOwnProperty("view_list") ||
modification_dict.hasOwnProperty("extra_menu_list"))) { modification_dict.hasOwnProperty("extra_menu_list"))) {
dl_fragment = document.createDocumentFragment(); dl_fragment = document.createDocumentFragment();
gadget.element.querySelector("dl").textContent = ''; gadget.element.querySelector("dl").textContent = '';
if (this.state.view_list !== undefined) { if (this.state.view_list !== undefined) {
queue queue
.push(function () { .push(function () {
var parameter_list = []; var parameter_list = [];
view_list = JSON.parse(gadget.state.view_list); view_list = JSON.parse(gadget.state.view_list);
action_list = JSON.parse(gadget.state.action_list); action_list = JSON.parse(gadget.state.action_list);
clone_list = JSON.parse(gadget.state.clone_list); clone_list = JSON.parse(gadget.state.clone_list);
jump_list = JSON.parse(gadget.state.jump_list); jump_list = JSON.parse(gadget.state.jump_list);
workflow_list = JSON.parse(gadget.state.workflow_list); workflow_list = JSON.parse(gadget.state.workflow_list);
for (i = 0; i < view_list.length; i += 1) { parameter_list = view_list.concat(workflow_list).concat(
parameter_list.push({ action_list
command: 'display_with_history', ).concat(clone_list).concat(jump_list);
options: {
jio_key: gadget.state.jio_key,
view: view_list[i].href
}
});
}
for (i = 0; i < workflow_list.length; i += 1) {
parameter_list.push({
command: 'display_dialog_with_history',
options: {
jio_key: gadget.state.jio_key,
view: workflow_list[i].href
}
});
}
for (i = 0; i < action_list.length; i += 1) {
parameter_list.push({
command: 'display_dialog_with_history',
options: {
jio_key: gadget.state.jio_key,
view: action_list[i].href
}
});
}
for (i = 0; i < clone_list.length; i += 1) {
parameter_list.push({
command: 'display_dialog_with_history',
options: {
jio_key: gadget.state.jio_key,
view: clone_list[i].href,
editable: true
}
});
}
for (i = 0; i < jump_list.length; i += 1) {
parameter_list.push({
command: 'display_dialog_with_history',
options: {
jio_key: gadget.state.jio_key,
view: jump_list[i].href
}
});
}
return RSVP.all([ return RSVP.all([
gadget.getUrlForList(parameter_list), gadget.getUrlForList(parameter_list),
gadget.getTranslationList(['Views', 'Workflows', 'Actions', gadget.getTranslationList(['Views', 'Workflows', 'Actions',
...@@ -360,7 +311,10 @@ ...@@ -360,7 +311,10 @@
var extra_menu_list = JSON.parse(gadget.state.extra_menu_list), var extra_menu_list = JSON.parse(gadget.state.extra_menu_list),
href_list = []; href_list = [];
for (i = 0; i < extra_menu_list.length; i += 1) { for (i = 0; i < extra_menu_list.length; i += 1) {
extra_menu_list[i].class_name = extra_menu_list[i].active ? "active" : ""; extra_menu_list[i].options = {
"class_name": extra_menu_list[i].active ? "active" : "",
"title": extra_menu_list[i].title
};
href_list.push(extra_menu_list[i].href); href_list.push(extra_menu_list[i].href);
} }
appendDt(dl_fragment, translation_list[0], 'globe', appendDt(dl_fragment, translation_list[0], 'globe',
...@@ -469,4 +423,5 @@ ...@@ -469,4 +423,5 @@
}, /*useCapture=*/false, /*preventDefault=*/true); }, /*useCapture=*/false, /*preventDefault=*/true);
}(window, document, rJS, RSVP, Node, asBoolean, ensureArray)); }(window, document, rJS, RSVP, Node, asBoolean, ensureArray,
\ No newline at end of file mergeGlobalActionWithRawActionList));
\ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>989.59257.5605.14267</string> </value> <value> <string>990.38408.14.44134</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1612884079.54</float> <float>1615306118.36</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, RSVP, domsugar, URI, calculatePageTitle, ensureArray */ /*global window, rJS, RSVP, domsugar, URI, calculatePageTitle,
mergeGlobalActionWithRawActionList */
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
/** Page for displaying Views, Jump and BreadCrumb navigation for a document. /** Page for displaying Views, Jump and BreadCrumb navigation for a document.
*/ */
(function (window, rJS, RSVP, domsugar, URI, calculatePageTitle, ensureArray) { (function (window, rJS, RSVP, domsugar, URI, calculatePageTitle,
mergeGlobalActionWithRawActionList) {
"use strict"; "use strict";
/** Go recursively up the parent-chain and insert breadcrumbs in the last argument. /** Go recursively up the parent-chain and insert breadcrumbs in the last argument.
...@@ -101,31 +103,20 @@ ...@@ -101,31 +103,20 @@
jump_list; jump_list;
return gadget.jio_getAttachment(gadget.state.jio_key, "links") return gadget.jio_getAttachment(gadget.state.jio_key, "links")
.push(function (erp5_document) {
.push(function (result) { var group_mapping = mergeGlobalActionWithRawActionList(gadget.state.jio_key,
var i, gadget.state.view, gadget.state.jump_view,
erp5_document._links, [
"view",
"action_object_jio_jump"
]),
url_for_kw_list = []; url_for_kw_list = [];
erp5_document = result; view_list = group_mapping.view;
view_list = ensureArray(erp5_document._links.view); jump_list = group_mapping.action_object_jio_jump;
jump_list = ensureArray(erp5_document._links.action_object_jio_jump);
for (i = 0; i < view_list.length; i += 1) { url_for_kw_list = url_for_kw_list.concat(view_list).concat(jump_list);
url_for_kw_list.push({command: 'display_with_history', options: {
jio_key: gadget.state.jio_key,
view: view_list[i].href,
page: undefined // Views in ERP5 must be forms but because of
// OfficeJS we keep it empty for different default
}});
}
for (i = 0; i < jump_list.length; i += 1) {
url_for_kw_list.push({command: 'display_dialog_with_history', options: {
jio_key: gadget.state.jio_key,
view: jump_list[i].href
}});
}
url_for_kw_list.push({command: 'cancel_dialog_with_history'}); url_for_kw_list.push({command: 'cancel_dialog_with_history'});
return RSVP.hash({ return RSVP.hash({
url_list: gadget.getUrlForList(url_for_kw_list), url_list: gadget.getUrlForList(url_for_kw_list),
_: modifyBreadcrumbList(gadget, _: modifyBreadcrumbList(gadget,
...@@ -135,21 +126,20 @@ ...@@ -135,21 +126,20 @@
page_title: calculatePageTitle(gadget, erp5_document) page_title: calculatePageTitle(gadget, erp5_document)
}); });
}) })
.push(function (result_dict) { .push(function (result_dict) {
var i, var i,
j = 0; j = 0;
for (i = 0; i < view_list.length; i += 1) { for (i = 0; i < view_list.length; i += 1) {
tab_list.push({ tab_list.push({
title: view_list[i].title, title: view_list[i].options.title,
link: result_dict.url_list[j] link: result_dict.url_list[j]
}); });
j += 1; j += 1;
} }
for (i = 0; i < jump_list.length; i += 1) { for (i = 0; i < jump_list.length; i += 1) {
jump_action_list.push({ jump_action_list.push({
title: jump_list[i].title, title: jump_list[i].options.title,
link: result_dict.url_list[j] link: result_dict.url_list[j]
}); });
j += 1; j += 1;
...@@ -171,4 +161,4 @@ ...@@ -171,4 +161,4 @@
return; return;
}); });
}(window, rJS, RSVP, domsugar, URI, calculatePageTitle, ensureArray)); }(window, rJS, RSVP, domsugar, URI, calculatePageTitle, mergeGlobalActionWithRawActionList));
\ No newline at end of file \ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.62315.62619.21640</string> </value> <value> <string>990.47132.25658.34884</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1582128721.85</float> <float>1615900895.13</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -1193,12 +1193,12 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1193,12 +1193,12 @@ div[data-gadget-scope='header'] .ui-header {
animation: fadein @transition-timing; animation: fadein @transition-timing;
} }
// Dialog page template main submit button // Dialog page template main submit button
input[type='submit'] { input[type='submit'] {
.renderPageSubmitButton(@coloraccent); .renderPageSubmitButton(@coloraccent);
text-shadow: @foreground-text-shadow; text-shadow: @foreground-text-shadow;
} }
// Dialog page template update button // Dialog page template update button
button[name='action_update'] { button[name='action_update'] {
.renderPageSubmitButton(@grey); .renderPageSubmitButton(@grey);
} }
...@@ -1365,7 +1365,6 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1365,7 +1365,6 @@ div[data-gadget-scope='header'] .ui-header {
.ui-field-contain { .ui-field-contain {
& > label:not(.is-invalid) { & > label:not(.is-invalid) {
color: @colorlabel; color: @colorlabel;
} }
} }
//Label styling in required and "invisible" field //Label styling in required and "invisible" field
...@@ -2136,6 +2135,18 @@ ul.ui-list-grid { ...@@ -2136,6 +2135,18 @@ ul.ui-list-grid {
} }
} }
/**********************************************
* Developer mode actions
**********************************************/
.edit-form, .edit-form-action, .edit-field, .translate-title, .translate-description {
margin-left: @half-margin-size;
color: @colorlabel;
}
.translate-description {
border: @border;
}
/********************************************** /**********************************************
* Icons * Icons
**********************************************/ **********************************************/
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_ui_developer_mode_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testAccessPortalTypeDocument</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Access Portal Type Document</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Access Portal Type Document</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block tal:define="click_configuration python: {'text': 'Views'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Portal Type"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementNotPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testAccessWorkflow</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Access Workflow</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Access Workflow</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block tal:define="click_configuration python: {'text': 'Views'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//ul[@class="document-listview"]//li/a[text()="Edit Workflow"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//ul[@class="document-listview"]//li/a[text()="Edit Workflow"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value="Edit Workflow"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Edit Workflow"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperEditField</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Edit Field</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Field</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>assertElementPresent</td>
<td>//label/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/my_preferred_html_style_developper_mode/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//label/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/my_preferred_html_style_developper_mode/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Developer Mode"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperEditForm</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Edit Form</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form</td></tr>
</thead><tbody>
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<!-- Check if save the page again will not create the links again -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"][1]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"][2]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperEditFormAction</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Edit Form Action</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form Action</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="hateoas/Base_edit/manage_main"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"][1]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"][2]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="hateoas/Base_edit/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="ZPythonScriptHTML_editAction:method"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleEditForm</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Edit Form</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Edit Form</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="hateoas/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="hateoas/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Script (Python)</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-field-contain"]/div/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-field-contain"]/div/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Accounting Transactions"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleEditFormAction</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Edit Form Action</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Edit Form Action</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="hateoas/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="hateoas/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Script (Python)</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleEditLisbox</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Edit Listbox</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Edit Form</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//div[@class="ui-field-contain"]/div/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Accounting Transactions"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleTranslateField</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Translate Field</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Translate Field</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>click</td>
<td>//li/a[text()="Modules"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//div[@class="ui-field-contain"]/div/a[@href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EAccounting+Transactions%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="regex" and @value="^Accounting Transactions$"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperTranslateField</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Translate Field</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Translate Field</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<tr>
<td>click</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="regex" and @value="^Translator Mode$"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="regex" and @value="^Translator Mode$"]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="regex" and @value="^Indicate if we display link to translation system in interface or not$"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="regex" and @value="^Indicate if we display link to translation system in interface or not$"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDisplayActionWhenNonEditable</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Display Actions When non-editable</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[@title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[@title="Translate this field description"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testFieldsWithoutLabel</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Fields without label</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Fields without label</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr>
<td rowspan="1" colspan="3">Test Fields without label
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/expected_failure_for_anonymous_selection" />
</td>
</tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//a[text()="Foos"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Add'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Object created.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Developer Mode Action'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_listbox_left"]/a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/listbox_left/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_listbox_left"]/a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EListbox%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_listbox_left"]/a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/listbox_left/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_listbox_left"]/a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EListbox%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_listbox_right"]/a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/listbox_right/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_listbox_right"]/a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EListbox%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_listbox_right"]/a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/listbox_right/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_listbox_right"]/a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EListbox%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_title"]/a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/my_title/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_title"]/a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5ETitle%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_your_description"]/a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/your_description/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_your_description"]/a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EDescription%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[contains(@class, 'edit-field') and @href="portal_skins/erp5_ui_test/Foo_viewDeveloperModeAction/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[contains(@class, 'translate-title') and @href="<span tal:replace='string:/erp5/Localizer/erp5_ui/manage_messages?regex=%5EListbox%24&lang=en'></span>"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//a[text()="Foos"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class="document_table"]//a[contains(@class, 'edit-field') and @href="$manage_main"]</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testHideButtonsAfterDisable</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Hide Buttons After Disable</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=1 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementNotPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=1 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field description"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testIssueWithFormBox</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Issue with Formbox</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Fields without label</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr>
<td rowspan="1" colspan="3">Test Issue to Add Person
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/expected_failure_for_anonymous_selection" />
</td>
</tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//a[text()="Foos"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Add'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Object created.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'FormBox'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertTextNotPresent</td>
<td>Failed to execute 'removeChild' on 'Node'</td>
<td></td>
</tr>
<!-- We should not display form action link if it is empty and this happens with Formbox. -->
<tr>
<td>assertElementNotPresent</td>
<td>//a[@class="edit-form-action" and @href="hateoas//manage_main"]</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testMatrixboxWithoutDevelopmentActionInCell</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Matrixbox Without Development Action In Cell</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<!-- Test MatrixBox functionality to
- create one embedded Cell Line
- create second embedded Cell Line
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test MatrixBox Column Title</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test MatrixBox Column Title</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block metal:use-macro="here/MatrixBoxZuite_CommonTemplate/macros/init" />
<!-- Shortcut for full renderjs url and matrixbox gadget -->
<tr><td>store</td>
<td>${base_url}/web_site_module/renderjs_runner</td>
<td>renderjs_url</td></tr>
<tr><td>store</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_field_listbox.html"]//table</td>
<td>listbox_table</td></tr>
<tr><td>open</td>
<td>${base_url}/foo_module/FooModule_createObjects?create_line:int=1</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Created Successfully.</td><td></td></tr>
<tr><td>open</td>
<td>${base_url}/foo_module/Zuite_waitForActivities</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Done.</td><td></td></tr>
<tr><td>open</td>
<td>${renderjs_url}/#/foo_module/0/1?editable=1</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Views'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'MatrixBox'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr><td>assertElementNotPresent</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_label_field.html"]//a[@class="edit-field"]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//div[@data-gadget-url="${renderjs_url}/gadget_erp5_field_matrixbox.html"]//input[@name="field_matrixbox_quantity_cell_0_0_0"]</td><td></td></tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testModuleAccessPortalTypeDocument</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Access Portal Type Document</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Access Portal Type Document</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="website_url python: '{}/web_site_module/renderjs_runner/'.format(here.getPortalObject().absolute_url())">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/go_to_module_list" />
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//dd[@class="document-listview"]/a[text()="Edit Portal Type"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//dd[@class="document-listview"]/a[text()="Edit Portal Type"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//dd[@class="document-listview"]/a[text()="Edit Portal Type"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Base Type: Accounting Transaction Module"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@data-i18n="Base Type: Accounting Transaction Module"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Base Type: Accounting Transaction Module"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//dd[@class="document-listview"]/a[text()="Edit Portal Type"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@data-i18n="Accounting"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
...@@ -2,6 +2,8 @@ portal_tests/renderjs_ui_check_box_field_zuite ...@@ -2,6 +2,8 @@ portal_tests/renderjs_ui_check_box_field_zuite
portal_tests/renderjs_ui_check_box_field_zuite/** portal_tests/renderjs_ui_check_box_field_zuite/**
portal_tests/renderjs_ui_date_time_field_zuite portal_tests/renderjs_ui_date_time_field_zuite
portal_tests/renderjs_ui_date_time_field_zuite/** portal_tests/renderjs_ui_date_time_field_zuite/**
portal_tests/renderjs_ui_developer_mode_zuite
portal_tests/renderjs_ui_developer_mode_zuite/**
portal_tests/renderjs_ui_dms_zuite portal_tests/renderjs_ui_dms_zuite
portal_tests/renderjs_ui_dms_zuite/** portal_tests/renderjs_ui_dms_zuite/**
portal_tests/renderjs_ui_editor_gadget_zuite portal_tests/renderjs_ui_editor_gadget_zuite
......
...@@ -1764,5 +1764,31 @@ ...@@ -1764,5 +1764,31 @@
</tr> </tr>
</tal:block> </tal:block>
<tal:block metal:define-macro="enable_developer_mode">
<tr>
<td>open</td>
<td tal:content="website_url"></td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Preferences'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'User Interface'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
</tal:block>
</tal:block> </tal:block>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyjio_jump</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jump_to_portal_type</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit Portal Type</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_redirectToPortalTypeDocument</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: portal.portal_preferences.isPreferredHtmlStyleDevelopperMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -169,6 +169,7 @@ portal_actions | create_module ...@@ -169,6 +169,7 @@ portal_actions | create_module
portal_actions | diff_multiple_object_action portal_actions | diff_multiple_object_action
portal_actions | diff_object_action portal_actions | diff_object_action
portal_actions | history portal_actions | history
portal_actions | jump_to_portal_type
portal_actions | list_ui portal_actions | list_ui
portal_actions | make_template portal_actions | make_template
portal_actions | mass_workflow portal_actions | mass_workflow
......
...@@ -13,6 +13,11 @@ elif dialog_category == 'object_action': ...@@ -13,6 +13,11 @@ elif dialog_category == 'object_action':
return sorted(actions.get('object_action', []) + actions.get('object_jio_action', []), key=lambda x: x["priority"]) return sorted(actions.get('object_action', []) + actions.get('object_jio_action', []), key=lambda x: x["priority"])
elif dialog_category == 'object_fast_input': elif dialog_category == 'object_fast_input':
return sorted(actions.get('object_fast_input', []) + actions.get('object_jio_fast_input', []), key=lambda x: x["priority"]) return sorted(actions.get('object_fast_input', []) + actions.get('object_jio_fast_input', []), key=lambda x: x["priority"])
elif dialog_category == 'object_button':
return sorted(actions.get('object_button', []) +
actions.get('object_jio_button', []) +
actions.get('object_jio_button_raw', []),
key=lambda x: x["priority"])
if dialog_category != 'object_print': if dialog_category != 'object_print':
return actions.get(dialog_category, []) return actions.get(dialog_category, [])
......
...@@ -106,9 +106,7 @@ ...@@ -106,9 +106,7 @@
exchange_jio_actions actions/object_jio_exchange | nothing; exchange_jio_actions actions/object_jio_exchange | nothing;
report_actions actions/object_report | nothing; report_actions actions/object_report | nothing;
report_jio_actions actions/object_jio_report | nothing; report_jio_actions actions/object_jio_report | nothing;
button_action actions/object_button | empty_array; button_actions python:here.Base_fixDialogActions(actions, 'object_button') or [];
button_jio_action actions/object_jio_button | empty_array;
button_actions python: button_action + button_jio_action;
fast_input_actions actions/object_fast_input | nothing; fast_input_actions actions/object_fast_input | nothing;
fast_input_jio_actions actions/object_jio_fast_input | nothing; fast_input_jio_actions actions/object_jio_fast_input | nothing;
sort_actions actions/object_sort | nothing; sort_actions actions/object_sort | nothing;
......
...@@ -460,6 +460,14 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False): ...@@ -460,6 +460,14 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
for wf_id in self.getChainFor(info.object): for wf_id in self.getChainFor(info.object):
wf = self.getWorkflowById(wf_id) wf = self.getWorkflowById(wf_id)
if wf is not None: if wf is not None:
actions.append({
"id": "onlyjio_%s" % wf.id,
"name": wf.title,
"url": "%s/manage_properties" % wf.absolute_url_path(),
"icon": None,
"category": "object_onlyjio_jump_raw",
"priority": 100
})
actions.extend(wf.listObjectActions(info)) actions.extend(wf.listObjectActions(info))
portal = self.getPortalObject() portal = self.getPortalObject()
......
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