-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TTAHUB-404] Add target populations to Grantee record page (#480)
* add label to input in search form * create new widget front and back * ui test * put it in a grid * fix ui test * clean up tests * radd scopes to goals for grant * I put the where in the wrong place (oopsie) * fix test * Add SES to the diagram * Add to ignored yarn vulnerabilities Co-authored-by: unknown <[email protected]>
- Loading branch information
1 parent
d9b8e4d
commit 19b8aee
Showing
15 changed files
with
352 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +0,0 @@ | ||
.reason-list { | ||
font-family: Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, | ||
sans-serif; | ||
height: calc(100% - 1.5rem); | ||
} | ||
|
||
.reason-list .usa-table-container--scrollable { | ||
min-height: 393px; | ||
max-height: 393px; | ||
overflow-y: auto; | ||
overflow-x: auto; | ||
} | ||
|
||
.reason-list .usa-table { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.reason-list .usa-table caption { | ||
margin-bottom: 26px; | ||
} | ||
|
||
.reason-list .usa-table tr { | ||
background-color: #fff; | ||
border-bottom: 0px; | ||
font-weight: bold; | ||
} | ||
|
||
.reason-list .usa-table th { | ||
border-bottom: 0px; | ||
text-align: left; | ||
padding: 0px; | ||
font-weight: bold; | ||
position: sticky; | ||
top: 0; | ||
background-color: white; | ||
} | ||
|
||
.reason-list .usa-table th:nth-child(2), .reason-list .usa-table td:nth-child(2) { | ||
padding-left: 60px; | ||
} | ||
|
||
.reason-list .usa-table td { | ||
border: none; | ||
padding-top: 10px; | ||
padding-bottom: 0px; | ||
padding-left: 0px; | ||
padding-right: 0px; | ||
text-align: left; | ||
} | ||
|
||
.reason-list .usa-table td:first-child { | ||
width: 320px; | ||
white-space: normal; | ||
} | ||
|
||
.reason-list .usa-table p:first-child { | ||
margin: 0px; | ||
padding: 0px; | ||
} | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.smarthub-table-widget { | ||
height: calc(100% - 1.5rem); | ||
} | ||
|
||
.smarthub-table-widget .usa-table-container--scrollable { | ||
min-height: 393px; | ||
max-height: 393px; | ||
overflow-y: auto; | ||
overflow-x: auto; | ||
} | ||
|
||
.smarthub-table-widget .usa-table { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.smarthub-table-widget .usa-table caption { | ||
margin-bottom: 26px; | ||
} | ||
|
||
.smarthub-table-widget .usa-table tr { | ||
background-color: #fff; | ||
border-bottom: 0px; | ||
font-weight: bold; | ||
} | ||
|
||
.smarthub-table-widget .usa-table th { | ||
border-bottom: 0px; | ||
text-align: left; | ||
padding: 0px; | ||
font-weight: bold; | ||
position: sticky; | ||
top: 0; | ||
background-color: white; | ||
} | ||
|
||
.smarthub-table-widget .usa-table th:nth-child(2), .smarthub-table-widget .usa-table td:nth-child(2) { | ||
padding-left: 60px; | ||
} | ||
|
||
.smarthub-table-widget .usa-table td { | ||
border: none; | ||
padding-top: 10px; | ||
padding-bottom: 0px; | ||
padding-left: 0px; | ||
padding-right: 0px; | ||
text-align: left; | ||
} | ||
|
||
.smarthub-table-widget .usa-table td:first-child { | ||
width: 320px; | ||
white-space: normal; | ||
} | ||
|
||
.smarthub-table-widget .usa-table p:first-child { | ||
margin: 0px; | ||
padding: 0px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Table } from '@trussworks/react-uswds'; | ||
import Container from '../components/Container'; | ||
import DateTime from '../components/DateTime'; | ||
import './TableWidget.css'; | ||
|
||
export default function TableWidget( | ||
{ | ||
data, | ||
headings, | ||
dateTime, | ||
showDateTime, | ||
loading, | ||
loadingLabel, | ||
title, | ||
renderData, | ||
}, | ||
) { | ||
return ( | ||
<Container className="smarthub-table-widget shadow-2" padding={3} loading={loading} loadingLabel={loadingLabel}> | ||
<div className="usa-table-container--scrollable margin-top-0"> | ||
<Table className="smart-hub--table-widget-table" fullWidth> | ||
<caption className="smart-hub--table-widget-caption"> | ||
<div className="display-flex flex-wrap flex-align-center"> | ||
<h2 className="smart-hub--table-widget-heading ttahub--dashboard-widget-heading margin-0">{title}</h2> | ||
{showDateTime && <DateTime classNames="margin-left-1 padding-x-1" timestamp={dateTime.timestamp} label={dateTime.label} /> } | ||
</div> | ||
</caption> | ||
<thead> | ||
<tr> | ||
{headings.map((heading) => <th key={heading.replace(' ', '_')} scope="col" className="text-left">{heading}</th>)} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{ renderData(data) } | ||
</tbody> | ||
</Table> | ||
</div> | ||
</Container> | ||
); | ||
} | ||
|
||
TableWidget.propTypes = { | ||
data: PropTypes.oneOfType([ | ||
PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
name: PropTypes.string, | ||
count: PropTypes.number, | ||
}), | ||
), PropTypes.shape({}), | ||
]), | ||
dateTime: PropTypes.shape({ | ||
timestamp: PropTypes.string, | ||
label: PropTypes.string, | ||
}), | ||
loading: PropTypes.bool.isRequired, | ||
loadingLabel: PropTypes.string.isRequired, | ||
title: PropTypes.string.isRequired, | ||
headings: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
renderData: PropTypes.func.isRequired, | ||
showDateTime: PropTypes.bool, | ||
}; | ||
|
||
TableWidget.defaultProps = { | ||
showDateTime: true, | ||
dateTime: { | ||
timestamp: '', | ||
label: '', | ||
}, | ||
data: [], | ||
}; |
Oops, something went wrong.