mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-23 09:41:05 +02:00
Fix bugs
This commit is contained in:
parent
036c10e53d
commit
3aa493d15e
5 changed files with 32 additions and 7 deletions
|
@ -462,10 +462,7 @@ export class BaseTable {
|
||||||
|
|
||||||
let dataObjects = this.getDataObjects(data);
|
let dataObjects = this.getDataObjects(data);
|
||||||
let customTableOptions = this.customizeTable(data);
|
let customTableOptions = this.customizeTable(data);
|
||||||
|
this.loadRows(dataObjects, tbody, customTableOptions)
|
||||||
dataObjects.forEach(dataObject => {
|
|
||||||
this.addRow(dataObject, tbody, customTableOptions);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.initShowMoreButtons();
|
this.initShowMoreButtons();
|
||||||
this.initCheckboxListeners();
|
this.initCheckboxListeners();
|
||||||
|
@ -492,6 +489,12 @@ export class BaseTable {
|
||||||
.catch(error => console.error('Error fetching objects:', error));
|
.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
|
// Add event listeners to table headers for sorting
|
||||||
initializeTableHeaders() {
|
initializeTableHeaders() {
|
||||||
this.tableHeaders.forEach(header => {
|
this.tableHeaders.forEach(header => {
|
||||||
|
|
|
@ -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;
|
const member = dataObject;
|
||||||
// member is based on either a UserPortfolioPermission or a PortfolioInvitation
|
// member is based on either a UserPortfolioPermission or a PortfolioInvitation
|
||||||
// and also includes information from related domains; the 'id' of the org_member
|
// 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 kebabHTML = customTableOptions.needsAdditionalColumn ? generateKebabHTML('remove-member', unique_id, cancelInvitationButton, `for ${member.name}`): '';
|
||||||
|
|
||||||
const row = document.createElement('tr');
|
const row = document.createElement('tr');
|
||||||
|
if (isLastRow) {
|
||||||
|
row.classList.add("hide-td-borders");
|
||||||
|
}
|
||||||
|
|
||||||
let admin_tagHTML = ``;
|
let admin_tagHTML = ``;
|
||||||
if (member.is_admin)
|
if (member.is_admin)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
:root,
|
:root,
|
||||||
html[data-theme="light"] {
|
html[data-theme="light"] {
|
||||||
--primary: #{$theme-color-primary};
|
--primary: #{$theme-color-primary};
|
||||||
--secondary: #{$theme-color-error};
|
--secondary: #{$theme-color-primary-darkest};
|
||||||
--accent: #{$theme-color-accent-cool};
|
--accent: #{$theme-color-accent-cool};
|
||||||
// --primary-fg: #fff;
|
// --primary-fg: #fff;
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,10 @@ a.text-secondary:hover {
|
||||||
color: $theme-color-error;
|
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 {
|
.usa-button--show-more-button {
|
||||||
font-size: size('ui', 'xs');
|
font-size: size('ui', 'xs');
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -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 {
|
.dotgov-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
@ -56,7 +64,7 @@ th {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr:not(.hide-td-borders):not(:last-of-type) {
|
tr:not(.hide-td-borders) {
|
||||||
td, th {
|
td, th {
|
||||||
border-bottom: 1px solid color('base-lighter');
|
border-bottom: 1px solid color('base-lighter');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue