Skip to content
Snippets Groups Projects
Commit 3d0b823d authored by Sascha Herzinger's avatar Sascha Herzinger Committed by Piotr Gawron
Browse files

Added legacy dialog for non reportable errors

parent 357e14ae
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!589Feature error reporting
...@@ -296,7 +296,23 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { ...@@ -296,7 +296,23 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) {
var errorData = self.getErrorMessageForError(error); var errorData = self.getErrorMessageForError(error);
if (!errorData.showReport) { if (!errorData.showReport) {
// legacy dialog (no report)
self._errorDialog = document.createElement("div");
self._errorDialogContent = document.createElement("div");
self._errorDialog.appendChild(self._errorDialogContent);
document.body.appendChild(self._errorDialog);
$(self._errorDialog).dialog({
classes: {
"ui-dialog": "ui-state-error"
},
modal: true,
title: "ERROR",
close: function() {
$(this).dialog('destroy').remove();
}
}).siblings('.ui-dialog-titlebar').css("background", "red");
self._errorDialogContent.innerHTML = errorData.message;
$(self._errorDialog).dialog("open");
} else { } else {
self._errorDialog = document.createElement('div'); self._errorDialog = document.createElement('div');
self._errorDialog.innerHTML = '<span class="ui-icon ui-icon-info" style="float: right;" title="The error message. This might not be human readable. If this issue persists you should should contact your administrator."></span>' + self._errorDialog.innerHTML = '<span class="ui-icon ui-icon-info" style="float: right;" title="The error message. This might not be human readable. If this issue persists you should should contact your administrator."></span>' +
...@@ -338,6 +354,9 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { ...@@ -338,6 +354,9 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) {
height: 'auto', height: 'auto',
width: '500px', width: '500px',
modal: true, modal: true,
close: function() {
$(this).dialog('destroy').remove();
},
buttons: { buttons: {
'Submit': function () { 'Submit': function () {
var report = { var report = {
...@@ -351,10 +370,10 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { ...@@ -351,10 +370,10 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) {
} }
}); });
ServerConnector.submitErrorToMinervaNet(report); ServerConnector.submitErrorToMinervaNet(report);
$(this).dialog('destroy').remove(); $(this).dialog('close');
}, },
'Cancel': function () { 'Cancel': function () {
$(this).dialog('destroy').remove(); $(this).dialog('close');
} }
} }
}).dialog("open"); }).dialog("open");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment