Skip to content

Commit

Permalink
Merge branch 'main' into adjust-security-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
abroddrick authored Jan 25, 2025
2 parents 675a079 + 1efa137 commit 7f2fabf
Show file tree
Hide file tree
Showing 71 changed files with 1,223 additions and 675 deletions.
4 changes: 3 additions & 1 deletion src/registrar/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,8 @@ class Meta:

autocomplete_fields = ["user", "domain"]

change_form_template = "django/admin/user_domain_role_change_form.html"

# Fixes a bug where non-superusers are redirected to the main page
def delete_view(self, request, object_id, extra_context=None):
"""Custom delete_view implementation that specifies redirect behaviour"""
Expand Down Expand Up @@ -1500,7 +1502,7 @@ class Meta:

autocomplete_fields = ["domain"]

change_form_template = "django/admin/email_clipboard_change_form.html"
change_form_template = "django/admin/domain_invitation_change_form.html"

# Select domain invitations to change -> Domain invitations
def changelist_view(self, request, extra_context=None):
Expand Down
6 changes: 6 additions & 0 deletions src/registrar/assets/js/uswds-edited.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 0 additions & 113 deletions src/registrar/assets/src/js/getgov/combobox.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/registrar/assets/src/js/getgov/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { initDomainValidators } from './domain-validators.js';
import { initFormsetsForms, triggerModalOnDsDataForm, nameserversFormListener } from './formset-forms.js';
import { initializeUrbanizationToggle } from './urbanization.js';
import { userProfileListener, finishUserSetupListener } from './user-profile.js';
import { loadInitialValuesForComboBoxes } from './combobox.js';
import { handleRequestingEntityFieldset } from './requesting-entity.js';
import { initDomainsTable } from './table-domains.js';
import { initDomainRequestsTable } from './table-domain-requests.js';
Expand Down Expand Up @@ -31,8 +30,6 @@ initializeUrbanizationToggle();
userProfileListener();
finishUserSetupListener();

loadInitialValuesForComboBoxes();

handleRequestingEntityFieldset();

