Commit 7ba249f0 authored by Vincent Bechu's avatar Vincent Bechu

[OfficeJS] Remove editable and links Properties/Content from views

OfficeJS bt5: erp5_officejs, erp5_officejs_jquery_app, erp5_officejs_ooffice, erp5_officejs_ui_test
parent bcad1a71
......@@ -56,8 +56,7 @@
return gadget.changeState({
jio_key: options.jio_key,
doc: result,
child_gadget_url: child_gadget_url,
editable: options.editable
child_gadget_url: child_gadget_url
});
});
})
......@@ -76,8 +75,7 @@
.push(function (form_gadget) {
return form_gadget.render({
jio_key: gadget.state.jio_key,
doc: gadget.state.doc,
editable: gadget.state.editable
doc: gadget.state.doc
});
});
});
......
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.47399.35230.56951</string> </value>
<value> <string>964.45561.47559.9591</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -245,7 +245,7 @@
</tuple>
<state>
<tuple>
<float>1508165120.02</float>
<float>1515602403.02</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -122,13 +122,6 @@
});
})
.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();
......@@ -157,28 +150,6 @@
.push(function (result) {
context.element.querySelector("ul").innerHTML = result;
// Update the checkbox field value
return RSVP.all([
context.getDeclaredGadget("erp5_checkbox"),
context.translate("Edit Content")
]);
})
.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
}});
});
}
......
......@@ -213,7 +213,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.6228.20782.273</string> </value>
<value> <string>964.45954.1063.61457</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -245,7 +245,7 @@
</tuple>
<state>
<tuple>
<float>1501682796.44</float>
<float>1515509961.05</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -36,9 +36,6 @@
</form>
<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>
......
......@@ -217,7 +217,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.7872.48022.62771</string> </value>
<value> <string>964.45561.47559.9591</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1501601900.29</float>
<float>1515509919.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -23,8 +23,7 @@
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0
doc: options.doc
});
})
......@@ -38,12 +37,6 @@
return form_gadget.getContent();
})
.push(function (content) {
if (gadget.state.editable) {
return jIO.util.dataURItoBlob(content)
.push(function (blob) {
return gadget.jio_putAttachment(gadget.state.doc.jio_key, "data", blob);
});
}
return gadget.updateDocument(content);
})
.push(function () {
......@@ -78,7 +71,6 @@
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
var editable = gadget.state.editable;
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -88,9 +80,9 @@
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -99,9 +91,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -110,9 +102,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -121,9 +113,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -132,19 +124,19 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": data,
"css_class": editable === 1 ? "content-iframe-maximize" : "",
"css_class": "",
"required": 0,
"editable": editable,
"editable": 0,
"key": "text_content",
"hidden": 0,
"type": editable === 1 ? "GadgetField" : "EditorField",
"type": "GadgetField",
"url": "../officejs_pdf_viewer_gadget/app/",
"sandbox": "iframe"
}
......@@ -159,7 +151,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -171,24 +169,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP, jIO, Blob));
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.37367.12390.34440</string> </value>
<value> <string>964.47156.20414.37922</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1507276424.45</float>
<float>1515582223.13</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -21,8 +21,7 @@
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0
doc: options.doc
});
})
......@@ -51,18 +50,18 @@
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
var editable = gadget.state.editable;
return form_gadget.render({
erp5_document: {"_embedded": {"_view": {
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -71,9 +70,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -82,9 +81,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -93,9 +92,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -104,19 +103,19 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.doc.text_content,
"css_class": editable === 1 ? "content-iframe-maximize" : "",
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable === 1 ? "GadgetField" : "EditorField",
"type": "GadgetField",
"url": "../officejs_svg_editor_gadget/" +
"app/method-draw/method-draw.gadget.html",
"sandbox": "iframe"
......@@ -127,11 +126,18 @@
// form_list display portal_type in header
name: ""
}
}},
}
},
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -143,24 +149,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP));
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.3430.40377.1177</string> </value>
<value> <string>964.45561.47559.9591</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1510310205.61</float>
<float>1515588571.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -131,7 +131,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.45581.43675.37307</string> </value>
<value> <string>964.45862.32132.53930</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1515490519.85</float>
<float>1515509644.26</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -23,13 +23,12 @@
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0
doc: options.doc
});
})
.onEvent('submit', function () {
var gadget = this, doc;
var gadget = this, data;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
......@@ -38,17 +37,17 @@
return form_gadget.getContent();
})
.push(function (content) {
if (gadget.state.editable) {
return new RSVP.Queue()
.push(function () {
return jIO.util.dataURItoBlob(content.text_content);
})
.push(function (blob) {
return gadget.jio_putAttachment(gadget.state.jio_key, "data", blob);
});
}
data = content.text_content;
delete content.text_content;
return gadget.updateDocument(content);
})
.push(function () {
return gadget.jio_putAttachment(
gadget.state.jio_key,
"data",
jIO.util.dataURItoBlob(data)
);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
});
......@@ -76,7 +75,6 @@
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
var editable = gadget.state.editable;
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -86,9 +84,9 @@
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -97,9 +95,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -108,9 +106,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -119,9 +117,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -130,19 +128,19 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": editable ? data : data.blob,
"css_class": editable === 1 ? "content-iframe-maximize" : "",
"default": data,
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable === 1 ? "GadgetField" : "ImageField",
"type": "GadgetField",
"url": "../officejs_image_editor_gadget/app/",
"sandbox": "iframe"
}
......@@ -157,7 +155,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -169,24 +173,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP, jIO, Blob));
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.54506.51685.58146</string> </value>
<value> <string>964.47145.12565.62412</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508245149.26</float>
<float>1515581646.48</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -21,8 +21,7 @@
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0
doc: options.doc
});
})
......@@ -51,18 +50,18 @@
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
var editable = gadget.state.editable;
return form_gadget.render({
erp5_document: {"_embedded": {"_view": {
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -71,9 +70,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -82,9 +81,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -93,9 +92,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -104,19 +103,19 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.doc.text_content,
"css_class": editable === 1 ? "content-iframe-maximize" : "",
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable === 1 ? "GadgetField" : "EditorField",
"type": "GadgetField",
"url": "../officejs_web_table_editor_gadget/app/",
"sandbox": "iframe"
}
......@@ -126,11 +125,18 @@
// form_list display portal_type in header
name: ""
}
}},
}
},
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -142,24 +148,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP));
......@@ -227,7 +227,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.47399.35230.56951</string> </value>
<value> <string>964.45561.47559.9591</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -245,7 +245,7 @@
</tuple>
<state>
<tuple>
<float>1508245160.26</float>
<float>1515589222.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -23,14 +23,13 @@
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0,
content_editable: options.doc.content_type === undefined ||
options.doc.content_type.indexOf("application/x-asc") === 0
});
})
.onEvent('submit', function () {
var gadget = this, doc;
var gadget = this, data;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
......@@ -39,14 +38,18 @@
return form_gadget.getContent();
})
.push(function (content) {
if (gadget.state.editable) {
data = content.text_content;
delete content.text_content;
return gadget.updateDocument(content);
})
.push(function () {
if (gadget.state.content_editable) {
return gadget.jio_putAttachment(
gadget.state.jio_key,
"data",
jIO.util.dataURItoBlob(content.text_content)
jIO.util.dataURItoBlob(data)
);
}
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
......@@ -80,7 +83,7 @@
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
var editable = gadget.state.editable && gadget.state.content_editable;
var editable = gadget.state.content_editable;
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -90,9 +93,9 @@
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -101,9 +104,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -112,9 +115,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -123,9 +126,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -134,16 +137,16 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": ((gadget.state.editable || !gadget.state.content_editable) ? data : ""),
"css_class": editable ? "content-iframe-maximize" : "",
"default": data,
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable ? "GadgetField" : "EditorField",
......@@ -161,7 +164,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -173,26 +182,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.content_editable) {
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP, jIO, Blob));
\ No newline at end of file
......@@ -219,7 +219,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.55416.10226.28381</string> </value>
<value> <string>964.47368.60527.10205</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1512145557.5</float>
<float>1515594873.98</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -23,14 +23,13 @@
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0,
content_editable: options.doc.content_type === undefined ||
options.doc.content_type.indexOf("application/x-asc") === 0
});
})
.onEvent('submit', function () {
var gadget = this, doc;
var gadget = this, data;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
......@@ -39,14 +38,18 @@
return form_gadget.getContent();
})
.push(function (content) {
if (gadget.state.editable) {
data = content.text_content;
delete content.text_content;
return gadget.updateDocument(content);
})
.push(function () {
if (gadget.state.content_editable) {
return gadget.jio_putAttachment(
gadget.state.jio_key,
"data",
jIO.util.dataURItoBlob(content.text_content)
jIO.util.dataURItoBlob(data)
);
}
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
......@@ -80,7 +83,7 @@
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
var editable = gadget.state.editable && gadget.state.content_editable;
var editable = gadget.state.content_editable;
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -90,9 +93,9 @@
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -101,9 +104,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -112,9 +115,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -123,9 +126,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -134,16 +137,16 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.editable || !gadget.state.content_editable ? data: "",
"css_class": editable ? "content-iframe-maximize" : "",
"default": data,
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable ? "GadgetField" : "EditorField",
......@@ -161,7 +164,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -173,26 +182,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.content_editable) {
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP, jIO, Blob));
\ No newline at end of file
......@@ -219,7 +219,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.38374.35315.699</string> </value>
<value> <string>964.45947.24858.9318</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1512145431.3</float>
<float>1515594900.37</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -23,14 +23,13 @@
return this.changeState({
jio_key: options.jio_key,
doc: options.doc,
editable: options.editable ? 1 : 0,
content_editable: options.doc.content_type === undefined ||
options.doc.content_type.indexOf("application/x-asc") === 0
});
})
.onEvent('submit', function () {
var gadget = this, doc;
var gadget = this, data;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
......@@ -39,14 +38,18 @@
return form_gadget.getContent();
})
.push(function (content) {
if (gadget.state.editable) {
data = content.text_content;
delete content.text_content;
return gadget.updateDocument(content);
})
.push(function () {
if (gadget.state.content_editable) {
return gadget.jio_putAttachment(
gadget.state.jio_key,
"data",
jIO.util.dataURItoBlob(content.text_content)
jIO.util.dataURItoBlob(data)
);
}
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
......@@ -80,7 +83,7 @@
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
var editable = gadget.state.editable && gadget.state.content_editable;
var editable = gadget.state.content_editable;
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -90,9 +93,9 @@
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1 - editable,
"editable": 1,
"key": "title",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_reference": {
......@@ -101,9 +104,9 @@
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "reference",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_version": {
......@@ -112,9 +115,9 @@
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "version",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_language": {
......@@ -123,9 +126,9 @@
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "language",
"hidden": editable,
"hidden": 0,
"type": "StringField"
},
"my_description": {
......@@ -134,16 +137,16 @@
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1 - editable,
"editable": 1,
"key": "description",
"hidden": editable,
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.editable || !gadget.state.content_editable ? data: "",
"css_class": editable ? "content-iframe-maximize" : "",
"default": data,
"css_class": "",
"required": 0,
"editable": editable,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": editable ? "GadgetField" : "EditorField",
......@@ -161,7 +164,13 @@
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"], ["my_version"], ["my_language"], ["my_description"]]
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
......@@ -173,26 +182,17 @@
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: "change", options: {editable: true}})
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
var header_dict = {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
save_action: true
};
if (gadget.state.content_editable) {
if (gadget.state.editable) {
header_dict.edit_properties = url_list[3].replace("n.editable=true", "").replace("p.editable=true", "");
} else {
header_dict.edit_content = url_list[3];
}
}
return gadget.updateHeader(header_dict);
});
});
});
}(window, rJS, RSVP, jIO, Blob));
\ No newline at end of file
......@@ -219,7 +219,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.38374.35315.699</string> </value>
<value> <string>964.45947.24858.9318</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1512145404.19</float>
<float>1515594907.58</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -56,7 +56,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
......@@ -87,37 +87,37 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
......@@ -175,6 +175,17 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=canvas_front</td>
<td></td>
</tr>
<!-- Wait for editor completly loaded, this is workaround, wait for lock in renderjs -->
<tr>
<td>pause</td>
<td>2713</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -235,19 +246,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>identifier=canvas_front</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -53,6 +53,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -119,16 +125,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
......@@ -184,6 +180,7 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_presentation"/>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -244,24 +241,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=id_main</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -53,6 +53,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -119,16 +125,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
......@@ -149,6 +145,7 @@
<td>name=reference</td>
<td>reference</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_presentation"/>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -159,39 +156,3 @@
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=id_main</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n="Save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -53,6 +53,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -119,16 +125,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
......@@ -184,6 +180,7 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -244,24 +241,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=ws-canvas</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -46,6 +46,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -86,8 +92,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/choice_erp5_storage"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_content"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tr>
<td>click</td>
<td>//li[@data-label="Sheet2"]/a</td>
......@@ -103,8 +108,7 @@
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_content"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tr>
<td>click</td>
<td>//li[@data-label="Sheet2"]/a</td>
......
......@@ -19,11 +19,6 @@
<td tal:content="python: 'test.officejs.onlyoffice.spreadsheet.replication.xlsy.%s' % DateTime().strftime('%Y%m%d%H%M%S')">Titre</td>
<td>title</td>
</tr>
<tr>
<td>store</td>
<td>ooffice_spreadsheet</td>
<td>test_url</td>
</tr>
<!-- Initialize -->
<tr>
......@@ -89,7 +84,13 @@
<tr>
<td>open</td>
<td>${base_url}/web_site_module/${test_url}/</td>
<td>${base_url}/web_site_module/ooffice_spreadsheet/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>30000</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/choice_erp5_storage"/>
......@@ -97,8 +98,8 @@
<!--1-->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_content"/><!-- first time after open -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tal:block tal:define="check_value string:1;
set_value string:2">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOfficeCell/macros/current_cell" />
......@@ -108,7 +109,7 @@
<!-- XXX Romain -->
<!--tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_content"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tal:block tal:define="check_value string:2;
set_value string:2">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOfficeCell/macros/current_cell" />
......@@ -120,7 +121,7 @@
<!-- XXX Romain -->
<!--tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_content"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tal:block tal:define="check_value string:2;
set_value string:2">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOfficeCell/macros/current_cell" />
......@@ -132,7 +133,7 @@
<!--2-->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tal:block tal:define="check_value string:2;
set_value string:3">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOfficeCell/macros/current_cell" />
......
......@@ -53,6 +53,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -119,16 +125,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
......@@ -149,37 +145,8 @@
<td>name=reference</td>
<td>reference</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=ws-canvas</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load_spreadsheet"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_align_center"/>
<tr>
<td>click</td>
<td>//button[@data-i18n="Save"]</td>
......
......@@ -53,6 +53,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -119,19 +125,9 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
<td>Titre</td>
<td>title</td>
</tr>
<tr>
......@@ -184,6 +180,7 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -199,21 +196,7 @@
<td>//a[@data-i18n='Document']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=${title}</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=${title}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/open_document_with_title"/>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@title='Description']</td>
......@@ -244,24 +227,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=id_main</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -27,6 +27,12 @@
<td>${base_url}/web_site_module/ooffice_text/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>30000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -77,16 +83,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=title</td>
......@@ -122,6 +118,8 @@
<td>identifier=description</td>
<td>${description}</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<!-- Keep content empty, conversion still failed -->
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -132,61 +130,6 @@
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//canvas[@id='id_target_cursor']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@id='id-toolbar-btn-align-center']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Properties</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=title</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Document</td>
......
......@@ -53,6 +53,12 @@
<td>${base_url}/web_site_module/${test_url}/</td>
<td></td>
</tr>
<!-- Install can be longer than 90s -->
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Storages"]</td>
......@@ -119,16 +125,6 @@
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
......@@ -149,42 +145,8 @@
<td>name=reference</td>
<td>reference</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=id_main</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/wait_for_load"/>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOnlyOffice/macros/click_to_align_center"/>
<tr>
<td>click</td>
<td>//button[@data-i18n="Save"]</td>
......
......@@ -56,7 +56,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
......@@ -87,38 +87,38 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
......@@ -176,6 +176,11 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=viewerContainer</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -236,19 +241,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>identifier=viewerContainer</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -56,7 +56,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
......@@ -87,37 +87,37 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
......@@ -175,6 +175,17 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=workarea</td>
<td></td>
</tr>
<!-- Wait for editor completly loaded, this is workaround, wait for lock in renderjs -->
<tr>
<td>pause</td>
<td>2713</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -235,19 +246,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>identifier=workarea</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -56,7 +56,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
......@@ -87,37 +87,37 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Local is Enough</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td>link=Add</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=editable</td>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td>
</tr>
<tr>
......@@ -175,6 +175,17 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=jquery_sheet_gadget</td>
<td></td>
</tr>
<!-- Wait for editor completly loaded, this is workaround, wait for lock in renderjs -->
<tr>
<td>pause</td>
<td>2713</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Save']</td>
......@@ -235,19 +246,3 @@
<td>//textarea[@title='Description']</td>
<td>${description}</td>
</tr>
\ No newline at end of file
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
<!-- Stop Generic -->
<tr>
<td>waitForElementPresent</td>
<td>identifier=jquery_sheet_gadget</td>
<td></td>
</tr>
\ No newline at end of file
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="wait_for_load">
<tal:block metal:define-macro="wait_for_load_spreadsheet">
<!-- Wait for OnlyOffice run -->
<tr>
<td>waitForElementPresent</td>
......@@ -18,6 +18,42 @@
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="wait_for_load">
<!-- Wait for OnlyOffice run -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=id_viewer</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@id='id-toolbar-btn-align-center' and not(contains(@class, "disabled"))]</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="wait_for_load_presentation">
<!-- Wait for OnlyOffice run -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='asc-loadmask-title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=id_viewer</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@id='id-toolbar-btn-insertimage' and not(contains(@class, "disabled"))]</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="open_document_with_title">
<tr>
<td colspan="3"><b>Open Document</b></td>
......@@ -137,21 +173,6 @@
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="click_to_content">
<tr>
<td colspan="3"><b>Click to Content</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Content</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Content</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="synchronize">
<tr>
<td colspan="3"><b>Synchronize</b></td>
......
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