1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
6 on('click', "#report-issue-submit", function(e){
7 $(this).html('Sending');
8 $(this).prop('disabled', true);
9 var $cancelButton = $('#report-issue-cancel');
11 $cancelButton.html('Close');
13 $('div').remove('.modal-footer-status');
15 $.ajax('/report_issue', {
17 data: $(this).parents('form').serialize()
18 }).success(function(data, status, jqxhr) {
19 var $sendButton = $('#report-issue-submit');
20 $sendButton.html('Report sent');
21 $('div').remove('.modal-footer-status');
22 $('.modal-footer').append('<div><br/></div><div class="modal-footer-status alert alert-success"><p class="contain-align-left">Thanks for reporting this issue!</p></div>');
23 }).fail(function(jqxhr, status, error) {
24 var $sendButton = $('#report-issue-submit');
25 if ($sendButton && $sendButton.prop('disabled')) {
26 $('div').remove('.modal-footer-status');
27 $('.modal-footer').append('<div><br/></div><div class="modal-footer-status alert alert-danger"><p class="contain-align-left">We are sorry. We could not submit your report! We really want this to work, though -- please try again.</p></div>');
28 $sendButton.html('Send problem report');
29 $sendButton.prop('disabled', false);
31 var $cancelButton = $('#report-issue-cancel');
32 $cancelButton.html('Cancel');