Commit 13f599e5 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '738-minervanet-error-report-39-failed-to-fetch' into 'master'

Resolve "MINERVANET - Error Report #39 - Failed to fetch"

Closes #738

See merge request !1297
parents 37ad0306 e6ae3784
Pipeline #40159 failed with stage
in 32 minutes and 18 seconds
......@@ -9,6 +9,8 @@ minerva (16.0.0~alpha.2) stable; urgency=medium
* Small improvement: information about dimer in sbgn is provided only once
if the information is duplicated in sbgn data (#1358)
* Small improvement: glyph quality is improved (#1458)
* Small improvement: "Failed to fetch" errors are reported in a way that suggest
retrying before submitting error report (#738)
* Bug fix: arrows without a "process" box had an irregular empty space in
their lines (#1471)
......
This diff is collapsed.
......@@ -14,6 +14,7 @@ var Functions = require('./Functions');
var ObjectWithListeners = require('./ObjectWithListeners');
var SecurityError = require('./SecurityError');
var ValidationError = require('./ValidationError');
var ConfigurationType = require('./ConfigurationType');
/**
......@@ -106,7 +107,21 @@ GuiConnector.prototype.init = function () {
return $('input', td).val();
});
}
};
/**
*
* @type {Configuration}
* @private
*/
self._configuration = null;
if (ServerConnector !== undefined) {
return ServerConnector.getConfiguration().then(function (configuration) {
self._configuration = configuration;
});
} else {
return Promise.resolve();
}
}
var newUrl = "";
......@@ -228,7 +243,20 @@ GuiConnector.prototype.hideProcessing = function () {
$(self._processingDialog).dialog("close");
};
/**
*
* @param {string} title
* @param {string} content
*/
GuiConnector.prototype.showErrorDialog = function (title, content) {
console.log(this._configuration);
if (this._configuration !== undefined && this._configuration !== null) {
var option = this._configuration.getOption(ConfigurationType.REQUEST_ACCOUNT_EMAIL);
if (option !== null && option !== undefined) {
var email = option.getValue();
content = content.replace("system administrator", "<a href = 'mailto:" + email + "'>system administrator</a>");
}
}
var dialog = document.createElement('div');
dialog.title = title;
var dialogBody = document.createElement('p');
......@@ -334,7 +362,7 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) {
$('#report-stacktrace')
.accordion({active: false, collapsible: true});
$('.report-check')
// .checkboxradio()
// .checkboxradio()
.prop('checked', true);
// .button('refresh');
// $(self._errorDialogData)
......@@ -417,6 +445,11 @@ GuiConnector.prototype.getErrorMessageForError = function (error) {
errorData.message += "<p>Please <a href=\"login.xhtml?from=" + encodeURI(window.location.href) + "\">login</a> " + "as a different user or ask your administrator to change the permissions to access this resource.</p>";
}
}
if (error.message === "Failed to fetch") {
errorData.message = "There was a problem while fetching data from server. This could be caused by temporary network " +
"issues.<br/>Please try again.<br/><br/>If issue persist contact system administrator."
errorData.showReport = false;
}
return errorData;
};
......
......@@ -78,6 +78,11 @@ ServerConnector.init = function () {
self._customMap = null;
self._sessionData = undefined;
/**
*
* @type {Configuration}
* @private
*/
self._configuration = undefined;
self._loggedUser = undefined;
self._serverBaseUrl = undefined;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment