Commit ddab98f9 authored by Roque's avatar Roque Committed by Roque

erp5_officejs: minor refactoring and fixes on new officejs approach

- redirect to sync when app version changes
- fix configuration searchable fields in list form
- fix codemirror editor gadgetField
- fix exception catch in action script
- handle jio not found error for document
parent 33a1d714
/*global document, window, rJS, RSVP */
/*global document, window, rJS, RSVP, jIO, console */
/*jslint nomen: true, indent: 2, maxerr: 10, maxlen: 80 */
(function (document, window, rJS, RSVP) {
(function (document, window, rJS, RSVP, jIO, console) {
"use strict";
rJS(window)
......@@ -34,11 +34,11 @@
return gadget.getSetting("migration_version")
.push(function (migration_version) {
if (migration_version !== current_version) {
//if app version has changed, force storage sync
//if app version has changed, force storage selection
return gadget.redirect({
'command': 'display',
'options': {
'page': 'ojs_sync',
'page': 'ojs_configurator',
'auto_repair': true
}
});
......@@ -90,6 +90,17 @@
form_type: form_definition.form_type,
view: options.view || app_view
});
}, function (error) {
// jio not found error
if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 404)) {
console.log(error);
return gadget.notifySubmitted({
message: error.message + ". Maybe syncronize?",
status: "error"
});
}
throw error;
});
})
......@@ -153,4 +164,4 @@
});
});
}(document, window, rJS, RSVP));
\ No newline at end of file
}(document, window, rJS, RSVP, jIO, console));
\ No newline at end of file
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.36723.12245.1757</string> </value>
<value> <string>978.57300.17773.6331</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1568969561.34</float>
<float>1570117898.93</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -224,8 +224,8 @@
<value>
<list>
<tuple>
<string>{"editor": "codemirror", "maximize": true}</string>
<string>{"editor": "codemirror", "maximize": true}</string>
<string>{"editor": "codemirror", "maximize": true, "portal_type": "Web Script"}</string>
<string>{"editor": "codemirror", "maximize": true, "portal_type": "Web Script"}</string>
</tuple>
</list>
</value>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -215,28 +215,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -293,6 +272,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -142,7 +142,7 @@ try:
appcache_manifest.setTextContent(appcache_content)
except Exception as e:
except (ValueError, KeyError, SyntaxError) as e:
if batch_mode:
return 'ERROR: ' + str(e)
return context.Base_redirect('view', keep_items=dict(portal_status_message='ERROR creating configuration manifest: ' + str(e)))
......
......@@ -215,28 +215,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -293,6 +272,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
......@@ -211,28 +211,7 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -285,6 +264,26 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
......
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