-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ✨adds pagination to Can Budget Lines #3078
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac9d144
feat: adds pagination
fpigeonjr fac8f86
test: adds e2e test
fpigeonjr cdeb9e6
test: adds waiting
fpigeonjr 8da07c2
Merge branch 'main' into OPS-2672/3053_pagination
fpigeonjr 1bf60c4
feat: adds CANFundingInfoCard
fpigeonjr 67d460f
Merge branch 'OPS-2672/3053_pagination' of github.com:HHS/OPRE-OPS in…
fpigeonjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
118 changes: 118 additions & 0 deletions
118
frontend/src/components/CANs/CANFundingInfoCard/CANFundingInfoCard.jsx
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,118 @@ | ||
import { NO_DATA } from "../../../constants"; | ||
import Card from "../../UI/Cards/Card"; | ||
import TermTag from "../../UI/Term/TermTag"; | ||
/** | ||
* @typedef {import("../../../components/CANs/CANTypes").FundingDetails} FundingDetails | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} CANFundingInfoCard | ||
* @property {FundingDetails} [funding] | ||
* @property {number} fiscalYear | ||
*/ | ||
|
||
/** | ||
* @component - The CAN Funding component. | ||
* @param {CANFundingInfoCard} props | ||
* @returns {JSX.Element} - The component JSX. | ||
*/ | ||
const CANFundingInfoCard = ({ funding, fiscalYear }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't mean to include this but here we are |
||
if (!funding) { | ||
return <div>No funding information available for this CAN.</div>; | ||
} | ||
|
||
return ( | ||
<Card className="width-full"> | ||
<h3 | ||
className="margin-0 margin-bottom-2 font-12px text-base-dark text-normal" | ||
style={{ whiteSpace: "pre-line", lineHeight: "20px" }} | ||
> | ||
{`FY ${fiscalYear} CAN Funding Information`} | ||
</h3> | ||
<div className="grid-row grid-gap"> | ||
<div className="grid-col"> | ||
<dl> | ||
<TermTag | ||
term="FY" | ||
description={funding.fiscal_year.toString()} | ||
/> | ||
<TermTag | ||
term="Fund Code" | ||
description={funding.fund_code} | ||
/> | ||
</dl> | ||
</div> | ||
<div className="grid-col"> | ||
<dl> | ||
{funding.active_period && ( | ||
<TermTag | ||
term="Active Period" | ||
description={ | ||
funding.active_period > 1 | ||
? `${funding.active_period} Years` | ||
: `${funding.active_period} Year` | ||
} | ||
/> | ||
)} | ||
<TermTag | ||
term="Allowance" | ||
description={funding.allowance ?? NO_DATA} | ||
/> | ||
</dl> | ||
</div> | ||
<div className="grid-col"> | ||
<dl> | ||
<TermTag | ||
term="Obligate By" | ||
description={funding.obligate_by?.toString() ?? NO_DATA} | ||
/> | ||
<TermTag | ||
term="Allotment" | ||
description={funding.allotment ?? NO_DATA} | ||
/> | ||
</dl> | ||
</div> | ||
<div className="grid-col"> | ||
<dl> | ||
{/* TODO: ask where this comes from */} | ||
<TermTag | ||
term="Funding Received*" | ||
description={NO_DATA} | ||
/> | ||
<TermTag | ||
term="Funding Source" | ||
description={funding.funding_source ?? NO_DATA} | ||
/> | ||
</dl> | ||
</div> | ||
<div className="grid-col"> | ||
<dl> | ||
<TermTag | ||
term="Funding Method" | ||
description={funding.method_of_transfer} | ||
/> | ||
<TermTag | ||
term="Partner" | ||
description={funding.funding_partner ?? NO_DATA} | ||
/> | ||
</dl> | ||
</div> | ||
<div className="grid-col"> | ||
<dl> | ||
{/* TODO: ask where this comes from */} | ||
<TermTag | ||
term="Funding Type*" | ||
description={NO_DATA} | ||
/> | ||
<TermTag | ||
term="Method of Transfer" | ||
description={funding.method_of_transfer ?? NO_DATA} | ||
/> | ||
</dl> | ||
</div> | ||
</div> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default CANFundingInfoCard; |
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 @@ | ||
export { default } from "./CANFundingInfoCard"; |
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 |
---|---|---|
|
@@ -66,16 +66,18 @@ export type FundingBudget = { | |
}; | ||
|
||
export type FundingDetails = { | ||
active_period?: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rajohnson90 you may want to check the schema since I don't see these additions in the OpenAPI spec |
||
allotment?: string; | ||
allowance?: string; | ||
appropriation?: string; | ||
display_name?: string; | ||
fiscal_year: number; | ||
fund_code: string; | ||
funding_partner?: string; | ||
funding_source?: string; | ||
funding_source?: "OPRE" | "ACF" | "HHS"; | ||
id: number; | ||
method_of_transfer?: keyof typeof CAN_TRANSFER; | ||
obligate_by?: number; | ||
sub_allowance?: string; | ||
created_by?: any; | ||
created_by_user?: any; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
border-style: solid; | ||
} | ||
|
||
.cardBody { | ||
/* .cardBody { | ||
flex: 3; | ||
} | ||
} */ |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐ crux of the PR