Commit cbfb6ccb authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Editable parameter is now sticky

Allow to switch from editable/viewable mode directly from the panel.
Drop editable/viewable button on tabpage.

The editable parameter is propagated by all links.
parent 4469fdaf
......@@ -498,6 +498,19 @@ div[data-gadget-scope='panel'] img {
text-align: left;
height: 100%;
}
div[data-gadget-scope='panel'] div[data-gadget-scope="erp5_checkbox"] {
padding: 3pt;
padding-left: 12pt;
}
div[data-gadget-scope='panel'] div[data-gadget-scope="erp5_checkbox"] label,
div[data-gadget-scope='panel'] div[data-gadget-scope="erp5_checkbox"] span,
div[data-gadget-scope='panel'] div[data-gadget-scope="erp5_checkbox"] input {
cursor: pointer;
}
div[data-gadget-scope='panel'] div[data-gadget-scope="erp5_checkbox"] span {
width: 24pt;
display: inline-block;
}
div[data-gadget-scope='panel'] ul:first-child {
margin-top: 30pt;
}
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.22948.35082.52087</string> </value>
<value> <string>958.38697.56980.48179</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1490947545.17</float>
<float>1491827283.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,6 +4,9 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Panel</title>
<!--
data-i18n=Editable
-->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
......@@ -35,17 +38,22 @@
data-gadget-sandbox="public"></div>
</form>
<ul data-role="listview" class="ui-listview" data-enhanced="true">
<li class="ui-first-child"><a href="#" class="ui-btn ui-btn-icon-left ui-icon-home" data-i18n="Home">Home</a></li>
<ul data-role="listview" class="ui-listview" data-enhanced="true"></ul>
<div data-gadget-url="gadget_erp5_field_checkbox.html"
data-gadget-scope="erp5_checkbox"
data-gadget-sandbox="public"></div>
<dl></dl>
</div>
</script>
<script id="panel-template-body-list" type="text/x-handlebars-template">
<li class="ui-first-child"><a href="{{front_href}}" class="ui-btn ui-btn-icon-left ui-icon-home" data-i18n="Home">Home</a></li>
<li><a href="{{module_href}}" class="ui-btn ui-btn-icon-left ui-icon-puzzle-piece" data-i18n="Modules" accesskey="m">Modules</a></li>
<li><a href="{{worklist_href}}" class="ui-btn ui-btn-icon-left ui-icon-clipboard" data-i18n="Worklists" accesskey="w">Worklists</a></li>
<li><a href="{{history_href}}" class="ui-btn ui-btn-icon-left ui-icon-history" data-i18n="History" accesskey="h">History</a></li>
<li><a href="{{search_href}}" class="ui-btn ui-btn-icon-left ui-icon-search" data-i18n="Search" accesskey="s">Search</a></li>
<li><a href="{{preference_href}}" class="ui-btn ui-btn-icon-left ui-icon-gear" data-i18n="Preferences">Preferences</a></li>
<li class="ui-last-child"><a href="{{logout_href}}" class="ui-btn ui-btn-icon-left ui-icon-power-off" data-i18n="Logout" accesskey="o">Logout</a></li>
</ul>
<dl></dl>
</div>
</script>
<script id="panel-template-body-desktop" type="text/x-handlebars-template">
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.46848.56526.7116</string> </value>
<value> <string>958.33121.48203.5614</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1488384141.54</float>
<float>1491822419.47</float>
<string>UTC</string>
</tuple>
</state>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */
/*global window, document, rJS, Handlebars, RSVP, Node, loopEventListener */
(function (window, document, rJS, Handlebars, RSVP, Node, loopEventListener) {
"use strict";
......@@ -15,6 +15,9 @@
panel_template_body = Handlebars.compile(template_element
.getElementById("panel-template-body")
.innerHTML),
panel_template_body_list = Handlebars.compile(template_element
.getElementById("panel-template-body-list")
.innerHTML),
panel_template_body_desktop = Handlebars.compile(template_element
.getElementById("panel-template-body-desktop")
.innerHTML);
......@@ -29,7 +32,9 @@
//////////////////////////////////////////////
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -48,7 +53,8 @@
.declareMethod('render', function (options) {
var erp5_document = options.erp5_document,
workflow_list,
view_list;
view_list,
context = this;
if (erp5_document !== undefined) {
workflow_list = erp5_document._links.action_workflow || [];
view_list = erp5_document._links.action_object_view || [];
......@@ -63,12 +69,15 @@
workflow_list = JSON.stringify(workflow_list);
view_list = JSON.stringify(view_list);
}
return this.changeState({
workflow_list: workflow_list,
view_list: view_list,
global: true,
editable: options.editable
});
return context.getUrlParameter('editable')
.push(function (editable) {
return context.changeState({
workflow_list: workflow_list,
view_list: view_list,
global: true,
editable: options.editable || editable || false
});
});
})
.onStateChange(function (modification_dict) {
......@@ -92,32 +101,16 @@
if (modification_dict.hasOwnProperty("global")) {
queue
.push(function () {
return RSVP.all([
context.getUrlFor({command: 'display', options: {page: "front"}}),
context.getUrlFor({command: 'display', options: {page: "history"}}),
context.getUrlFor({command: 'display', options: {page: "preference"}}),
context.getUrlFor({command: 'display', options: {page: "logout"}}),
context.getUrlFor({command: 'display', options: {page: "search"}}),
context.getUrlFor({command: 'display', options: {page: "worklist"}})
]);
})
.push(function (result_list) {
// XXX: Customize panel header!
return context.translateHtml(
panel_template_header() +
panel_template_body({
"module_href": result_list[0],
"history_href": result_list[1],
"preference_href": result_list[2],
"logout_href": result_list[3],
"search_href": result_list[4],
"worklist_href": result_list[5]
})
panel_template_body()
);
})
.push(function (my_translated_or_plain_html) {
tmp_element = document.createElement('div');
tmp_element.innerHTML = my_translated_or_plain_html;
return context.declareGadget('gadget_erp5_searchfield.html', {
scope: "erp5_searchfield",
element: tmp_element.querySelector('[data-gadget-scope="erp5_searchfield"]')
......@@ -128,12 +121,75 @@
focus: false
});
})
.push(function () {
return context.declareGadget('gadget_erp5_field_multicheckbox.html', {
scope: "erp5_checkbox",
element: tmp_element.querySelector('[data-gadget-scope="erp5_checkbox"]')
});
})
.push(function () {
context.element.querySelector("div").appendChild(tmp_element);
return context.listenResize();
});
}
if (modification_dict.hasOwnProperty("editable")) {
queue
// Update the global links
.push(function () {
return RSVP.all([
context.getUrlFor({command: 'display', options: {page: "front"}}),
context.getUrlFor({command: 'display', options: {page: "history"}}),
context.getUrlFor({command: 'display', options: {page: "preference"}}),
context.getUrlFor({command: 'display', options: {page: "logout"}}),
context.getUrlFor({command: 'display', options: {page: "search"}}),
context.getUrlFor({command: 'display', options: {page: "worklist"}}),
context.getUrlFor({command: 'display'})
]);
})
.push(function (result_list) {
return context.translateHtml(
panel_template_body_list({
"module_href": result_list[0],
"history_href": result_list[1],
"preference_href": result_list[2],
"logout_href": result_list[3],
"search_href": result_list[4],
"worklist_href": result_list[5],
"front_href": result_list[6]
})
);
})
.push(function (result) {
context.element.querySelector("ul").innerHTML = result;
// Update the checkbox field value
return RSVP.all([
context.getDeclaredGadget("erp5_checkbox"),
context.translate("Editable")
]);
})
.push(function (result_list) {
var value = [],
search_gadget = result_list[0],
title = result_list[1];
if (context.state.editable) {
value = ['editable'];
}
return search_gadget.render({field_json: {
editable: true,
name: 'editable',
key: 'editable',
hidden: false,
items: [[title, 'editable']],
default: value
}});
});
}
if ((this.state.global === true) &&
(modification_dict.hasOwnProperty("desktop") ||
modification_dict.hasOwnProperty("editable") ||
......@@ -240,10 +296,29 @@
return result;
})
.allowPublicAcquisition('notifyChange', function () {
.allowPublicAcquisition('notifyChange', function (argument_list, scope) {
if (scope === 'erp5_checkbox') {
var context = this;
return context.getDeclaredGadget('erp5_checkbox')
.push(function (gadget) {
return gadget.getContent();
})
.push(function (result) {
var options = {editable: undefined};
if (result.editable.length === 1) {
options.editable = true;
}
return context.redirect({command: 'change', options: options});
});
}
// Typing a search query should not modify the header status
return;
})
.allowPublicAcquisition('notifyValid', function () {
// Typing a search query should not modify the header status
return;
})
.onEvent('submit', function () {
var gadget = this;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.19723.40120.16469</string> </value>
<value> <string>958.33121.48203.5614</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1490688736.61</float>
<float>1491816291.84</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -52,8 +52,7 @@
command: 'change',
options: {
view: view_list[i].href,
page: undefined,
editable: options.editable
page: undefined
}
})
);
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.29509.41156.45721</string> </value>
<value> <string>956.58742.58866.48708</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479825199.32</float>
<float>1491225034.71</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.40691.44097.35481</string> </value>
<value> <string>958.28347.56387.25600</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1488273849.34</float>
<float>1491225124.12</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, calculatePageTitle */
/*global window, rJS, RSVP, calculatePageTitle, jIO */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, calculatePageTitle) {
(function (window, rJS, RSVP, calculatePageTitle, jIO) {
"use strict";
rJS(window)
......@@ -71,13 +71,13 @@
}
if (delete_action !== undefined) {
delete_action = form_gadget.getUrlFor({command: 'change', options: {view: delete_action.href, editable: undefined}});
delete_action = form_gadget.getUrlFor({command: 'change', options: {view: delete_action.href}});
} else {
delete_action = "";
}
return RSVP.all([
form_gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
form_gadget.getUrlFor({command: 'change', options: {page: "action", editable: true}}),
form_gadget.getUrlFor({command: 'change', options: {page: "action"}}),
new_content_action,
form_gadget.getUrlFor({command: 'history_previous'}),
delete_action,
......@@ -137,9 +137,8 @@
.push(function (result_list) {
if (result_list[1].target.responseType === "blob") {
return jIO.util.readBlobAsText(result_list[1].target.response);
} else {
return {target: {result: result_list[1].target.response}};
}
return {target: {result: result_list[1].target.response}};
})
.push(function (event) {
var message;
......@@ -171,9 +170,8 @@
.push(function () {
if (error.target.responseType === "blob") {
return jIO.util.readBlobAsText(error.target.response);
} else {
return {target: {result: error.target.response}};
}
return {target: {result: error.target.response}};
})
.push(function (event) {
return form_gadget.displayFormulatorValidationError(JSON.parse(event.target.result));
......@@ -187,4 +185,4 @@
}, false, true);
}(window, rJS, RSVP, calculatePageTitle));
\ No newline at end of file
}(window, rJS, RSVP, calculatePageTitle, jIO));
\ No newline at end of file
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>957.33876.27734.63044</string> </value>
<value> <string>958.31331.40640.10291</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1490373394.35</float>
<float>1491385195.38</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -62,7 +62,6 @@
.push(function (result2) {
return gadget.redirect({command: 'change', options: {
view: result2._links.view[0].href,
editable: undefined,
page: undefined
}});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.2825.24067.48281</string> </value>
<value> <string>958.28347.56387.25600</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1489674820.97</float>
<float>1491391860.07</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -33,7 +33,7 @@
gadget = this,
erp5_document,
tab_title = "Views",
tab_icon = options.editable ? "pencil" : "eye",
tab_icon = "eye",
jump_list;
function handleParent(parent_link) {
......@@ -88,7 +88,6 @@
for (i = 0; i < view_list.length; i += 1) {
promise_list.push(gadget.getUrlFor({command: 'change', options: {
view: view_list[i].href,
editable: options.editable,
page: undefined
}}));
}
......@@ -147,10 +146,7 @@
gadget.getUrlFor({command: 'change', options: {
page: undefined
}}),
calculatePageTitle(gadget, erp5_document),
gadget.getUrlFor({command: 'change', options: {
editable: options.editable ? undefined : true
}})
calculatePageTitle(gadget, erp5_document)
]);
})
.push(function (url_list) {
......@@ -158,11 +154,6 @@
back_url: url_list[0],
page_title: url_list[1]
};
if (options.editable) {
dict.view_url = url_list[2];
} else {
dict.edit_url = url_list[2];
}
return gadget.updateHeader(dict);
});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.29510.26421.23705</string> </value>
<value> <string>958.28347.56387.25600</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479825091.01</float>
<float>1491225418.18</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,20 +15,36 @@
PREFIX_DISPLAY = "/",
PREFIX_COMMAND = "!",
// PREFIX_ERROR = "?",
// Display a jio document with only the passed parameters
COMMAND_DISPLAY_STATE = "display",
// Store the jio key for the person document of the user
COMMAND_LOGIN = "login",
// Display a raw string URL
COMMAND_RAW = "raw",
// Redisplay the page with the same parameters
COMMAND_RELOAD = "reload",
// Display the latest state stored for a jio document
COMMAND_DISPLAY_STORED_STATE = "display_stored_state",
// Display the current jio document, but change some URL parameters
COMMAND_CHANGE_STATE = "change",
// Like change, but also store the current jio document display state
COMMAND_STORE_AND_CHANGE_STATE = "store_and_change",
// Display one entry index from a selection
COMMAND_INDEX_STATE = "index",
// Display previous entry index from a selection
COMMAND_SELECTION_PREVIOUS = "selection_previous",
// Display next entry index from a selection
COMMAND_SELECTION_NEXT = "selection_next",
// Display previously accessed document
COMMAND_HISTORY_PREVIOUS = "history_previous",
// Store the current document in history and display the next one
COMMAND_PUSH_HISTORY = "push_history",
// Change UI language
COMMAND_CHANGE_LANGUAGE = "change_language",
VALID_URL_COMMAND_DICT = {};
VALID_URL_COMMAND_DICT = {},
STICKY_PARAMETER_LIST = ['editable'];
VALID_URL_COMMAND_DICT[COMMAND_DISPLAY_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_DISPLAY_STORED_STATE] = null;
VALID_URL_COMMAND_DICT[COMMAND_CHANGE_STATE] = null;
......@@ -43,6 +59,32 @@
VALID_URL_COMMAND_DICT[COMMAND_RELOAD] = null;
VALID_URL_COMMAND_DICT[COMMAND_CHANGE_LANGUAGE] = null;
function dropStickyParameterEntry(options) {
// Drop sticky parameters from an options dict
// Do not modify the options parameters, to prevent any unexpected side effect
var i,
result = JSON.parse(JSON.stringify(options));
for (i = 0; i < STICKY_PARAMETER_LIST.length; i += 1) {
delete result[STICKY_PARAMETER_LIST[i]];
}
return result;
}
function copyStickyParameterDict(previous_options, next_options, drop_options) {
var i,
key;
// Keep sticky parameters if they are currently defined in URL
if (drop_options === undefined) {
drop_options = {};
}
for (i = 0; i < STICKY_PARAMETER_LIST.length; i += 1) {
key = STICKY_PARAMETER_LIST[i];
// Check that sticky parameter previously exist and that it was not modified
if (previous_options.hasOwnProperty(key) && (!(next_options.hasOwnProperty(key) || drop_options.hasOwnProperty(key)))) {
next_options[key] = previous_options[key];
}
}
}
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
......@@ -68,6 +110,9 @@
}
function addHistory(gadget, options, previous_selection_id) {
// Drop sticky parameters
options = dropStickyParameterEntry(options);
var options_blob = {
type: "options",
data: options
......@@ -242,6 +287,8 @@
if (jio_key) {
queue = gadget.props.jio_state_gadget.get(jio_key)
.push(function (options) {
// Keep the sticky parameters
copyStickyParameterDict(next_options, options);
next_options = options;
}, function (error) {
if ((error instanceof jIO.util.jIOError) &&
......@@ -291,23 +338,24 @@
function execStoreAndChangeCommand(gadget, previous_options, next_options, drop_options) {
var options,
jio_key,
queue;
queue,
display_url;
options = calculateChangeOptions(previous_options, next_options, drop_options);
jio_key = options.jio_key;
delete options.jio_key;
display_url = getDisplayUrlFor(jio_key, options);
if (jio_key) {
queue = gadget.props.jio_state_gadget.put(jio_key, options);
queue = gadget.props.jio_state_gadget.put(jio_key, dropStickyParameterEntry(options));
} else {
queue = new RSVP.Queue();
}
return queue
.push(function () {
return synchronousChangeState(
getDisplayUrlFor(jio_key, options)
);
return synchronousChangeState(display_url);
});
}
......@@ -376,14 +424,16 @@
getCommandUrlFor(gadget, COMMAND_HISTORY_PREVIOUS, previous_options)
);
}
var options = {
selection: previous_options.selection,
selection_index: parseInt(previous_options.selection_index || '0', 10) + 1,
history: previous_options.history
};
copyStickyParameterDict(previous_options, options);
return addNavigationHistoryAndDisplay(
gadget,
result.data.rows[0].id,
{
selection: previous_options.selection,
selection_index: parseInt(previous_options.selection_index || '0', 10) + 1,
history: previous_options.history
}
options
);
});
}, function (error) {
......@@ -425,14 +475,16 @@
getCommandUrlFor(gadget, COMMAND_HISTORY_PREVIOUS, previous_options)
);
}
var options = {
selection: previous_options.selection,
selection_index: parseInt(previous_options.selection_index, 10) - 1,
history: previous_options.history
};
copyStickyParameterDict(previous_options, options);
return addNavigationHistoryAndDisplay(
gadget,
result.data.rows[0].id,
{
selection: previous_options.selection,
selection_index: parseInt(previous_options.selection_index, 10) - 1,
history: previous_options.history
}
options
);
});
}, function (error) {
......@@ -446,15 +498,16 @@
});
}
function redirectToParent(gadget, jio_key) {
function redirectToParent(gadget, jio_key, previous_options) {
return gadget.jio_getAttachment(jio_key, "links")
.push(function (erp5_document) {
var parent_link = erp5_document._links.parent,
uri;
uri,
options = {};
if (parent_link !== undefined) {
uri = new URI(parent_link.href);
return addNavigationHistoryAndDisplay(gadget, uri.segment(2), {});
copyStickyParameterDict(previous_options, options);
return addNavigationHistoryAndDisplay(gadget, uri.segment(2), options);
}
});
}
......@@ -468,7 +521,7 @@
previous_id;
if (history === undefined) {
if (jio_key !== undefined) {
return redirectToParent(gadget, jio_key);
return redirectToParent(gadget, jio_key, previous_options);
}
}
if (previous_options.back_field) {
......@@ -511,12 +564,14 @@
options = result_list[0].data,
next_jio_key = options.jio_key;
delete options.jio_key;
copyStickyParameterDict(previous_options, options);
return addNavigationHistoryAndDisplay(gadget, next_jio_key, options);
}, function (error) {
// XXX Check if 404
if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 404)) {
return redirectToParent(gadget, jio_key);
return redirectToParent(gadget, jio_key, previous_options);
// return [{data: {}}, undefined];
}
throw error;
......@@ -544,14 +599,19 @@
//////////////////////////////////////////////////////////////////
// Command URL functions
//////////////////////////////////////////////////////////////////
function routeMethodLess(gadget) {
function routeMethodLess(gadget, previous_options) {
// Nothing. Go to front page
// If no frontpage is configured, his may comes from missing configuration on website
// or default HTML gadget modification date more recent than the website modification date
return gadget.getSetting("frontpage_gadget")
.push(function (result) {
var options = {page: result};
if (previous_options === undefined) {
previous_options = {};
}
copyStickyParameterDict(previous_options, options);
return synchronousChangeState(
getDisplayUrlFor(undefined, {page: result})
getDisplayUrlFor(undefined, options)
);
});
}
......@@ -573,7 +633,7 @@
}
if (command_options.args.page === undefined) {
return routeMethodLess(gadget);
return routeMethodLess(gadget, command_options.args);
}
command_options.args.jio_key = command_options.path || undefined;
......@@ -652,6 +712,9 @@
throw new Error('Unsupported parameters: ' + key);
}
// Do not calculate this while generating the URL string to not do this too much time
copyStickyParameterDict(previous_options, next_options, drop_options);
if (command_options.path === COMMAND_DISPLAY_STATE) {
return execDisplayCommand(gadget, next_options);
}
......@@ -864,7 +927,7 @@
if (command_options.method) {
throw new Error('Unsupported hash method: ' + command_options.method);
}
result = routeMethodLess(gadget);
result = routeMethodLess(gadget, command_options.args);
}
return new RSVP.Queue()
.push(function () {
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.21187.63463.29218</string> </value>
<value> <string>958.31324.24990.32187</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1490952254.49</float>
<float>1491384797.89</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -591,6 +591,19 @@ div[data-gadget-scope='panel'] {
height: 100%;
}
div[data-gadget-scope="erp5_checkbox"] {
padding: @half-margin-size;
padding-left: @double-margin-size;
label, span, input {
cursor: pointer;
}
span {
width: @quadruple-margin-size;
display: inline-block;
}
}
.alignwithicon() {
padding: @half-margin-size;
......
<?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>testListboxInNoEditableMode</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></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -64,12 +64,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
......
......@@ -29,11 +29,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_non_editable_mode" />
<tr>
<td>waitForElementPresent</td>
......@@ -54,14 +50,7 @@
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_non_editable_mode" />
<tr>
......
......@@ -38,14 +38,14 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='Validate Action' and contains(@href, '#!change') and contains(@href, 'validate_action') and contains(@href, 'u.page=') and contains(@href, 'u.editable=')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='Validate Action' and contains(@href, '#!change') and contains(@href, 'validate_action') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<!-- Follow one link -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='Validate Action' and contains(@href, '#!change') and contains(@href, 'validate_action') and contains(@href, 'u.page=') and contains(@href, 'u.editable=')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='Validate Action' and contains(@href, '#!change') and contains(@href, 'validate_action') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
......
<?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>testPageTabEditablesLinkList</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></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 Page Front</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Page Tab Link List</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?page=tab</td>
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_tab.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<!-- Generate links to parents -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'n.view=') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'n.view=') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='Duration Field' and contains(@href, '#!change') and contains(@href, 'view_duration_field') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td></td>
</tr>
<!-- Follow one link -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='Duration Field' and contains(@href, '#!change') and contains(@href, 'view_duration_field') and contains(@href, 'u.page=') and contains(@href, 'n.editable=true')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Duration Quantity</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<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 Page Front</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Page Tab Breadcrumb List</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?page=tab</td>
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_tab.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Views"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Views"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Viewable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n="Save"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Views"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Viewable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Viewable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Relation Fields"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Views"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -34,14 +34,14 @@
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'u.editable=')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<!-- Follow one link -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'u.editable=')]</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
......
......@@ -55,24 +55,24 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Views']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Relation Fields']</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Relation Fields']</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change')]</td>
<td></td>
</tr>
......@@ -108,6 +108,11 @@
<td>blur</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//li[@data-relative-url='portal_categories/foo_category/a/a1']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li[@data-relative-url='portal_categories/foo_category/a/a1']</td>
......@@ -237,16 +242,12 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope="field_my_title"]//p</td>
<td>verifyValue</td>
<td>//div[@data-gadget-scope="field_my_title"]//input</td>
<td>A New Foo</td>
</tr>
......@@ -256,6 +257,7 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
......@@ -263,24 +265,18 @@
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='field_my_bar_category_title_list']//fieldset[2]//a[contains(@class, "ui-icon-plane")]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope="field_my_title"]//p</td>
<td>verifyValue</td>
<td>//div[@data-gadget-scope="field_my_title"]//input</td>
<td>Another Foo</td>
</tr>
......
......@@ -227,31 +227,7 @@
</tr>
<!-- Switch back to readonly mode -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Viewable' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Viewable' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.editable=')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.editable=')]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<!-- Check airplane link -->
<tr>
......
......@@ -44,12 +44,12 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Views']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Views']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
......@@ -72,13 +72,13 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Relation Fields']</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Relation Fields']</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change')]</td>
<td></td>
</tr>
......@@ -355,62 +355,45 @@
<td>Foo Module</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tbody/tr[1]/th/a</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/clear_query" />
<tr>
<td>click</td>
<td>waitForElementPresent</td>
<td>//tbody/tr[1]/th/a</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Views"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Views"]</td>
<td>//tbody/tr[1]/th/a</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Relation Fields']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Relation Fields']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Editable']</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Editable']</td>
<td>//div[@data-gadget-scope='m']//a[text()='Relation Fields' and contains(@href, '#!change')]</td>
<td></td>
</tr>
......
......@@ -168,6 +168,8 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='field_my_successor_title']</td>
......@@ -194,16 +196,12 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope="field_my_title"]//p</td>
<td>verifyValue</td>
<td>//div[@data-gadget-scope="field_my_title"]//input</td>
<td>A new foo</td>
</tr>
......
......@@ -188,31 +188,7 @@
</tr>
<!-- Switch back to readonly mode -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Viewable' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Viewable' and contains(@href, '#!change')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.editable=')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Relation Fields' and contains(@href, '#!change') and contains(@href, 'u.editable=')]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<!-- Check airplane link -->
<tr>
......
......@@ -415,17 +415,8 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
<tr>
<td>waitForElementPresent</td>
......
......@@ -68,41 +68,13 @@
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Views' and contains(@href, '#!change') and contains(@href, 'n.page=tab')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_tab.html']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Viewable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='View' and contains(@href, '#!change') and contains(@href, 'u.page=') and contains(@href, 'u.editable=')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view.html']</td>
......@@ -132,16 +104,19 @@
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td>
<td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td>
<td></td>
</tr>
<!-- Editable is sticky, and the view should stay non editble in this case -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Foo: Title 1' and contains(@href, '#!history_previous')]</td>
......
......@@ -64,41 +64,13 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n = 'Editable' and text() = 'bianxue']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[@data-i18n = 'Editable' and text() = 'bianxue']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[text() = 'lishi']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n = 'Editable' and text() = 'bianxue']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n = 'Viewable' and text() = 'shitujiemian']</td>
<td>//h3[text() = 'shitu']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[@data-i18n = 'Viewable' and text() = 'shitujiemian']</td>
<td>//h3[text() = 'shitu']</td>
<td></td>
</tr>
......
......@@ -74,6 +74,12 @@
</tr>
<tr>
<td>verifyText</td>
<td>//div[@data-gadget-scope="erp5_checkbox"]//label</td>
<td>bianxue</td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -157,8 +157,8 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_listbox"]</td>
<td>waitForTextPresent</td>
<td>2 Records</td>
<td></td>
</tr>
......@@ -187,28 +187,25 @@
<td>deleted</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@class="ui-link"]</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>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_list.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_view.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_view.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td></td>
</tr>
......@@ -218,17 +215,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tr>
<td>waitForElementPresent</td>
......@@ -244,28 +231,24 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_view.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_view.html')]//div[@data-gadget-scope="field_listbox"]//a[@class="ui-link"]</td>
<td></td>
</tr>
......@@ -275,17 +258,7 @@
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tr>
<td>waitForElementPresent</td>
......@@ -301,19 +274,12 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Previous"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>No records</td>
......@@ -326,13 +292,6 @@
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete' and contains(@class, 'ui-disabled')]</td>
......
......@@ -42,7 +42,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPageTabSwitchMode</string> </value>
<value> <string>testPanelEditableButton</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
......
......@@ -11,19 +11,6 @@
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize -->
<tr>
<td>open</td>
......@@ -45,96 +32,50 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Add"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>link=Add</td>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_my_title']//input</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()='Foo Line: 1']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="INPUT"]</td>
<td>verifyElementNotPresent</td>
<td>//div[@data-gadget-scope='field_my_title']//p</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
<tr>
<td>click</td>
<td>//a[@data-i18n="Views"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Viewable"]</td>
<td>waitForElementNotPresent</td>
<td>//div[@data-gadget-scope='field_my_title']//input</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Viewable"]</td>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='field_my_title']//p</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_non_editable_mode" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="header"]//a[@data-i18n="Editable"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@role="main"]//a[@data-i18n="View"]</td>
<td>//div[@data-gadget-scope='field_my_title']//input</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@role="main"]//a[@data-i18n="View"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td>verifyElementNotPresent</td>
<td>//div[@data-gadget-scope="INPUT"]</td>
<td>//div[@data-gadget-scope='field_my_title']//p</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/verify_is_editable_mode" />
</tbody></table>
......
......@@ -219,4 +219,33 @@
</tr>
</tal:block>
<tal:block metal:define-macro="toggle_editable_mode">
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//div[contains(@data-gadget-url, 'gadget_erp5_field_multicheckbox.html')]//label</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//div[contains(@data-gadget-url, 'gadget_erp5_field_multicheckbox.html')]//label</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="verify_is_non_editable_mode">
<tr>
<td>assertNotChecked</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//div[contains(@data-gadget-url, 'gadget_erp5_field_multicheckbox.html')]//input</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="verify_is_editable_mode">
<tr>
<td>assertChecked</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//div[contains(@data-gadget-url, 'gadget_erp5_field_multicheckbox.html')]//input</td>
<td></td>
</tr>
</tal:block>
</tal:block>
\ No newline at end of file
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