From 37cb737987b4f802134d6b83c6af4d56fa1b1193 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Thu, 10 Feb 2022 21:20:20 +0000 Subject: [PATCH] Check the selenium console log for any issues as part of the test suite, and fix/suppress errors found by that. - Legacy-Id: 19916 --- ietf/static/js/agenda_filter.js | 1 - ietf/static/js/datepicker.js | 2 +- ietf/static/js/edit-meeting-schedule.js | 2 +- ietf/static/js/select2.js | 5 + .../static/js/status-change-edit-relations.js | 59 +- ietf/static/js/timeslot_edit.js | 2 +- ietf/templates/doc/document_history.html | 4 +- .../doc/status_change/edit_related_rows.html | 27 +- ietf/templates/meeting/agenda.html | 4 +- ietf/templates/submit/search_submission.html | 17 +- ietf/utils/jstest.py | 29 +- package-lock.json | 7382 ++--------------- package.json | 2 +- 13 files changed, 855 insertions(+), 6681 deletions(-) diff --git a/ietf/static/js/agenda_filter.js b/ietf/static/js/agenda_filter.js index b84877960..231577f64 100644 --- a/ietf/static/js/agenda_filter.js +++ b/ietf/static/js/agenda_filter.js @@ -261,7 +261,6 @@ window.agenda_filter_for_testing; // methods to be accessed for automated testin function register_handlers() { $('.pickview') .on("click", function () { - console.log("pickview"); if (is_disabled($(this))) { return; } var fp = handle_pick_button($(this)); update_filters(fp); diff --git a/ietf/static/js/datepicker.js b/ietf/static/js/datepicker.js index eae253010..79d35f721 100644 --- a/ietf/static/js/datepicker.js +++ b/ietf/static/js/datepicker.js @@ -1 +1 @@ -import "bootstrap-datepicker"; \ No newline at end of file +import "bootstrap-datepicker/js/bootstrap-datepicker.js"; \ No newline at end of file diff --git a/ietf/static/js/edit-meeting-schedule.js b/ietf/static/js/edit-meeting-schedule.js index 417a04df1..f0ffcc2a9 100644 --- a/ietf/static/js/edit-meeting-schedule.js +++ b/ietf/static/js/edit-meeting-schedule.js @@ -497,7 +497,7 @@ jQuery(document).ready(function () { let originRadio = updateSwapRadios(swapDaysLabels, swapDaysRadios, originDay, 'day'); // Fill in label in the modal title - swapDaysModal.find(".modal-title .day").text(jQuery.trim(originRadio.parent().text())); + swapDaysModal.find(".modal-title .day").text(originRadio.parent().text().trim()); // Fill in the hidden form fields swapDaysModal.find("input[name=source_day]").val(originDay); diff --git a/ietf/static/js/select2.js b/ietf/static/js/select2.js index 82f5576e6..61417103a 100644 --- a/ietf/static/js/select2.js +++ b/ietf/static/js/select2.js @@ -19,6 +19,7 @@ $.fn.select2.defaults.set("escapeMarkup", function (m) { window.setupSelect2Field = function (e) { var url = e.data("ajax--url"); var maxEntries = e.data("max-entries"); + var result_key = e.data("result-key"); var options = e.data("pre"); for (var id in options) { e.append(new Option(options[id].text, options[id].id, false, options[id].selected)); @@ -38,6 +39,10 @@ window.setupSelect2Field = function (e) { }; }, processResults: function (results) { + if (result_key) { + // overwrite the returned "id" fields with the data in the result_key fields + results = results.map(x => ({ ...x, ...{ id: x[result_key] } })); + } return { results: results, pagination: { diff --git a/ietf/static/js/status-change-edit-relations.js b/ietf/static/js/status-change-edit-relations.js index ed1eaffe2..c5dd44b67 100644 --- a/ietf/static/js/status-change-edit-relations.js +++ b/ietf/static/js/status-change-edit-relations.js @@ -1,31 +1,32 @@ -$(function () { - var form = $(".new-relation-row") - .closest("form"); - var newRowHtml = form.find(".new-relation-row") - .get(0) - .outerHTML; - var counter = 1; +$(document) + .ready(function () { + var form = $(".new-relation-row") + .closest("form"); + var newRowHtml = form.find(".new-relation-row") + .get(0) + .outerHTML; + var counter = 1; - form.on("click", ".delete", function (e) { - e.preventDefault(); - $(this) - .closest(".input-group") - .remove(); - }); + form.on("click", ".delete", function (e) { + e.preventDefault(); + $(this) + .closest(".input-group") + .remove(); + }); - form.on("keydown", ".new-relation-row input[type=text]", function () { - var top = $(this) - .closest(".new-relation-row"); - top.removeClass("new-relation-row"); - top.find(".delete") - .removeAttr('Disabled') - .removeClass("btn-outline-danger") - .addClass("btn-danger"); - top.find("input,select") - .each(function () { - this.name += counter; - }); - ++counter; - top.after(newRowHtml); - }); -}); \ No newline at end of file + form.on("keydown", ".new-relation-row input[type=text]", function () { + var top = $(this) + .closest(".new-relation-row"); + top.removeClass("new-relation-row"); + top.find(".delete") + .prop('Disabled', false) + .removeClass("btn-outline-danger") + .addClass("btn-danger"); + top.find("input,select") + .each(function () { + this.name += counter; + }); + ++counter; + top.after(newRowHtml); + }); + }); \ No newline at end of file diff --git a/ietf/static/js/timeslot_edit.js b/ietf/static/js/timeslot_edit.js index 174670c28..568e37e39 100644 --- a/ietf/static/js/timeslot_edit.js +++ b/ietf/static/js/timeslot_edit.js @@ -213,7 +213,7 @@ timeslotEdit = (function () { let timeslotElts = Array.from(deleteModal.eltsToDelete); // make own copy as Array so we have .map() ajaxDeleteTimeSlot(timeslotElts.map(elt => elt.dataset.timeslotPk)) - .error(function (jqXHR) { + .fail(function (jqXHR) { displayError('Error deleting timeslot: ' + jqXHR.responseText); }) .done(function () { diff --git a/ietf/templates/doc/document_history.html b/ietf/templates/doc/document_history.html index a45700f0c..c22dfe647 100644 --- a/ietf/templates/doc/document_history.html +++ b/ietf/templates/doc/document_history.html @@ -25,7 +25,7 @@
- {% for name, rev, time, url in diff_revisions %}