Skip to content
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: ✨ CANs List #2804

Merged
merged 52 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
00d372b
refactor: starts CANs list
fpigeonjr Sep 16, 2024
ee280fc
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 16, 2024
1f8adcf
feat: adds CANTable and friends
fpigeonjr Sep 16, 2024
2bcbc40
refactor: conditionally render button
fpigeonjr Sep 17, 2024
d2163a3
feat: adds mycans bool
fpigeonjr Sep 17, 2024
f7a1d5e
feat: adds method_of_transfer to cans data
fpigeonjr Sep 17, 2024
099e037
refactor: use ENUM over string
fpigeonjr Sep 17, 2024
20cdd31
test: starts tests for CANs list page
fpigeonjr Sep 17, 2024
3f816a7
feat: adds method_of_transfer helper
fpigeonjr Sep 17, 2024
8544d81
refactor: replaces with RTK Query
fpigeonjr Sep 17, 2024
0cd5176
feat: adds available funds to table row
fpigeonjr Sep 17, 2024
9ab9987
chore: remove unneeded modules
fpigeonjr Sep 17, 2024
2816894
style: fix links styles
fpigeonjr Sep 17, 2024
ebfe488
chore: comment debug code
fpigeonjr Sep 17, 2024
da032ee
docs: adds some type files
fpigeonjr Sep 18, 2024
9b74c2d
docs: adds type file for Projects
fpigeonjr Sep 18, 2024
6e456cb
chore: fix import
fpigeonjr Sep 18, 2024
dce566f
docs: rename to `d.ts`
fpigeonjr Sep 18, 2024
62d8e7b
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 18, 2024
9dc6053
test: fix method_of_transfer
fpigeonjr Sep 19, 2024
dae5463
test: fixes method_of_transfer
fpigeonjr Sep 19, 2024
9c0480e
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 19, 2024
567b1e9
chore: cleanup import
fpigeonjr Sep 19, 2024
2fe0009
chore: cleanup linting issues
fpigeonjr Sep 19, 2024
eabf3ce
feat: adds Tooltip
fpigeonjr Sep 19, 2024
98f964f
chore: add nickName to test data
fpigeonjr Sep 19, 2024
bc41c34
chore: remove unneeded constant
fpigeonjr Sep 19, 2024
e88603c
refactor: better prop naming
fpigeonjr Sep 19, 2024
d722d28
chore: remove Debug code
fpigeonjr Sep 19, 2024
7e26cc4
feat: adds Tooltip to Table Heading
fpigeonjr Sep 19, 2024
230ddef
refactor: better RTK Query
fpigeonjr Sep 19, 2024
790137f
docs: use new BudgetLine Types
fpigeonjr Sep 19, 2024
21fb9ae
feat: adds Pagination
fpigeonjr Sep 19, 2024
5de24a7
docs: better types
fpigeonjr Sep 19, 2024
d1c185e
docs: updates types
fpigeonjr Sep 19, 2024
3b42de9
refactor: moves CanTabs to Cans dir
fpigeonjr Sep 19, 2024
e66c29c
chore: remove unneeded module
fpigeonjr Sep 19, 2024
d4e06ad
test: adds unit-test for CANTable
fpigeonjr Sep 19, 2024
0130308
test: adds test for CANTableRow
fpigeonjr Sep 19, 2024
9f8d9a1
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 20, 2024
b5c24f8
test: 🤷 fix da test?
fpigeonjr Sep 20, 2024
32e1f82
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 20, 2024
12a3b67
test: adds pagination test
fpigeonjr Sep 20, 2024
c28fd30
Merge branch 'OPS-346/FE_round_1' of github.com:HHS/OPRE-OPS into OPS…
fpigeonjr Sep 20, 2024
03334ca
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 20, 2024
490eb4f
docs: add docs for TS and JSDocs examples and usage
fpigeonjr Sep 20, 2024
f49a9c5
docs: adds Prime's inspiration for all this
fpigeonjr Sep 20, 2024
a90c1c3
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 23, 2024
9387068
chore: add optional types
fpigeonjr Sep 23, 2024
2a82861
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 24, 2024
9185c27
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 24, 2024
eb9ade0
Merge branch 'main' into OPS-346/FE_round_1
fpigeonjr Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 55 additions & 38 deletions backend/data_tools/data/can_data.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,104 @@
fiscal_year: 2023,
fund_code: "AAXXXX20231DAD",
funding_source: "OPRE",
method_of_transfer: "DIRECT",
},
{
// 2
fiscal_year: 2021,
fund_code: "BBXXXX20215DAD",
method_of_transfer: "COST_SHARE",
},
{
// 3
fiscal_year: 2022,
fund_code: "CCXXXX20225DAD"
fund_code: "CCXXXX20225DAD",
method_of_transfer: "IDDA",
},
{
// 4
fiscal_year: 2021,
fund_code: "DDXXXX20215DAD",
method_of_transfer: "IAA",
},
{
// 5
fiscal_year: 2021,
fund_code: "EEXXXX20215DAD",
method_of_transfer: "IDDA",
},
{
// 6
fiscal_year: 2021,
fund_code: "FFXXXX20215DAD"
fund_code: "FFXXXX20215DAD",
method_of_transfer: "DIRECT",
},
{
// 7
fiscal_year: 2023,
fund_code: "GGXXXX20231DAD"
fund_code: "GGXXXX20231DAD",
method_of_transfer: "DIRECT",
},
{
// 8
fiscal_year: 2023,
fund_code: "HHXXXX20231DAD"
fund_code: "HHXXXX20231DAD",
method_of_transfer: "IDDA",
},
{
// 9
fiscal_year: 2023,
fund_code: "IIXXXX20231DAD"
fund_code: "IIXXXX20231DAD",
method_of_transfer: "IAA",
},
{
// 10
fiscal_year: 2023,
fund_code: "JJXXXX20231DAD"
fund_code: "JJXXXX20231DAD",
method_of_transfer: "DIRECT",
},
{
// 11
fiscal_year: 2023,
fund_code: "KKXXXX20235DAD"
fund_code: "KKXXXX20235DAD",
method_of_transfer: "IDDA",
},
{
// 12
fiscal_year: 2022,
fund_code: "LLXXXX20225DAD"
fund_code: "LLXXXX20225DAD",
method_of_transfer: "IAA",
},
{
// 13
fiscal_year: 2023,
fund_code: "MMXXXX20235DAD"
fund_code: "MMXXXX20235DAD",
method_of_transfer: "DIRECT",
},
{
// 14
fiscal_year: 2023,
fund_code: "NNXXXX20231DAD"
fund_code: "NNXXXX20231DAD",
method_of_transfer: "IDDA",
},
{
// 15
fiscal_year: 2023,
fund_code: "OOXXXX20235DAD"
fund_code: "OOXXXX20235DAD",
method_of_transfer: "DIRECT",
},
{
// 16
fiscal_year: 2023,
fund_code: "PPXXXX20235DAD"
fund_code: "PPXXXX20235DAD",
method_of_transfer: "DIRECT",
},
{
// 17
fiscal_year: 2023,
fund_code: "QQXXXX20235DAD"
}
fund_code: "QQXXXX20235DAD",
method_of_transfer: "IDDA",
},
],
can: [
{
Expand All @@ -94,142 +111,142 @@
description: "Healthy Marriages Responsible Fatherhood - OPRE",
nick_name: "HMRF-OPRE",
portfolio_id: 6,
funding_details_id: 1
funding_details_id: 1,
},
{
// 501
number: "G99IA14",
description: "Incoming Interagency Agreements",
nick_name: "IAA-Incoming",
portfolio_id: 1,
funding_details_id: 2
funding_details_id: 2,
},
{
// 502
number: "G99PHS9",
description: "Social Science Research and Development",
nick_name: "SSRD",
portfolio_id: 8,
funding_details_id: 3
funding_details_id: 3,
},
{
// 503
number: "G990136",
description: "Child Development Research Fellowship Grant Program",
nick_name: "ASPE SRCD-IDDA",
portfolio_id: 1,
funding_details_id: 4
funding_details_id: 4,
},
{
// 504
number: "G994426",
description: "Head Start Research",
nick_name: "HS",
portfolio_id: 2,
funding_details_id: 5
funding_details_id: 5,
},
{
// 505
number: "G994648",
description: "Kinship Navigation",
nick_name: "Kin-Nav",
portfolio_id: 6,
funding_details_id: 6
funding_details_id: 6,
},
{
// 506
number: "G996125",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 7
funding_details_id: 7,
},
{
// 507
number: "G99XXX1",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 8
funding_details_id: 8,
},
{
// 508
number: "G99XXX2",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 9
funding_details_id: 9,
},
{
// 509
number: "G99XXX3",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 10
funding_details_id: 10,
},
{
// 510
number: "G99XXX4",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 11
funding_details_id: 11,
},
{
// 511
number: "G99XXX7",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 12
funding_details_id: 12,
},
{
// 512
number: "G99XXX8",
description: "Example CAN",
nick_name: "",
nick_name: "Next Generation Leadership Program",
portfolio_id: 3,
funding_details_id: 13,
projects: [
{
"tablename": "project",
"id": 1000
}
]
tablename: "project",
id: 1000,
},
],
},
{
// 513
number: "G99MV23",
description: "MIHOPE Check-in 2023",
nick_name: "MIHOPE 23",
portfolio_id: 3,
funding_details_id: 14
funding_details_id: 14,
},
{
// 514
number: "G99MV24",
description: "MIHOPE Check-in 2024",
nick_name: "MIHOPE 24",
portfolio_id: 3,
funding_details_id: 15
funding_details_id: 15,
},
{
// 515
number: "G99MVT3",
description: "MOHOPE Long-Term",
nick_name: "MIHOPE LT",
portfolio_id: 3,
funding_details_id: 16
funding_details_id: 16,
},
{
// 516
number: "G99SHARED",
description: "Shared CAN",
nick_name: "SHARED",
portfolio_id: 3,
funding_details_id: 17
}
funding_details_id: 17,
},
],
can_funding_budget: [
{
Expand Down Expand Up @@ -386,7 +403,7 @@
fiscal_year: 2023,
can_id: 516,
budget: 500000.0,
}
},
],
can_funding_received: [
{
Expand Down Expand Up @@ -518,6 +535,6 @@
fiscal_year: 2023,
can_id: 515,
funding: 1000000.0,
}
},
],
}
4 changes: 2 additions & 2 deletions backend/ops_api/ops/schemas/cans.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from marshmallow import Schema, fields

