From 925e751dddf231226d4fa034ae14132f765af663 Mon Sep 17 00:00:00 2001 From: Alie Langston Date: Fri, 5 Mar 2021 13:56:54 -0500 Subject: [PATCH] added loading spinner to search bar updated version updated version --- CHANGELOG.rst | 6 ++ edx_proctoring/__init__.py | 2 +- .../js/views/proctored_exam_attempt_view.js | 10 ++ .../views/proctored_exam_onboarding_view.js | 15 +++ .../spec/proctored_exam_attempt_spec.js | 100 +++++++++++++++++- .../spec/proctored_exam_onboarding_spec.js | 73 ++++++++++++- .../student-onboarding-status.underscore | 16 ++- ...proctored-exam-attempts-grouped.underscore | 10 +- ...student-proctored-exam-attempts.underscore | 10 +- package.json | 2 +- 10 files changed, 231 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e10d9d20967..affcc9f3636 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,12 @@ Change Log Unreleased ~~~~~~~~~~ + +[3.7.7] - 2021-03-08 +~~~~~~~~~~~~~~~~~~~~ +* Add loading spinner for searching to onboarding attempt and special attempts sections on the + instructor dashboard + [3.7.6] - 2021-03-05 ~~~~~~~~~~~~~~~~~~~~ * Fix bug with StudentProctoredExamAttempt put handler where course_id was being incorrectly determined, diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index be3a5e7c84f..f51ee159f80 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -3,6 +3,6 @@ """ # Be sure to update the version number in edx_proctoring/package.json -__version__ = '3.7.6' +__version__ = '3.7.7' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js b/edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js index 821caeacf51..290d9754ca1 100644 --- a/edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js +++ b/edx_proctoring/static/proctoring/js/views/proctored_exam_attempt_view.js @@ -88,11 +88,16 @@ edx = edx || {}; edx.dashboard.dropdown.toggleExamAttemptActionDropdownMenu(event); }, searchAttempts: function(event) { + var $searchIcon, $spinner; var searchText = $('#search_attempt_id').val(); if (searchText !== '') { this.inSearchMode = true; this.searchText = searchText; this.collection.url = this.initial_url + this.course_id + '/search/' + searchText; + $searchIcon = $(document.getElementById('attempt-search-indicator')); + $searchIcon.addClass('hidden'); + $spinner = $(document.getElementById('attempt-loading-indicator')); + $spinner.removeClass('hidden'); this.hydrate(); event.stopPropagation(); event.preventDefault(); @@ -147,7 +152,12 @@ edx = edx || {}; var self = this; self.collection.fetch({ success: function() { + var $searchIcon, $spinner; self.render(); + $spinner = $(document.getElementById('attempt-loading-indicator')); + $spinner.addClass('hidden'); + $searchIcon = $(document.getElementById('attempt-search-indicator')); + $searchIcon.removeClass('hidden'); } }); }, diff --git a/edx_proctoring/static/proctoring/js/views/proctored_exam_onboarding_view.js b/edx_proctoring/static/proctoring/js/views/proctored_exam_onboarding_view.js index 0b7d89f8c54..495a84662f4 100644 --- a/edx_proctoring/static/proctoring/js/views/proctored_exam_onboarding_view.js +++ b/edx_proctoring/static/proctoring/js/views/proctored_exam_onboarding_view.js @@ -72,12 +72,17 @@ edx = edx || {}; 'click li > a.target-link': 'getPaginatedItems' }, searchItems: function(event) { + var $searchIcon, $spinner; var searchText = $('#search_onboarding_id').val(); if (searchText !== '') { this.inSearchMode = true; this.searchText = searchText; this.currentPage = 1; this.collection.url = this.constructUrl(); + $searchIcon = $(document.getElementById('onboarding-search-indicator')); + $searchIcon.addClass('hidden'); + $spinner = $(document.getElementById('onboarding-loading-indicator')); + $spinner.removeClass('hidden'); this.hydrate(); event.stopPropagation(); event.preventDefault(); @@ -164,12 +169,22 @@ edx = edx || {}; var self = this; self.collection.fetch({ success: function() { + var $searchIcon, $spinner; self.render(); + $spinner = $(document.getElementById('onboarding-loading-indicator')); + $spinner.addClass('hidden'); + $searchIcon = $(document.getElementById('onboarding-search-indicator')); + $searchIcon.removeClass('hidden'); }, error: function() { // in the case that there is no onboarding data, we // still want the view to render + var $searchIcon, $spinner; self.render(); + $spinner = $(document.getElementById('onboarding-loading-indicator')); + $spinner.addClass('hidden'); + $searchIcon = $(document.getElementById('onboarding-search-indicator')); + $searchIcon.removeClass('hidden'); } }); }, diff --git a/edx_proctoring/static/proctoring/spec/proctored_exam_attempt_spec.js b/edx_proctoring/static/proctoring/spec/proctored_exam_attempt_spec.js index 714f16d5038..6a354be7084 100644 --- a/edx_proctoring/static/proctoring/spec/proctored_exam_attempt_spec.js +++ b/edx_proctoring/static/proctoring/spec/proctored_exam_attempt_spec.js @@ -178,8 +178,16 @@ describe('ProctoredExamAttemptView', function() { '
' + '
' + ' value="<%= searchText %>" <%} %>' + - '/> ' + + '<% if (inSearchMode) { %> value="<%= searchText %>" <%} %> /> ' + + '' + + '' + + '
' + + '' + + '
' + + '
' + '' + '
' + '