This commit is contained in:
zandercymatics 2025-01-15 12:05:58 -07:00
parent 036c10e53d
commit 3aa493d15e
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
5 changed files with 32 additions and 7 deletions

View file

@ -462,10 +462,7 @@ export class BaseTable {
let dataObjects = this.getDataObjects(data);
let customTableOptions = this.customizeTable(data);
dataObjects.forEach(dataObject => {
this.addRow(dataObject, tbody, customTableOptions);
});
this.loadRows(dataObjects, tbody, customTableOptions)
this.initShowMoreButtons();
this.initCheckboxListeners();
@ -492,6 +489,12 @@ export class BaseTable {
.catch(error => console.error('Error fetching objects:', error));
}
loadRows(dataObjects, tbody, customTableOptions) {
dataObjects.forEach(dataObject => {
this.addRow(dataObject, tbody, customTableOptions);
});
}
// Add event listeners to table headers for sorting
initializeTableHeaders() {
this.tableHeaders.forEach(header => {

View file

@ -66,7 +66,14 @@ export class MembersTable extends BaseTable {
};
}
addRow(dataObject, tbody, customTableOptions) {
loadRows(dataObjects, tbody, customTableOptions) {
dataObjects.forEach((dataObject, index) => {
const isLastRow = index === dataObjects.length - 1;
this.addRow(dataObject, tbody, customTableOptions, isLastRow);
});
}
addRow(dataObject, tbody, customTableOptions, isLastRow = false) {
const member = dataObject;
// member is based on either a UserPortfolioPermission or a PortfolioInvitation
// and also includes information from related domains; the 'id' of the org_member
@ -81,6 +88,9 @@ export class MembersTable extends BaseTable {
const kebabHTML = customTableOptions.needsAdditionalColumn ? generateKebabHTML('remove-member', unique_id, cancelInvitationButton, `for ${member.name}`): '';
const row = document.createElement('tr');
if (isLastRow) {
row.classList.add("hide-td-borders");
}
let admin_tagHTML = ``;
if (member.is_admin)

View file

@ -8,7 +8,7 @@
:root,
html[data-theme="light"] {
--primary: #{$theme-color-primary};
--secondary: #{$theme-color-error};
--secondary: #{$theme-color-primary-darkest};
--accent: #{$theme-color-accent-cool};
// --primary-fg: #fff;

View file

@ -253,6 +253,10 @@ a.text-secondary:hover {
color: $theme-color-error;
}
button.usa-button.usa-button--secondary, a.usa-button.usa-button--secondary {
background-color: $theme-color-error;
}
.usa-button--show-more-button {
font-size: size('ui', 'xs');
text-decoration: none;

View file

@ -41,6 +41,14 @@ th {
}
}
.members__table-wrapper .dotgov-table {
tr:not(.hide-td-borders):not(:last-of-type) {
td, th {
border-bottom: 1px solid color('base-lighter');
}
}
}
.dotgov-table {
width: 100%;
@ -56,7 +64,7 @@ th {
border: none;
}
tr:not(.hide-td-borders):not(:last-of-type) {
tr:not(.hide-td-borders) {
td, th {
border-bottom: 1px solid color('base-lighter');
}