[state] disable saving to sessionStorage by default

Rather than enable a behavior we would rather not keep by default, we'll keep it opt-in and link to it so that users who have issues can find the setting
This commit is contained in:
spalger 2016-09-06 17:06:17 -07:00
parent bf35d8aa1b
commit 458630d49c
3 changed files with 17 additions and 6 deletions

View file

@ -5,7 +5,7 @@ import modules from 'ui/modules';
import Notifier from 'ui/notify/notifier';
import { UrlOverflowServiceProvider } from '../../error_url_overflow';
const URL_LIMIT_WARN_WITHIN = 150;
const URL_LIMIT_WARN_WITHIN = 1000;
module.exports = function (chrome, internals) {
@ -57,10 +57,20 @@ module.exports = function (chrome, internals) {
try {
if (urlOverflow.check($location.absUrl()) <= URL_LIMIT_WARN_WITHIN) {
notify.warning(`
The URL has gotten big and may cause Kibana
to stop working. Please simplify the data on screen.
`);
notify.directive({
template: `
<p>
The URL has gotten big and may cause Kibana
to stop working. Please either enable the
<code>state:storeInSessionStorage</code>
option in the <a href="#/management/kibana/settings">advanced
settings</a> or simplify the onscreen visuals.
</p>
`
}, {
type: 'error',
actions: [{ text: 'close' }]
});
}
} catch (e) {
const { host, path, search, protocol } = parseUrl(window.location.href);

View file

@ -9,6 +9,7 @@
<h3>Ok, how do I fix this?</h3>
<p>This usually only happens with big, complex dashboards, so you have some options:</p>
<ol>
<li>Enable the <code>state:storeInSessionStorage</code> option in the <a href="#/management/kibana/settings">advanced settings</a>. This will prevent the URLs from getting long, but makes them a bit less portable.</li>
<li>Remove some stuff from your dashboard. This will reduce the length of the URL and keep IE in a good place.</li>
<li>Don't use IE. Every other supported browser we know of doesn't have this limit.</li>
</ol>

View file

@ -283,7 +283,7 @@ export default function defaultSettingsProvider() {
description: 'Your API key from www.quandl.com'
},
'state:storeInSessionStorage': {
value: true,
value: false,
description: 'The URL can sometimes grow to be too large for some browsers to ' +
'handle. To counter-act this we are testing if storing parts of the URL in ' +
'sessions storage could help. Please let us know how it goes!'