Merge branch 'main' into za/2671-show-portfolios-on-user-table

This commit is contained in:
zandercymatics 2024-09-05 08:29:44 -06:00
commit 47e8934cde
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
8 changed files with 35 additions and 11 deletions

View file

@ -519,7 +519,6 @@ function initializeWidgetOnList(list, parentId) {
var actionNeededEmailReadonlyTextarea = document.querySelector("#action-needed-reason-email-readonly-textarea")
// Edit e-mail modal (and its confirmation button)
var actionNeededEmailAlreadySentModal = document.querySelector("#email-already-sent-modal")
var confirmEditEmailButton = document.querySelector("#email-already-sent-modal_continue-editing-button")
// Headers and footers (which change depending on if the e-mail was sent or not)
@ -561,11 +560,11 @@ function initializeWidgetOnList(list, parentId) {
updateActionNeededEmailDisplay(reason)
});
editEmailButton.addEventListener("click", function() {
if (!checkEmailAlreadySent()) {
showEmail(canEdit=true)
}
});
// editEmailButton.addEventListener("click", function() {
// if (!checkEmailAlreadySent()) {
// showEmail(canEdit=true)
// }
// });
confirmEditEmailButton.addEventListener("click", function() {
// Show editable view

View file

@ -546,7 +546,7 @@ button .usa-icon,
#submitRowToggle {
color: var(--body-fg);
}
.requested-domain-sticky {
.submit-row-sticky {
max-width: 325px;
overflow: hidden;
white-space: nowrap;

View file

@ -295,7 +295,7 @@ class UserFixture:
logger.warning(f"Could not add email to whitelist for {first_name} {last_name}.")
# Load additional emails
allowed_emails.extend(additional_emails)
allowed_emails.extend([AllowedEmail(email=email) for email in additional_emails])
if allowed_emails:
AllowedEmail.objects.bulk_create(allowed_emails)

View file

@ -120,7 +120,7 @@
</button>
</span>
<p class="padding-top-05 text-right margin-top-2 padding-right-2 margin-bottom-0 requested-domain-sticky float-right visible-768">
<p class="padding-top-05 text-right margin-top-2 padding-right-2 margin-bottom-0 submit-row-sticky float-right visible-768">
Requested domain: <strong>{{ original.requested_domain.name }}</strong>
</p>
{{ block.super }}

View file

@ -1,4 +1,4 @@
<p>This table is an email whitelist for <strong>non-production</strong> environments.</p>
<p>This table is an email allow list for <strong>non-production</strong> environments.</p>
<p>
If an email is sent out and the email does not exist within this table (or is not a subset of it),
then no email will be sent.

View file

@ -330,7 +330,7 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
</details>
{% endif %}
{% endwith %}
{% elif field.field.name == "state_territory" %}
{% elif field.field.name == "state_territory" and original_object|model_name_lowercase != 'portfolio' %}
<div class="flex-container margin-top-2">
<span>
CISA region:

View file

@ -1,4 +1,5 @@
{% extends 'django/admin/email_clipboard_change_form.html' %}
{% load custom_filters %}
{% load i18n static %}
{% block content %}
@ -23,3 +24,22 @@
{% include "django/admin/includes/detail_table_fieldset.html" with original_object=original %}
{% endfor %}
{% endblock %}
{% block submit_buttons_bottom %}
<div class="submit-row-wrapper">
<span class="submit-row-toggle padding-1 padding-right-2 visible-desktop">
<button type="button" class="usa-button usa-button--unstyled" id="submitRowToggle">
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
<use xlink:href="{%static 'img/sprite.svg'%}#expand_more"></use>
</svg>
<span>Hide</span>
</button>
</span>
<p class="padding-top-05 text-right margin-top-2 padding-right-2 margin-bottom-0 submit-row-sticky float-right visible-768">
Organization Name: <strong>{{ original.organization_name }}</strong>
</p>
{{ block.super }}
</div>
<span class="scroll-indicator"></span>
{% endblock %}

View file

@ -169,3 +169,8 @@ def has_contact_info(user):
return False
else:
return bool(user.title or user.email or user.phone)
@register.filter
def model_name_lowercase(instance):
return instance.__class__.__name__.lower()