From 885d5b1b2617d290b967b7e58761deaa99555f8f Mon Sep 17 00:00:00 2001 From: munsakad Date: Tue, 16 Jun 2026 16:43:36 -0400 Subject: [PATCH 01/10] Add user-facing error handling to withdraw ajax request Replaces silent console.log with an alert so the user is notified when a withdrawal fails. Also fixes done -> complete so the select reset actually runs. --- app/static/js/slcManagement.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/static/js/slcManagement.js b/app/static/js/slcManagement.js index b62f72784..7e946fa70 100644 --- a/app/static/js/slcManagement.js +++ b/app/static/js/slcManagement.js @@ -140,10 +140,13 @@ function withdraw(){ location.reload(); }, error: function(request, status, error) { - console.log(status,error); - + console.log(status, error); + let message = (request.responseJSON && request.responseJSON.message) + ? request.responseJSON.message + : "An error occurred while withdrawing the course. Please try again."; + alert(message); }, - done: function () { + complete: function () { $('#' + courseID).val('---'); } }); From 664991ad2e20e7e7e2bf39e916c33d5573661da7 Mon Sep 17 00:00:00 2001 From: feitsopb Date: Wed, 17 Jun 2026 10:31:40 -0400 Subject: [PATCH 02/10] Revert unrelated files from exception handling branch --- .devcontainer/docker-compose.yml | 3 +- app/templates/main/emergencyContactInfo.html | 10 ++--- app/templates/main/insuranceInfo.html | 10 ++--- .../serviceLearning/slcNewProposal.html | 38 +++++++++---------- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 987d9bae4..e767a9714 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -18,7 +18,6 @@ services: db: image: mysql restart: always - command: --require_secure_transport=OFF environment: MYSQL_DATABASE: 'celts' MYSQL_USER: 'celts_user' @@ -32,4 +31,4 @@ services: - celts_data:/var/lib/mysql volumes: - celts_data: + celts_data: \ No newline at end of file diff --git a/app/templates/main/emergencyContactInfo.html b/app/templates/main/emergencyContactInfo.html index c27261f2b..2a4ab1f53 100644 --- a/app/templates/main/emergencyContactInfo.html +++ b/app/templates/main/emergencyContactInfo.html @@ -68,14 +68,14 @@

Emergency Contact



-
-
- {{'Exit' if readOnly else 'Cancel'}} +
+
-
+
{% if not readOnly %} - Save & Exit + Save & Exit Continue to Insurance Info {% endif %}
diff --git a/app/templates/main/insuranceInfo.html b/app/templates/main/insuranceInfo.html index b3cc35549..5639e4ebd 100644 --- a/app/templates/main/insuranceInfo.html +++ b/app/templates/main/insuranceInfo.html @@ -72,14 +72,14 @@

Insurance Information



-
-
- {{'Exit' if readOnly else 'Cancel'}} +
+
-
+
{% if not readOnly %} - Save & Exit + Save & Exit Continue to Emergency Contact {% endif %}
diff --git a/app/templates/serviceLearning/slcNewProposal.html b/app/templates/serviceLearning/slcNewProposal.html index 43de55e7c..29ada7df8 100644 --- a/app/templates/serviceLearning/slcNewProposal.html +++ b/app/templates/serviceLearning/slcNewProposal.html @@ -25,28 +25,24 @@
{% include "serviceLearning/slcQuestionnaire.html" %}
-
-
-
- - - - -
-
- - - {% if g.current_user.isCeltsAdmin %} - - {% endif %} -
+
+
+ + + +
-
-
- - - -
+
+ + + +
+
+ + + {% if g.current_user.isCeltsAdmin %} + + {% endif %}
From d1551aa5e7078145eac1b33d113205744a2daf2b Mon Sep 17 00:00:00 2001 From: feitsopb Date: Wed, 17 Jun 2026 11:37:48 -0400 Subject: [PATCH 03/10] Use flash message for withdraw errors --- app/static/js/slcManagement.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/static/js/slcManagement.js b/app/static/js/slcManagement.js index 7e946fa70..4b786775e 100644 --- a/app/static/js/slcManagement.js +++ b/app/static/js/slcManagement.js @@ -141,10 +141,13 @@ function withdraw(){ }, error: function(request, status, error) { console.log(status, error); - let message = (request.responseJSON && request.responseJSON.message) - ? request.responseJSON.message - : "An error occurred while withdrawing the course. Please try again."; - alert(message); + let message; + if (request.responseJSON && request.responseJSON.message) { + message = request.responseJSON.message; + } else { + message = "An error occurred while withdrawing the course. Please try again."; + } + msgFlash(message, "danger"); }, complete: function () { $('#' + courseID).val('---'); From 5c6b5194e26c7e50b27169df0419afed3479400f Mon Sep 17 00:00:00 2001 From: munsakad Date: Wed, 17 Jun 2026 14:49:54 -0400 Subject: [PATCH 04/10] Display withdraw error message inside modal instead of page flash --- app/static/js/slcManagement.js | 14 +++++++------- app/templates/serviceLearning/slcManagement.html | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/static/js/slcManagement.js b/app/static/js/slcManagement.js index 4b786775e..5c021ddf6 100644 --- a/app/static/js/slcManagement.js +++ b/app/static/js/slcManagement.js @@ -7,6 +7,9 @@ $(document).ready(function() { $('.modal').on('hidden.bs.modal', function () { resetAllSelections() }); + $('#withdrawModal').on('hidden.bs.modal', function () { + $("#withdrawError").text("").addClass("d-none"); + }); $('#renewTerm').on('change', function(){ if ($('#renewTerm').value != "---"){ $('#renewBtn').prop('disabled', false); @@ -141,13 +144,10 @@ function withdraw(){ }, error: function(request, status, error) { console.log(status, error); - let message; - if (request.responseJSON && request.responseJSON.message) { - message = request.responseJSON.message; - } else { - message = "An error occurred while withdrawing the course. Please try again."; - } - msgFlash(message, "danger"); + let message = (request.responseJSON && request.responseJSON.message) + ? request.responseJSON.message + : "An error occurred while withdrawing the course. Please try again."; + $("#withdrawError").text(message).removeClass("d-none"); }, complete: function () { $('#' + courseID).val('---'); diff --git a/app/templates/serviceLearning/slcManagement.html b/app/templates/serviceLearning/slcManagement.html index b48512b02..16cfab4cf 100644 --- a/app/templates/serviceLearning/slcManagement.html +++ b/app/templates/serviceLearning/slcManagement.html @@ -70,6 +70,7 @@