Better install view error handling (#1472)

If linking fails because an http request didn't connect, show a message and
allow the user to start over.

// FREEBIE
pull/749/head
Lilia 8 years ago committed by Scott Nonnenberg
parent e6c7ebcaf9
commit f698d0bc51
No known key found for this signature in database
GPG Key ID: A4931C09644C654B

@ -731,6 +731,14 @@
</div> </div>
</div> </div>
</div> </div>
<div id='stepNetworkError' class='step hidden'>
<div class='inner error-dialog clearfix'>
<div class='panel step-body'>{{ installConnectionFailed }}</div>
<button class='ok step3 button'>{{ tryAgain }}</button>
<div class='nav'>
</div>
</div>
</div>
</script> </script>
<script type='text/x-tmpl-mustache' id='standalone'> <script type='text/x-tmpl-mustache' id='standalone'>

@ -11,6 +11,7 @@
ENTER_NAME: 4, ENTER_NAME: 4,
PROGRESS_BAR: 5, PROGRESS_BAR: 5,
TOO_MANY_DEVICES: 'TooManyDevices', TOO_MANY_DEVICES: 'TooManyDevices',
NETWORK_ERROR: 'NetworkError',
}; };
Whisper.InstallView = Whisper.View.extend({ Whisper.InstallView = Whisper.View.extend({
@ -31,7 +32,9 @@
installComputerName: i18n('installComputerName'), installComputerName: i18n('installComputerName'),
installFinalButton: i18n('installFinalButton'), installFinalButton: i18n('installFinalButton'),
installTooManyDevices: i18n('installTooManyDevices'), installTooManyDevices: i18n('installTooManyDevices'),
installConnectionFailed: i18n('installConnectionFailed'),
ok: i18n('ok'), ok: i18n('ok'),
tryAgain: i18n('tryAgain'),
development: window.config.environment === 'development' development: window.config.environment === 'development'
}; };
}, },
@ -74,10 +77,13 @@
if (this.canceled) { if (this.canceled) {
return; return;
} }
console.log('provisioning failed', e.stack);
if (e.message === 'websocket closed') { if (e.message === 'websocket closed') {
this.showConnectionError(); this.showConnectionError();
this.trigger('disconnected'); this.trigger('disconnected');
} else if (e.name === 'HTTPError' && e.code == -1) {
this.selectStep(Steps.NETWORK_ERROR);
} else if (e.name === 'HTTPError' && e.code == 411) { } else if (e.name === 'HTTPError' && e.code == 411) {
this.showTooManyDevices(); this.showTooManyDevices();
} else { } else {

@ -3521,12 +3521,12 @@ li.entry .error-icon-container {
max-width: 100%; } max-width: 100%; }
.install ul.country-list { .install ul.country-list {
min-width: 197px !important; } min-width: 197px !important; }
.install .confirmation-dialog, .install .progress-dialog, .install .error-dialog { .install .confirmation-dialog, .install .progress-dialog {
padding: 1em; padding: 1em;
text-align: left; } text-align: left; }
.install .number { .install .number {
text-align: center; } text-align: center; }
.install .confirmation-dialog button, .install .error-dialog button { .install .confirmation-dialog button {
float: right; float: right;
margin-left: 10px; } margin-left: 10px; }
.install .progress-dialog { .install .progress-dialog {
@ -3546,8 +3546,6 @@ li.entry .error-icon-container {
height: 100%; height: 100%;
background-color: #a2d2f4; background-color: #a2d2f4;
transition: width 0.25s; } transition: width 0.25s; }
.install .error-dialog {
display: none; }
.install .modal-container { .install .modal-container {
display: none; display: none;
position: absolute; position: absolute;

@ -268,12 +268,12 @@
min-width: 197px !important; min-width: 197px !important;
} }
.confirmation-dialog, .progress-dialog, .error-dialog { .confirmation-dialog, .progress-dialog {
padding: 1em; padding: 1em;
text-align: left; text-align: left;
} }
.number { text-align: center; } .number { text-align: center; }
.confirmation-dialog, .error-dialog { .confirmation-dialog {
button { button {
float: right; float: right;
margin-left: 10px; margin-left: 10px;
@ -303,9 +303,6 @@
} }
} }
} }
.error-dialog {
display: none;
}
.modal-container { .modal-container {
display: none; display: none;

Loading…
Cancel
Save