initDomainsTable();
Expand Down
17 changes: 6 additions & 11 deletions src/registrar/assets/src/js/getgov/requesting-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export function handleRequestingEntityFieldset() {
const formPrefix = "portfolio_requesting_entity";
const radioFieldset = document.getElementById(`id_${formPrefix}-requesting_entity_is_suborganization__fieldset`);
const radios = radioFieldset?.querySelectorAll(`input[name="${formPrefix}-requesting_entity_is_suborganization"]`);
const select = document.getElementById(`id_${formPrefix}-sub_organization`);
const selectParent = select?.parentElement;
const input = document.getElementById(`id_${formPrefix}-sub_organization`);
const inputGrandParent = input?.parentElement?.parentElement;
const select = input?.previousElementSibling;
const suborgContainer = document.getElementById("suborganization-container");
const suborgDetailsContainer = document.getElementById("suborganization-container__details");
const suborgAddtlInstruction = document.getElementById("suborganization-addtl-instruction");
const subOrgCreateNewOption = document.getElementById("option-to-add-suborg")?.value;
// Make sure all crucial page elements exist before proceeding.
// This more or less ensures that we are on the Requesting Entity page, and not elsewhere.
if (!radios || !select || !selectParent || !suborgContainer || !suborgDetailsContainer) return;
if (!radios || !input || !select || !inputGrandParent || !suborgContainer || !suborgDetailsContainer) return;

// requestingSuborganization: This just broadly determines if they're requesting a suborg at all
// requestingNewSuborganization: This variable determines if the user is trying to *create* a new suborganization or not.
Expand All @@ -27,8 +27,8 @@ export function handleRequestingEntityFieldset() {
function toggleSuborganization(radio=null) {
if (radio != null) requestingSuborganization = radio?.checked && radio.value === "True";
requestingSuborganization ? showElement(suborgContainer) : hideElement(suborgContainer);
if (select.options.length == 2) { // --Select-- and other are the only options
hideElement(selectParent); // Hide the select drop down and indicate requesting new suborg
if (select.options.length == 1) { // other is the only option
hideElement(inputGrandParent); // Hide the combo box and indicate requesting new suborg
hideElement(suborgAddtlInstruction); // Hide additional instruction related to the list
requestingNewSuborganization.value = "True";
} else {
Expand All @@ -37,11 +37,6 @@ export function handleRequestingEntityFieldset() {
requestingNewSuborganization.value === "True" ? showElement(suborgDetailsContainer) : hideElement(suborgDetailsContainer);
}

// Add fake "other" option to sub_organization select
if (select && !Array.from(select.options).some(option => option.value === "other")) {
select.add(new Option(subOrgCreateNewOption, "other"));
}

if (requestingNewSuborganization.value === "True") {
select.value = "other";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class EditMemberDomainsTable extends BaseTable {
// Append unassigned domains section
if (this.removedDomains.length) {
const unassignedHeader = document.createElement('h3');
unassignedHeader.classList.add('header--body', 'text-primary', 'margin-bottom-1');
unassignedHeader.classList.add('margin-bottom-1');
unassignedHeader.textContent = 'Unassigned domains';
domainAssignmentSummary.appendChild(unassignedHeader);
domainAssignmentSummary.appendChild(unassignedDomainsList);
Expand All @@ -268,15 +268,15 @@ export class EditMemberDomainsTable extends BaseTable {
// Append assigned domains section
if (this.addedDomains.length) {
const assignedHeader = document.createElement('h3');
assignedHeader.classList.add('header--body', 'text-primary', 'margin-bottom-1');
assignedHeader.classList.add('margin-bottom-1');
assignedHeader.textContent = 'Assigned domains';
domainAssignmentSummary.appendChild(assignedHeader);
domainAssignmentSummary.appendChild(assignedDomainsList);
}

// Append total assigned domains section
const totalHeader = document.createElement('h3');
totalHeader.classList.add('header--body', 'text-primary', 'margin-bottom-1');
totalHeader.classList.add('margin-bottom-1');
totalHeader.textContent = 'Total assigned domains';
domainAssignmentSummary.appendChild(totalHeader);
const totalCount = document.createElement('p');
Expand Down
4 changes: 2 additions & 2 deletions src/registrar/assets/src/js/getgov/table-members.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class MembersTable extends BaseTable {
// Only generate HTML if the member has one or more assigned domains
if (num_domains > 0) {
domainsHTML += "<div class='desktop:grid-col-5 margin-bottom-2 desktop:margin-bottom-0'>";
domainsHTML += "<h4 class='margin-y-0 text-primary'>Domains assigned</h4>";
domainsHTML += "<h4 class='margin-y-0'>Domains assigned</h4>";
domainsHTML += `<p class='margin-y-0'>This member is assigned to ${num_domains} domains:</p>`;
domainsHTML += "<ul class='usa-list usa-list--unstyled margin-y-0'>";

Expand Down Expand Up @@ -405,7 +405,7 @@ export class MembersTable extends BaseTable {
}

// Add a permissions header and wrap the entire output in a container
permissionsHTML = "<div class='desktop:grid-col-7'><h4 class='margin-y-0 text-primary'>Additional permissions for this member</h4>" + permissionsHTML + "</div>";
permissionsHTML = "<div class='desktop:grid-col-7'><h4 class='margin-y-0'>Additional permissions for this member</h4>" + permissionsHTML + "</div>";

return permissionsHTML;
}
Expand Down
26 changes: 1 addition & 25 deletions src/registrar/assets/src/sass/_theme/_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ html[data-theme="dark"] {
}

#branding h1,
h1, h2, h3,
.dashboard h1, .dashboard h2, .dashboard h3,
.module h2 {
font-weight: font-weight('bold');
}
Expand Down Expand Up @@ -516,10 +516,6 @@ input[type=submit].button--dja-toolbar:focus, input[type=submit].button--dja-too
max-width: 68ex;
}

.usa-summary-box__dhs-color {
color: $dhs-blue-70;
}

details.dja-detail-table {
display: inline-table;
background-color: var(--body-bg);
Expand Down Expand Up @@ -812,18 +808,6 @@ div.dja__model-description{
text-decoration: underline !important;
}

//-- Override some styling for the USWDS summary box (per design quidance for ticket #2055
.usa-summary-box {
background: #{$dhs-blue-10};
border-color: #{$dhs-blue-30};
max-width: 72ex;
word-wrap: break-word;
}

.usa-summary-box h3 {
color: #{$dhs-blue-60};
}

.module caption, .inline-group h2 {
text-transform: capitalize;
}
Expand Down Expand Up @@ -929,14 +913,6 @@ ul.add-list-reset {
font-size: 14px;
}

.domain-name-wrap {
white-space: normal;
word-wrap: break-word;
overflow: visible;
word-break: break-all;
max-width: 100%;
}

.organization-admin-label {
font-weight: 600;
font-size: .8125rem;
Expand Down
29 changes: 9 additions & 20 deletions src/registrar/assets/src/sass/_theme/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ body {
}

h2 {
color: color('primary-dark');
margin-top: units(2);
margin-bottom: units(2);
}
Expand Down Expand Up @@ -130,16 +129,6 @@ grid column to the max-width of the searchbar, which was calculated to be 33rem.
word-break: break-word;
}

.dotgov-status-box {
background-color: color('primary-lightest');
border-color: color('accent-cool-lighter');
}

.dotgov-status-box--action-need {
background-color: color('warning-lighter');
border-color: color('warning');
}

footer {
border-top: 1px solid color('primary-darker');
}
Expand Down Expand Up @@ -228,14 +217,6 @@ abbr[title] {
max-width: 23ch;
}

.ellipsis--30 {
max-width: 30ch;
}

.ellipsis--50 {
max-width: 50ch;
}

.vertical-align-middle {
vertical-align: middle;
}
Expand Down Expand Up @@ -272,6 +253,14 @@ abbr[title] {
word-break: break-word;
}

.string-wrap {
white-space: normal;
word-wrap: break-word;
overflow: visible;
word-break: break-all;
max-width: 100%;
}

//Icon size adjustment used by buttons and form errors
.usa-icon.usa-icon--large {
margin: 0;
Expand All @@ -285,4 +274,4 @@ abbr[title] {

.width-quarter {
width: 25%;
}
}
7 changes: 0 additions & 7 deletions src/registrar/assets/src/sass/_theme/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,6 @@ a.withdraw_outline:active {
align-items: center;
}

.dotgov-table a
a .usa-icon,
.usa-button--with-icon .usa-icon {
height: 1.3em;
width: 1.3em;
}

// Red, for delete buttons
// Used on: All delete buttons
// Note: Can be simplified by adding text-secondary to delete anchors in tables
Expand Down
Loading

0 comments on commit 7f2fabf

Please sign in to comment.