Add changes

This commit is contained in:
zandercymatics 2024-06-07 09:23:41 -06:00
parent 173520b97b
commit ec0f6a4ac7
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 30 additions and 3 deletions

View file

@ -382,6 +382,33 @@ function initializeWidgetOnList(list, parentId) {
// element to hide, statusToShowOn, sessionObjectName
showHideFieldsOnStatusChange(actionNeededReasonFormGroup, "action needed", "hide_action_needed_reason");
// Move the status changelog to below the action needed reason
if(actionNeededReasonFormGroup){
document.addEventListener('DOMContentLoaded', function() {
let statusSelect = document.getElementById('id_status');
function moveStatusChangelog(actionNeededReasonFormGroup, statusSelect) {
let flexContainer = actionNeededReasonFormGroup.querySelector('.flex-container');
let statusChangelog = document.getElementById('dja-status-changelog');
if (statusSelect.value === "action needed") {
flexContainer.parentNode.insertBefore(statusChangelog, flexContainer.nextSibling);
} else {
// Move the changelog back to its original location
let statusFlexContainer = statusSelect.closest('.flex-container');
statusFlexContainer.parentNode.insertBefore(statusChangelog, statusFlexContainer.nextSibling);
}
}
// Call the function on page load
moveStatusChangelog(actionNeededReasonFormGroup, statusSelect);
// Add event listener to handle changes to the selector itself
statusSelect.addEventListener('change', function() {
moveStatusChangelog(actionNeededReasonFormGroup, statusSelect);
})
});
}
}
// Hookup the fields that we want to programatically show/hide depending on the current value of the status field.

View file

@ -69,8 +69,8 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
{% block after_help_text %}
{% if field.field.name == "status" and original_object.history.count > 0 %}
<div class="flex-container">
<label aria-label="Submitter contact details"></label>
<div class="flex-container" id="dja-status-changelog">
<label aria-label="Status changelog"></label>
<div>
<div class="usa-table-container--scrollable collapse--dgsimple" tabindex="0">
<table class="usa-table usa-table--borderless">

View file

@ -102,7 +102,7 @@ class FSMDomainRequestError(Exception):
FSMErrorCodes.INVESTIGATOR_NOT_STAFF: ("Investigator is not a staff user."),
FSMErrorCodes.INVESTIGATOR_NOT_SUBMITTER: ("Only the assigned investigator can make this change."),
FSMErrorCodes.NO_REJECTION_REASON: ("A rejection reason is required."),
FSMErrorCodes.NO_ACTION_NEEDED_REASON: ("A action needed reason is required."),
FSMErrorCodes.NO_ACTION_NEEDED_REASON: ("A reason is required for this status."),
}
def __init__(self, *args, code=None, **kwargs):