Skip to content

Commit

Permalink
Move UI-WELCOME_ERROR from a script insertion to a hidden <div>
Browse files Browse the repository at this point in the history
* store the error message in an extra div for later retrieval

Fixes: #10580
  • Loading branch information
srl295 committed Feb 21, 2018
1 parent 366f474 commit 246e7b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ui/ui_render/bootstrap/template.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ window.onload = function () {
// make subsequent calls to failure() noop
failure = function () {};

// Pull failure text from HTML to ensure proper escaping
var failureText = document.getElementById('kibanaLoader__error').innerText;
var err = document.createElement('h1');
err.style['color'] = 'white';
err.style['font-family'] = 'monospace';
err.style['text-align'] = 'center';
err.style['background'] = '#F44336';
err.style['padding'] = '25px';
err.innerText = '{{i18n 'UI-WELCOME_ERROR'}}';
err.innerText = failureText;

document.body.innerHTML = err.outerHTML;
}
Expand Down
6 changes: 6 additions & 0 deletions src/ui/ui_render/views/ui_app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ block content
animation: rotation .75s .5s infinite linear, fadeIn 1s .5s ease-in-out forwards;
}

#kibanaLoader__error {
display: none;
}

.kibanaWelcomeLogoCircle {
position: absolute;
left: 4px;
Expand Down Expand Up @@ -109,5 +113,7 @@ block content
.kibanaWelcomeLogo
.kibanaWelcomeText
| #{i18n('UI-WELCOME_MESSAGE')}
#kibanaLoader__error
| #{i18n('UI-WELCOME_ERROR')}

script(src='#{bundlePath}/app/#{app.getId()}/bootstrap.js')

0 comments on commit 246e7b9

Please sign in to comment.