Shrink max-width of tables in widescreen. Constrict Action column to 80px. Add Action column updates to Members table.

This commit is contained in:
CocoByte 2025-02-03 13:07:36 -07:00
parent 73e0cb5adc
commit dca2f635a2
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
6 changed files with 21 additions and 25 deletions

View file

@ -79,6 +79,8 @@ services:
- POSTGRES_DB=app - POSTGRES_DB=app
- POSTGRES_USER=user - POSTGRES_USER=user
- POSTGRES_PASSWORD=feedabee - POSTGRES_PASSWORD=feedabee
ports:
- "5432:5432"
node: node:
build: build:

View file

@ -116,8 +116,8 @@ export class DomainRequestsTable extends BaseTable {
<td data-label="Status"> <td data-label="Status">
${request.status} ${request.status}
</td> </td>
<td class="${ this.portfolioValue ? '' : "width-quarter"}"> <td class="width--action-column">
<div class="tablet:display-flex tablet:flex-row"> <div class="tablet:display-flex tablet:flex-row flex-wrap">
<a href="${actionUrl}" ${customTableOptions.hasAdditionalActions ? "class='margin-right-2'" : ''}> <a href="${actionUrl}" ${customTableOptions.hasAdditionalActions ? "class='margin-right-2'" : ''}>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24"> <svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
<use xlink:href="/public/img/sprite.svg#${request.svg_icon}"></use> <use xlink:href="/public/img/sprite.svg#${request.svg_icon}"></use>

View file

@ -56,7 +56,7 @@ export class DomainsTable extends BaseTable {
</svg> </svg>
</td> </td>
${markupForSuborganizationRow} ${markupForSuborganizationRow}
<td class="${ this.portfolioValue ? '' : "width-quarter"}"> <td class="${ this.portfolioValue ? '' : "width--action-column"}">
<a href="${actionUrl}"> <a href="${actionUrl}">
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24"> <svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
<use xlink:href="/public/img/sprite.svg#${domain.svg_icon}"></use> <use xlink:href="/public/img/sprite.svg#${domain.svg_icon}"></use>

View file

@ -48,18 +48,6 @@ export class MembersTable extends BaseTable {
// Get whether the logged in user has edit members permission // Get whether the logged in user has edit members permission
const hasEditPermission = this.portfolioElement ? this.portfolioElement.getAttribute('data-has-edit-permission')==='True' : null; const hasEditPermission = this.portfolioElement ? this.portfolioElement.getAttribute('data-has-edit-permission')==='True' : null;
let existingExtraActionsHeader = document.querySelector('.extra-actions-header');
if (hasEditPermission && !existingExtraActionsHeader) {
const extraActionsHeader = document.createElement('th');
extraActionsHeader.setAttribute('id', 'extra-actions');
extraActionsHeader.setAttribute('role', 'columnheader');
extraActionsHeader.setAttribute('class', 'extra-actions-header width-5');
extraActionsHeader.innerHTML = `
<span class="usa-sr-only">Extra Actions</span>`;
let tableHeaderRow = this.tableWrapper.querySelector('thead tr');
tableHeaderRow.appendChild(extraActionsHeader);
}
return { return {
'hasAdditionalActions': hasEditPermission, 'hasAdditionalActions': hasEditPermission,
'UserPortfolioPermissionChoices' : data.UserPortfolioPermissionChoices 'UserPortfolioPermissionChoices' : data.UserPortfolioPermissionChoices
@ -121,15 +109,17 @@ export class MembersTable extends BaseTable {
<td headers="header-last-active row-header-${unique_id}" data-sort-value="${last_active.sort_value}" data-label="last_active"> <td headers="header-last-active row-header-${unique_id}" data-sort-value="${last_active.sort_value}" data-label="last_active">
${last_active.display_value} ${last_active.display_value}
</td> </td>
<td headers="header-action row-header-${unique_id}"> <td headers="header-action row-header-${unique_id}" class="width--action-column">
<div class="tablet:display-flex tablet:flex-row">
<a href="${member.action_url}"> <a href="${member.action_url}">
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24"> <svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
<use xlink:href="/public/img/sprite.svg#${member.svg_icon}"></use> <use xlink:href="/public/img/sprite.svg#${member.svg_icon}"></use>
</svg> </svg>
${member.action_label} <span class="usa-sr-only">${member.name}</span> ${member.action_label} <span class="usa-sr-only">${member.name}</span>
</a> </a>
<span class="padding-left-1">${customTableOptions.hasAdditionalActions ? kebabHTML : ''}</span>
</div>
</td> </td>
${customTableOptions.hasAdditionalActions ? '<td>'+kebabHTML+'</td>' : ''}
`; `;
tbody.appendChild(row); tbody.appendChild(row);
if (domainsHTML || permissionsHTML) { if (domainsHTML || permissionsHTML) {

View file

@ -1,7 +1,7 @@
@use "uswds-core" as *; @use "uswds-core" as *;
@use "cisa_colors" as *; @use "cisa_colors" as *;
$widescreen-max-width: 1920px; $widescreen-max-width: 1536px; //1920px;
$widescreen-x-padding: 4.5rem; $widescreen-x-padding: 4.5rem;
$hot-pink: #FFC3F9; $hot-pink: #FFC3F9;
@ -275,3 +275,7 @@ abbr[title] {
.width-quarter { .width-quarter {
width: 25%; width: 25%;
} }
.width--action-column {
max-width: 80px;
}

View file

@ -59,7 +59,7 @@
role="columnheader" role="columnheader"
id="header-action" id="header-action"
> >
<span class="usa-sr-only">Action</span> Action
</th> </th>
</tr> </tr>
</thead> </thead>