Exclude other reason for now

This commit is contained in:
zandercymatics 2024-10-01 09:40:39 -06:00
parent 162369f5db
commit 0a7d4e460d
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 9 additions and 6 deletions

View file

@ -581,11 +581,11 @@ class CustomizableEmailBase {
return this.lastSentEmailContent.value.replace(/\s+/g, '') === this.textarea.value.replace(/\s+/g, '');
}
updateUserInterface(reason=this.dropdown.value) {
updateUserInterface(reason=this.dropdown.value, excluded_reasons=["other"]) {
if (!reason) {
// No reason selected, we will set the label to "Email", show the "Make a selection" placeholder, hide the trigger, textarea, hide the help text
this.showPlaceholderNoReason();
} else if (reason === 'other') {
} else if (excluded_reasons.includes(reason)) {
// 'Other' selected, we will set the label to "Email", show the "No email will be sent" placeholder, hide the trigger, textarea, hide the help text
this.showPlaceholderOtherReason();
} else {
@ -728,10 +728,13 @@ class customRejectedEmail extends CustomizableEmailBase {
this.showPlaceholder("Email:", "Select a rejection reason to see email");
}
// Overrides the placeholder text when the reason other is selected
showPlaceholderOtherReason() {
this.showPlaceholder("Email:", "No email will be sent");
updateUserInterface(reason=this.dropdown.value, excluded_reasons=[]) {
super.updateUserInterface(reason, excluded_reasons);
}
// Overrides the placeholder text when the reason other is selected
// showPlaceholderOtherReason() {
// this.showPlaceholder("Email:", "No email will be sent");
// }
}

View file

@ -18,7 +18,7 @@ def get_rejection_reason_default_email(domain_request, rejection_reason):
domain_request,
file_path="emails/status_change_rejected.txt",
reason=rejection_reason,
excluded_reasons=[DomainRequest.RejectionReasons.OTHER]
# excluded_reasons=[DomainRequest.RejectionReasons.OTHER]
)
def _get_default_email(domain_request, file_path, reason, excluded_reasons=None):