from models import PortfolioStatus
from models import PortfolioStatus, CANMethodOfTransfer
from ops_api.ops.schemas.budget_line_items import BudgetLineItemResponseSchema
from ops_api.ops.schemas.projects import ProjectSchema
from ops_api.ops.schemas.users import SafeUserSchema
Expand Down Expand Up @@ -90,7 +90,7 @@ class FundingDetailsSchema(Schema):
funding_partner = fields.String(allow_none=True)
funding_source = fields.String(allow_none=True)
id = fields.Integer(required=True)
method_of_transfer = fields.String(allow_none=True)
method_of_transfer = fields.Enum(CANMethodOfTransfer, allow_none=True)
sub_allowance = fields.String(allow_none=True)
created_on = fields.DateTime(format="%Y-%m-%dT%H:%M:%S.%fZ", allow_none=True)
updated_on = fields.DateTime(format="%Y-%m-%dT%H:%M:%S.%fZ", allow_none=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_get_can_funding_summary_no_fiscal_year(loaded_db, test_can) -> None:
"funding_partner": None,
"funding_source": "OPRE",
"id": 1,
"method_of_transfer": None,
"method_of_transfer": "DIRECT",
"sub_allowance": None,
"updated_by": None,
"updated_by_user": None,
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_get_can_funding_summary_with_fiscal_year(loaded_db, test_can) -> None:
"funding_partner": None,
"funding_source": "OPRE",
"id": 1,
"method_of_transfer": None,
"method_of_transfer": "DIRECT",
"sub_allowance": None,
"updated_by": None,
"updated_by_user": None,
Expand Down
Loading
Loading