-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* System name field prop pass * Crumb text * Snap * AdminRequestHeaderSummary * Trb header * Itgov header * Cleanup * Uniform test references
- Loading branch information
Showing
12 changed files
with
225 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Grid } from '@trussworks/react-uswds'; | ||
|
||
import { SystemIntake_systems as System } from 'queries/types/SystemIntake'; | ||
import { RequestRelationType } from 'types/graphql-global-types'; | ||
import { formatDateLocal } from 'utils/date'; | ||
import getSystemOrContractName from 'utils/getSystemOrContractName'; | ||
|
||
// Some properties are just display strings passed in after any parsing, | ||
// because original ITG & TRB objects are different. | ||
type AdminRequestHeaderSummaryProps = { | ||
requestName: string; | ||
submittedAt: string; | ||
requestType: string; | ||
relationType: RequestRelationType | null; | ||
contractName: string | null; | ||
systems: System[]; | ||
requester: string; | ||
trbRequesterTestId?: string; | ||
contractNumbers: string[]; | ||
}; | ||
|
||
function AdminRequestHeaderSummary({ | ||
requestName, | ||
submittedAt, | ||
requestType, | ||
relationType, | ||
contractName, | ||
systems, | ||
requester, | ||
trbRequesterTestId = '', | ||
contractNumbers | ||
}: AdminRequestHeaderSummaryProps) { | ||
const { t } = useTranslation('governanceReviewTeam'); | ||
return ( | ||
<> | ||
{/* Request summary */} | ||
<div className="display-flex flex-align-end flex-wrap margin-bottom-2"> | ||
<h2 className="margin-top-05 margin-bottom-0 margin-right-2"> | ||
{requestName} | ||
</h2> | ||
<p | ||
className="margin-y-05 text-primary-light" | ||
data-testid="summary-submissionDate" | ||
> | ||
{t('submittedOn', { | ||
date: formatDateLocal(submittedAt, 'MM/dd/yyyy') | ||
})} | ||
</p> | ||
</div> | ||
|
||
<Grid row gap> | ||
<Grid tablet={{ col: 8 }}> | ||
<h5 className="text-normal margin-y-0">{t('requestType')}</h5> | ||
<h4 className="margin-top-05 margin-bottom-2">{requestType}</h4> | ||
|
||
<h5 className="text-normal margin-y-0"> | ||
{t('systemServiceContractName')} | ||
</h5> | ||
<h4 className="margin-top-05 margin-bottom-2"> | ||
{getSystemOrContractName(relationType, contractName, systems)} | ||
</h4> | ||
</Grid> | ||
|
||
<Grid tablet={{ col: 4 }}> | ||
<h5 className="text-normal margin-y-0"> | ||
{t('intake:contactDetails.requester')} | ||
</h5> | ||
<h4 | ||
className="margin-top-05 margin-bottom-2" | ||
data-testid={trbRequesterTestId} | ||
> | ||
{requester} | ||
</h4> | ||
|
||
<h5 className="text-normal margin-y-0"> | ||
{t('intake:review.contractNumber')} | ||
</h5> | ||
<h4 className="margin-top-05 margin-bottom-2"> | ||
{contractNumbers.join(', ') || t('noneSpecified')} | ||
</h4> | ||
</Grid> | ||
</Grid> | ||
</> | ||
); | ||
} | ||
|
||
export default AdminRequestHeaderSummary; |
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
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
Oops, something went wrong.