Commit e68be972 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Display ERP5 user preference

Language modification is done on another page, accessible from many places for now.
parent 999076b9
......@@ -24,6 +24,8 @@
data-i18n=Next
data-i18n=Loading
data-i18n=Fast Input
data-i18n=Language
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.11788.48702.26146</string> </value>
<value> <string>966.42886.30648.44305</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1517586466.87</float>
<string>UTC</string>
<float>1523261836.15</float>
<string>GMT+2</string>
</tuple>
</state>
</object>
......
......@@ -39,7 +39,8 @@
possible_right_link_list = [
['edit_url', 'Editable', 'pencil'],
['view_url', 'Viewable', 'eye'],
['right_url', 'New', 'plus']
['right_url', 'New', 'plus'],
['language_url', 'Language', 'flag']
],
possible_right_button_list = [
['save_action', 'Save', 'check', 'submit'],
......@@ -191,9 +192,14 @@
// Handle right link
for (i = 0; i < possible_right_link_list.length; i += 1) {
if (options.hasOwnProperty(possible_right_link_list[i][0])) {
klass = "";
if (options.extra_class &&
options.extra_class.hasOwnProperty(possible_right_link_list[i][0])) {
klass = options.extra_class[possible_right_link_list[i][0]];
} else {
klass = "";
}
if (!options[possible_right_link_list[i][0]]) {
klass = "ui-disabled";
klass += " ui-disabled";
}
state.right_link_title = possible_right_link_list[i][1];
state.right_link_icon = possible_right_link_list[i][2];
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>967.34935.2317.153</string> </value>
<value> <string>968.41228.46964.12441</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1526656854.64</float>
<float>1530711582.16</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -56,7 +56,12 @@
}
return queue
.push(function (result) {
var url_for_parameter_list = [{command: 'display'}],
var url_for_parameter_list = [
// Back url
{command: 'display'},
// Change language
{command: 'display', options: {page: 'language'}}
],
i;
row_list = result.data.rows;
for (i = 0; i < row_list.length; i += 1) {
......@@ -72,11 +77,11 @@
document_list = [],
document_dict = {};
for (i = 1; i < url_list.length; i += 1) {
document_dict[row_list[i - 1].id] = {
for (i = 2; i < url_list.length; i += 1) {
document_dict[row_list[i - 2].id] = {
link: url_list[i],
title: (row_list[i - 1].value.title || row_list[i - 1].id) +
" (" + row_list[i - 1].value.translated_portal_type + ")"
title: (row_list[i - 2].value.title || row_list[i - 2].id) +
" (" + row_list[i - 2].value.translated_portal_type + ")"
};
}
// Sort by access time
......@@ -91,7 +96,8 @@
return gadget.updateHeader({
page_title: 'History',
page_icon: 'history',
front_url: url_list[0]
front_url: url_list[0],
language_url: url_list[1]
});
});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.41630.8511.54391</string> </value>
<value> <string>968.41630.47523.21913</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1530547123.46</float>
<float>1530547227.39</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -45,8 +45,12 @@
// Calculate all URLs
.push(function (links) {
var query_string,
// Back URL
url_for_parameter_list = [{command: 'display'}],
url_for_parameter_list = [
// Back URL
{command: 'display'},
// Change language URL
{command: 'display', options: {page: 'language'}}
],
display_options,
i;
action_list = links.worklist;
......@@ -81,12 +85,12 @@
var line_list = [],
url_list = result_list[1],
i;
for (i = 1; i < url_list.length; i += 1) {
for (i = 2; i < url_list.length; i += 1) {
line_list.push({
link: url_list[i],
// Remove the counter from the title
title: action_list[i - 1].name,
count: action_list[i - 1].count
title: action_list[i - 2].name,
count: action_list[i - 2].count
});
}
......@@ -98,7 +102,8 @@
return gadget.updateHeader({
page_title: 'Worklist',
page_icon: 'tasks',
front_url: url_list[0]
front_url: url_list[0],
language_url: url_list[1]
});
});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.41441.46653.47513</string> </value>
<value> <string>968.41449.40135.358</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1530535868.66</float>
<float>1530537970.6</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -65,6 +65,8 @@
}
// Add global url calculation
url_dict_list.push({command: 'display'});
// Add change language url calculation
url_dict_list.push({command: 'display', options: {page: 'language'}});
return RSVP.all([
document_list,
gadget.translate('Others'),
......@@ -123,7 +125,8 @@
return gadget.updateHeader({
page_title: 'Modules',
page_icon: 'puzzle-piece',
front_url: url_list[i]
front_url: url_list[i],
language_url: url_list[i + 1]
});
});
});
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.29995.27806.12578</string> </value>
<value> <string>968.41228.46964.12441</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1529942124.52</float>
<float>1530545112.7</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=User
data-i18n=Language
data-i18n=Update
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 Page Language</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script id="dialog-button-template" type="text/x-handlebars-template">
<input name="action_update" type="submit" value="{{button_text}}"></input>
</script>
<script src="gadget_erp5_page_language.js" type="text/javascript"></script>
</head>
<body>
<form class="preference">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="erp5_form"
data-gadget-sandbox="public">
</div>
<div class="dialog_button_container">
</div>
</form>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
dialog_button_source = gadget_klass.__template_element
.getElementById("dialog-button-template")
.innerHTML,
dialog_button_template = Handlebars.compile(dialog_button_source);
gadget_klass
.declareAcquiredMethod("getTranslationList", "getTranslationList")
.declareAcquiredMethod("getSettingList", "getSettingList")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("updateHeader", "updateHeader")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function () {
var gadget = this,
first_result_list;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getUrlForList([{command: 'display'}]),
gadget.getSettingList(['me', 'language_map', 'selected_language',
'default_selected_language']),
gadget.getDeclaredGadget("erp5_form"),
gadget.getTranslationList(['Language', 'User', 'Update'])
]);
})
.push(function (result_list) {
first_result_list = result_list;
var me = result_list[1][0];
if (me !== undefined) {
return gadget.jio_allDocs({
query: 'relative_url:"' + me + '"',
select_list: ['title']
});
}
})
.push(function (result) {
var user,
selected_language = first_result_list[1][2] ||
first_result_list[1][3],
key,
list_item = [],
options = JSON.parse(first_result_list[1][1]);
gadget.state.old_selected_lang = selected_language;
// Calculate user name
if (result === undefined) {
user = "Who are you?";
} else {
user = result.data.rows[0].value.title;
}
// Calculate possible language list
for (key in options) {
if (options.hasOwnProperty(key)) {
list_item.push([options[key], key]);
}
}
gadget.element.querySelector('.dialog_button_container')
.innerHTML = dialog_button_template({
button_text: first_result_list[3][2]
});
return RSVP.all([
gadget.updateHeader({
page_title: 'Language',
page_icon: 'flag',
front_url: first_result_list[0][0]
}),
first_result_list[2].render({
erp5_document: {"_embedded": {"_view": {
'User': {
"default": user,
"editable": 0,
"key": "field_user",
"title": first_result_list[3][1],
"type": "StringField"
},
'Language': {
"default": selected_language,
"editable": 1,
"items": list_item,
"key": "field_language",
"title": first_result_list[3][0],
"type": "ListField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["User"], ["Language"]]
]]
}
})
]);
});
})
.onEvent('submit', function () {
var gadget = this,
selected_lang;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget("erp5_form");
})
.push(function (erp5_form) {
return erp5_form.getContent();
})
.push(function (data) {
selected_lang = data.field_language;
return gadget.setSetting("selected_language", selected_lang);
})
.push(function () {
if (gadget.state.old_selected_lang !== selected_lang) {
return gadget.redirect({
command: 'change_language',
options: {
language: selected_lang
}
});
}
return gadget.notifySubmitted();
});
});
}(window, rJS, RSVP, Handlebars));
......@@ -16,6 +16,7 @@
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("updateHeader", "updateHeader")
......@@ -26,12 +27,18 @@
.declareMethod("render", function () {
var gadget = this;
return gadget.getUrlFor({command: 'display'})
.push(function (front_url) {
return gadget.getUrlForList([
// Back url
{command: 'display'},
// Change language
{command: 'display', options: {page: 'language'}}
])
.push(function (url_list) {
return gadget.updateHeader({
page_title: 'Logout',
page_icon: 'power-off',
front_url: front_url
front_url: url_list[0],
language_url: url_list[1]
});
})
.push(function () {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.42610.16476.33962</string> </value>
<value> <string>968.42609.37775.47428</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1530607593.22</float>
<float>1530605895.04</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=User
data-i18n=Language
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
......@@ -20,13 +16,5 @@
</head>
<body>
<form class="preference">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="erp5_form"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.51162.4768.35123</string> </value>
<value> <string>966.31479.61249.44083</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,8 +252,8 @@
</tuple>
<state>
<tuple>
<float>1482760603.42</float>
<string>UTC</string>
<float>1522246564.53</float>
<string>GMT+2</string>
</tuple>
</state>
</object>
......
/*global window, rJS, RSVP */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
/*global window, rJS, URI */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, URI) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// handle acquisition
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareMethod("render", function () {
var gadget = this,
user = "Who are you?",
header_dict = {
page_title: 'Preferences',
page_icon: 'sliders',
save_action: true
};
return gadget.getUrlFor({command: 'display'})
.push(function (front_url) {
header_dict.front_url = front_url;
return gadget.updateHeader(header_dict);
})
.push(function () {
return gadget.getDeclaredGadget("erp5_form");
})
.push(function (erp5_form) {
gadget.state.erp5_form = erp5_form;
return gadget.getSetting('me');
})
.push(function (me) {
if (me !== undefined) {
return gadget.jio_allDocs({
query: 'relative_url:"' + me + '"',
select_list: ['title']
})
.push(function (result) {
user = result.data.rows[0].value.title;
});
var gadget = this;
return gadget.jio_getAttachment(
'portal_preferences',
'links'
)
.push(function (result) {
var jio_key;
if (result._links.active_preference === undefined) {
jio_key = 'portal_preferences';
} else {
jio_key = (new URI(result._links.active_preference
.href)).segment(2);
}
})
.push(function () {
return RSVP.all([
gadget.getSetting("language_map"),
gadget.getSetting("selected_language"),
gadget.getSetting("default_selected_language"),
gadget.translate("User"),
gadget.translate("Language")
]);
})
.push(function (results) {
var selected_language = results[1] || results[2],
key,
list_item = [],
options = JSON.parse(results[0]);
gadget.state.old_selected_lang = selected_language;
for (key in options) {
if (options.hasOwnProperty(key)) {
list_item.push([options[key], key]);
}
}
return gadget.state.erp5_form.render({
erp5_document: {"_embedded": {"_view": {
'User': {
"default": user,
"editable": 0,
"key": "field_user",
"title": results[3],
"type": "StringField"
},
'Language': {
"default": selected_language,
"editable": 1,
"items": list_item,
"key": "field_language",
"title": results[4],
"type": "ListField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["User"], ["Language"]]
]]
}
});
});
})
.declareMethod('triggerSubmit', function () {
this.element.querySelector('button').click();
})
.onEvent('submit', function () {
var gadget = this,
selected_lang;
return gadget.notifySubmitting()
.push(function () {
return gadget.state.erp5_form.getContent();
})
.push(function (data) {
selected_lang = data.field_language;
return gadget.setSetting("selected_language", selected_lang);
})
.push(function () {
if (gadget.state.old_selected_lang !== selected_lang) {
return gadget.redirect({
command: 'change_language',
options: {
language: selected_lang
}
});
}
return gadget.notifySubmitted();
return gadget.redirect({command: 'display',
options: {jio_key: jio_key}});
});
});
}(window, rJS, RSVP));
}(window, rJS, URI));
......@@ -99,7 +99,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Preference JS</string> </value>
<value> <string>Gadget ERP5 Page Preference JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.31910.8218.62941</string> </value>
<value> <string>968.44430.14790.1621</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1518599460.13</float>
<float>1530715104.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -128,7 +128,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='m']</td>
<td>//div[@role='main']</td>
<td></td>
</tr>
<!-- Check is minimize -->
......
......@@ -18,26 +18,31 @@
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForTextPresent</td>
<td>Active</td>
<td></td>
</tr>
<!-- Header has a link to the previous history entry -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_preference.html']</td>
<td>//div[@data-gadget-scope='header']//a[contains(@href, '#!history_previous')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Language</td>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[contains(@href, '#!history_previous')]</td>
<td></td>
</tr>
<!-- Header has a link to the previous history entry -->
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Preferences' and contains(@href, '#!display')]</td>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[contains(@href, '#!display')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='header']//a[text()='Preferences' and contains(@href, '#!display')]</td>
<td>//div[@data-gadget-scope='header']//a[contains(@href, '#!display')]</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>testPagePreferenceEdit</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 Form View Back Link</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test preference main link</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/?page=preference</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<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>//textarea[@name='field_my_description']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name='field_my_description']</td>
<td>test</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//a[text()='User Interface']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//a[text()='User Interface']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</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[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//a[text()='View']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//a[text()='View']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//textarea[@name='field_my_description']</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//textarea[@name='field_my_description']</td>
<td>test</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//a[text()='User Interface']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_panel.html')]//a[text()='User Interface']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tr>
<td>assertChecked</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -18,14 +18,9 @@
</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_preference.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Menu</td>
<td>Active</td>
<td></td>
</tr>
......
......@@ -42,7 +42,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testPagePreference</string> </value>
<value> <string>testPageLanguage</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
......
......@@ -16,7 +16,33 @@
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/wo/#/?page=preference</td>
<td>${base_url}/web_site_module/renderjs_runner/wo/#/?page=language</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//select[@id='field_language']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@id='field_language']</td>
<td></td>
</tr>
<!-- default has two language -->
<tr>
<td>assertElementPresent</td>
<td>//option[@data-i18n='Wolof']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//option[@data-i18n='English']</td>
<td></td>
</tr>
......@@ -41,11 +67,23 @@
</tr>
<tr>
<td colspan="3"><b>Submit the dialog</b></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_page_language.html')]//input[@type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_page_language.html')]//input[@type='submit']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
<tr>
<td>waitForTextPresent</td>
......@@ -103,20 +141,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="field_language"]/option[@selected='selected' and @data-i18n='English']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//select[@name="field_language"]</td>
......@@ -124,11 +154,22 @@
</tr>
<tr>
<td colspan="3"><b>Submit the dialog</b></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_page_language.html')]//input[@type='submit']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_page_language.html')]//input[@type='submit']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><p></p></td>
</tr>
<tr>
......
......@@ -22,7 +22,7 @@
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Language</td>
<td>Active</td>
<td></td>
</tr>
......@@ -86,7 +86,7 @@
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Language</td>
<td>Active</td>
<td></td>
</tr>
......
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