Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/static/js/allPendingForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,17 @@ function loadOverloadModal(formHistoryID, laborStatusFormID) {
This method sends an AJAX call to recieve data used to populate
the overload modal.
*/

$("#overloadModal").find(".modal-content").html('<div class="modal-body">Loading...</div>');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also curious about the use of the "Loading..." text here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for the "Loading..." is because the modal content persists from the last time it was opened. This creates a "flash" of the wrong student's data, followed by a self-correction when it is updated.

Through the way that it is handeld we are creating a buffer that is user-friendly (as it gives visual feedback), at the same time, renders the right information.

$("#overloadModal").find('.modal-content').load('/admin/overloadModal/' + formHistoryID) ;
$("#overloadModal").modal("show");
$("#overloadModal").find('.modal-content').load('/admin/overloadModal/' + formHistoryID);
}


function loadReleaseModal(formHistoryID, laborStatusFormID) {
$("#modalRelease").modal("show");
$("#modalRelease").find('.modal-content').html('<div class="modal-body">Loading...</div>');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we setting the HTML to Loading if we're going to set it to the actual content in the next line? Also I love this fix!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one, I have fixed it now. Currently, it will no longer be in that order; it will set it to loading and then render it, giving it time to display the content from the ajax request.

$("#modalRelease").find('.modal-content').load('/admin/releaseModal/' + formHistoryID);


$("#modalRelease").modal("show");
}


Expand Down Expand Up @@ -604,7 +605,7 @@ function notesCounter(laborStatusFormID, formHistoryID){
success: function(response) {
var viewNotesID = '#notes_' + String(formHistoryID)
var modalViewNotesID = '#modalNote_' + String(formHistoryID)
$(viewNotesID).html('View Notes (' + response['noteTotal'] + ')')
$(viewNotesID).html('Notes (' + response['noteTotal'] + ')')
$(modalViewNotesID).html('View Notes (' + response['noteTotal'] + ')')
},
error: function(request,status,error){
Expand Down
24 changes: 17 additions & 7 deletions app/templates/admin/allPendingForms.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h1>{{title}}</h1>
<span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="menu1" style="min-width: 100%;">
{% if allForms.historyType.historyTypeName == 'Labor Overload Form' %}
<li role="presentation">
<li role="presentation" id ="{{allForms.formHistoryID}}" onclick="loadOverloadModal({{allForms.formHistoryID}}, {{allForms.formID.laborStatusFormID}});">
{% if currentUser.isFinancialAidAdmin or currentUser.isSaasAdmin %}
{% set formurl = "financialAidOverloadApproval" %}
{% if currentUser.isSaasAdmin %}
Expand All @@ -220,13 +220,23 @@ <h1>{{title}}</h1>
{% endif %}
</li>
{% elif allForms.historyType.historyTypeName == 'Labor Release Form' %}
<li role="presentation"><a role="menuitem" href="#">
<span id="{{allForms.formHistoryID}}"
onclick="loadReleaseModal({{allForms.formHistoryID}}, {{allForms.formID.laborStatusFormID}});">Manage</span></a></li>
<li role="presentation">
<a id="{{allForms.formHistoryID}}"
role="menuitem"
href="#"
class="btn btn-secondary"
onclick="event.preventDefault(); loadReleaseModal('{{allForms.formHistoryID}}', '{{allForms.formID.laborStatusFormID}}');">
Manage
</a></li>
{% elif allForms.formHistoryID in pendingOverloadFormPairs %}
<li role="presentation"><a role="menuitem" href="#">
<span id="{{allForms.formHistoryID}}"
onclick="loadOverloadModal({{pendingOverloadFormPairs[allForms.formHistoryID]}}, {{allForms.formID.laborStatusFormID}});">Manage</span></a></li>
<li role="presentation">
<a id="{{allForms.formHistoryID}}"
role="menuitem"
href="#"
class="btn btn-secondary"
onclick="event.preventDefault(); loadOverloadModal('{{allForms.formHistoryID}}', '{{allForms.formID.laborStatusFormID}}');">
Manage
</a></li>
{% else %}
<li role="presentation"><a role="menuitem" href="#">
<span onclick="insertDenial({{allForms.formHistoryID}})"
Expand Down
2 changes: 1 addition & 1 deletion app/templates/snips/pendingOverloadModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3 class="modal-title" id="overloadModalLabel" align="center"><b>Labor Overload
########################################}
<div id="notes" style="position:absolute; right:0">
<div id="viewNotesButton">
<button id="modalNote_{{formHistoryID}}" onclick="toggleNotesLog({{laborStatusFormID}}, {{formHistoryID}})" class='btn btn-sm btn-primary'>View Notes ({{noteTotal}})</button>
<button id="modalNote_{{formHistoryID}}" onclick="toggleNotesLog({{laborStatusFormID}}, {{formHistoryID}})" class='btn btn-sm btn-primary'> Notes({{noteTotal}}) </button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/snips/pendingReleaseModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h3 class="modal-title" align="center"><strong>Labor Release Form</strong></h3>
</table>

<div id='radioDivRelease'>
<button id="modalNote_{{formHistoryID}}" onclick="toggleNotesLog({{laborStatusFormID}}, {{formHistoryID}})" style='float: left; margin-top: -10px;' class='btn btn-sm btn-primary'>View Notes ({{noteTotal}})</button>
<button id="modalNote_{{formHistoryID}}" onclick="toggleNotesLog({{laborStatusFormID}}, {{formHistoryID}})" style='float: left; margin-top: -10px;' class='btn btn-sm btn-primary'>Notes({{noteTotal}})</button>
<p class="status-warning" style="color:red;" hidden><span class="glyphicon glyphicon-exclamation-sign">
</span><strong>A Status is required in order to submit</strong></p><span>Status:<span aria-hidden="true" style="color:red"><strong>*</strong></span></span>
<label for="approveRelease" class="radio-inline">
Expand Down
17 changes: 11 additions & 6 deletions db_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"db": "UTE"
}

from app.config.loadConfig import load_config
cfg = load_config('app/config/secret_config.yaml')
details["password"] = cfg["tracy"]["mssql_password"]

###########################
# Test pyodbc connection
###########################
Expand Down Expand Up @@ -42,7 +46,8 @@
###########################

from flask_sqlalchemy import SQLAlchemy
from app import load_config, app
from app import app
from app.config.loadConfig import load_config
from app.logic.tracy import Tracy

cfg = load_config('app/config/secret_config.yaml')
Expand All @@ -59,11 +64,11 @@
# Test Banner connection
###########################

from app.logic.banner import Banner
from app.models.formHistory import FormHistory
b = Banner()
cursor = b.conn.cursor()
print(cursor)
# from app.logic.banner import Banner
# from app.models.formHistory import FormHistory
# b = Banner()
# cursor = b.conn.cursor()
# print(cursor)

# NOT FOR PROD
# b.insert(FormHistory.get_by_id(39061))
Expand Down