Commit e0daa3ea authored by Roque's avatar 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 85bb91dd
/*global document, window, rJS, RSVP */ /*global document, window, rJS, RSVP, jIO, console */
/*jslint nomen: true, indent: 2, maxerr: 10, maxlen: 80 */ /*jslint nomen: true, indent: 2, maxerr: 10, maxlen: 80 */
(function (document, window, rJS, RSVP) { (function (document, window, rJS, RSVP, jIO, console) {
"use strict"; "use strict";
rJS(window) rJS(window)
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
return gadget.getSetting("migration_version") return gadget.getSetting("migration_version")
.push(function (migration_version) { .push(function (migration_version) {
if (migration_version !== current_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({ return gadget.redirect({
'command': 'display', 'command': 'display',
'options': { 'options': {
'page': 'ojs_sync', 'page': 'ojs_configurator',
'auto_repair': true 'auto_repair': true
} }
}); });
...@@ -90,6 +90,17 @@ ...@@ -90,6 +90,17 @@
form_type: form_definition.form_type, form_type: form_definition.form_type,
view: options.view || app_view 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 @@ ...@@ -153,4 +164,4 @@
}); });
}); });
}(document, window, rJS, RSVP)); }(document, window, rJS, RSVP, jIO, console));
\ No newline at end of file \ No newline at end of file
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>978.36723.12245.1757</string> </value> <value> <string>978.57300.17773.6331</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1568969561.34</float> <float>1570117898.93</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -224,8 +224,8 @@ ...@@ -224,8 +224,8 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>{"editor": "codemirror", "maximize": true}</string> <string>{"editor": "codemirror", "maximize": true, "portal_type": "Web Script"}</string>
<string>{"editor": "codemirror", "maximize": true}</string> <string>{"editor": "codemirror", "maximize": true, "portal_type": "Web Script"}</string>
</tuple> </tuple>
</list> </list>
</value> </value>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -215,28 +215,7 @@ ...@@ -215,28 +215,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -293,6 +272,26 @@ ...@@ -293,6 +272,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -142,7 +142,7 @@ try: ...@@ -142,7 +142,7 @@ try:
appcache_manifest.setTextContent(appcache_content) appcache_manifest.setTextContent(appcache_content)
except Exception as e: except (ValueError, KeyError, SyntaxError) as e:
if batch_mode: if batch_mode:
return 'ERROR: ' + str(e) return 'ERROR: ' + str(e)
return context.Base_redirect('view', keep_items=dict(portal_status_message='ERROR creating configuration manifest: ' + str(e))) return context.Base_redirect('view', keep_items=dict(portal_status_message='ERROR creating configuration manifest: ' + str(e)))
......
...@@ -215,28 +215,7 @@ ...@@ -215,28 +215,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -293,6 +272,26 @@ ...@@ -293,6 +272,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </item>
......
...@@ -211,28 +211,7 @@ ...@@ -211,28 +211,7 @@
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
<list> <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>
</value> </value>
</item> </item>
<item> <item>
...@@ -285,6 +264,26 @@ ...@@ -285,6 +264,26 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </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> </list>
</value> </value>
</item> </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