AppSuite:Debugging the UI: Difference between revisions

From Open-Xchange
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<div class="title">Debugging the UI</div>
The content on this page has moved to https://documentation.open-xchange.com/latest/ui/miscellaneous/debugging.html
'''Synopsis:''' A collection of hints to debug during UI development. See also [[AppSuite:UI FAQ]]. Sister page: [[AppSuite:Debugging_the_server|Debugging the server]].


__TOC__
Note: Open-Xchange is in the process of migrating all its technical documentation to a new and improved documentation system (documentation.open-xchange.com). Please note as the migration takes place more information will be available on the new system and less on this system. Thank you for your understanding during this period of transition.
 
== What capabilities are available? ==
<pre class="language-javascript">
_(ox.serverConfig.capabilities).pluck("id").sort();
</pre>
== Is a specific capability set? ==
<pre class="language-javascript">
require(['io.ox/core/capabilities'], function (cap) {
    console.log(cap.has('certain_cap'));
});
</pre>
 
== Which files failed to load? ==
<pre class="language-javascript">
requirejs.s.contexts._.registry
</pre>
 
== What portal widgets are available? ==
<pre class="language-javascript">
require(['io.ox/portal/widgets'], function (widgets) {
  console.log(widgets.getAvailablePlugins().sort());
});
</pre>
 
== Check settings ==
<pre class="language-javascript">
// check core settings
require('settings!io.ox/core').get();
// check mail settings
require('settings!io.ox/mail').get();
</pre>
 
== Clear all persistent caches ==
Please mind that this does not clear the regular browser cache! It clears localStorage, IndexedDB, and WebSQL.
<pre class="language-javascript">
ox.cache.clear();
</pre>
 
== Clear all portal widgets ==
Sometimes you manage to build a portal widgets that messes up all kinds of things when a user adds it. This is a rather blunt way of solving the problem:
 
<pre class="language-javascript">
require(['settings!io.ox/portal'], function(settings) {
settings.set('widgets/user', '').save();
});
</pre>
 
== Debug relogin ==
<pre class="language-javascript">
ox.autoLogoutRestartDebug();
</pre>
 
== Enable/disable capability via URL hash ==
Just add the parameter "cap" to URL hash. A leading minus disables a capability. Multiple capabilities separated by comma. Example:
<pre language="none">
...&cap=emoji,-calendar
</pre>
 
== Changes do not apply while developing ==
You did changes in your code and they don't simply don't apply?
There are several possibilites, you should check in order to find a solution.
 
* Reload AppSuite with cleared Browser Cache. Using Firefox on Linux-Distributions you can simply press <tt>Ctrl+F5</tt>. Please check the documentation of your Browser for Shortcuts and how to clear the cache.
* Disable Source Caching. Therefor add the parameter <tt>"debug-js=true"</tt> to URL hash. Example:
<pre language="none">...&debug-js=true</pre>
 
== Debug a specific folder ==
If you want to get details of a specific folder, just inspect it via dev tools and look for data-obj-id="...". Copy the id and run the following in console:
<pre class="language-javascript">
void require('io.ox/core/api/folder').get({ folder: 'default0/INBOX' }).always(_.inspect);
</pre>
 
== Finding the version ==
If you want to the backend and the frontend version with revision numbers, specifically when you simply cannot find it from the WebUI's About button as some customer hides it, then you can use the following command:
<pre class="language-javascript">
"Server version: " + ox.serverConfig.serverVersion + ", UI version: " + ox.version
</pre>
 
[[Category:AppSuite]]
[[Category:UI]]
[[Category:Developer]]

Latest revision as of 10:02, 22 May 2017

The content on this page has moved to https://documentation.open-xchange.com/latest/ui/miscellaneous/debugging.html

Note: Open-Xchange is in the process of migrating all its technical documentation to a new and improved documentation system (documentation.open-xchange.com). Please note as the migration takes place more information will be available on the new system and less on this system. Thank you for your understanding during this period of transition.