Improve error handling when editing in the meeting scheduler, add
timeouts and output more error information. - Legacy-Id: 17608
This commit is contained in:
parent
8cc85e9fc2
commit
b8b1b67e6d
|
@ -2,7 +2,10 @@ jQuery(document).ready(function () {
|
||||||
let content = jQuery(".edit-meeting-schedule");
|
let content = jQuery(".edit-meeting-schedule");
|
||||||
|
|
||||||
function failHandler(xhr, textStatus, error) {
|
function failHandler(xhr, textStatus, error) {
|
||||||
alert("Error: " + error);
|
let errorText = error;
|
||||||
|
if (xhr && xhr.responseText)
|
||||||
|
errorText += "\n\n" + xhr.responseText;
|
||||||
|
alert("Error: " + errorText);
|
||||||
}
|
}
|
||||||
|
|
||||||
let sessions = content.find(".session");
|
let sessions = content.find(".session");
|
||||||
|
@ -104,7 +107,12 @@ jQuery(document).ready(function () {
|
||||||
|
|
||||||
let dropElement = jQuery(this);
|
let dropElement = jQuery(this);
|
||||||
|
|
||||||
function done() {
|
function done(response) {
|
||||||
|
if (response != "OK") {
|
||||||
|
failHandler(null, null, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dropElement.append(sessionElement); // move element
|
dropElement.append(sessionElement); // move element
|
||||||
updateCurrentSchedulingHints();
|
updateCurrentSchedulingHints();
|
||||||
if (dropElement.hasClass("unassigned-sessions"))
|
if (dropElement.hasClass("unassigned-sessions"))
|
||||||
|
@ -115,6 +123,7 @@ jQuery(document).ready(function () {
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: ietfData.urls.assign,
|
url: ietfData.urls.assign,
|
||||||
method: "post",
|
method: "post",
|
||||||
|
timeout: 5 * 1000,
|
||||||
data: {
|
data: {
|
||||||
action: "unassign",
|
action: "unassign",
|
||||||
session: sessionId.slice("session".length)
|
session: sessionId.slice("session".length)
|
||||||
|
@ -129,7 +138,8 @@ jQuery(document).ready(function () {
|
||||||
action: "assign",
|
action: "assign",
|
||||||
session: sessionId.slice("session".length),
|
session: sessionId.slice("session".length),
|
||||||
timeslot: dropElement.attr("id").slice("timeslot".length)
|
timeslot: dropElement.attr("id").slice("timeslot".length)
|
||||||
}
|
},
|
||||||
|
timeout: 5 * 1000
|
||||||
}).fail(failHandler).done(done);
|
}).fail(failHandler).done(done);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue