Skip to content

Commit

Permalink
Merge branch 'main' into OPS-310/3236_prev_FY_carry_forward_card
Browse files Browse the repository at this point in the history
  • Loading branch information
fpigeonjr authored Jan 15, 2025
2 parents 1b1e92b + 3bdb8e0 commit bcb44d9
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: wagoid/commitlint-github-action@0184f5a228ee06430bb9e67d65f73a1a6767496a # v6
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6
2 changes: 1 addition & 1 deletion .github/workflows/security_semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Semgrep Analyze
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep@sha256:5145f6e54f8df98588023f56c66acbf25d0909c2655c16e4c104eefca6e735f8 # 1.47.0
image: returntocorp/semgrep@sha256:bab808dd7cfef7584b75c36ce4f9bd29cb421cd0a383eee925350e4645360bae # 1.47.0
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""adding new CAN Method of Transfer
Revision ID: 52bf070f396e
Revises: 6615ac7d4eea
Create Date: 2025-01-14 06:16:14.707739+00:00
"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op
from alembic_postgresql_enum import TableReference

# revision identifiers, used by Alembic.
revision: str = '52bf070f396e'
down_revision: Union[str, None] = '6615ac7d4eea'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values(
enum_schema='ops',
enum_name='canmethodoftransfer',
new_values=['DIRECT', 'COST_SHARE', 'IAA', 'IDDA', 'OTHER'],
affected_columns=[TableReference(table_schema='ops', table_name='can_funding_details', column_name='method_of_transfer'), TableReference(table_schema='ops', table_name='can_funding_details_version', column_name='method_of_transfer')],
enum_values_to_rename=[],
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values(
enum_schema='ops',
enum_name='canmethodoftransfer',
new_values=['DIRECT', 'COST_SHARE', 'IAA', 'IDDA'],
affected_columns=[TableReference(table_schema='ops', table_name='can_funding_details', column_name='method_of_transfer'), TableReference(table_schema='ops', table_name='can_funding_details_version', column_name='method_of_transfer')],
enum_values_to_rename=[],
)
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion backend/data_tools/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cfenv = "==0.5.3"
typing-extensions = "==4.12.2"
desert = "2022.9.22"
sqlalchemy-continuum = "==1.4.2"
marshmallow-sqlalchemy = "==1.2.0"
marshmallow-sqlalchemy = "==1.3.0"
marshmallow-enum = "==1.5.1"
alembic = "==1.14.0"
alembic-postgresql-enum = "==1.5.0"
Expand Down
8 changes: 4 additions & 4 deletions backend/data_tools/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/models/cans.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CANMethodOfTransfer(Enum):
COST_SHARE = auto()
IAA = auto()
IDDA = auto()
OTHER = auto()


class CANStatus(Enum):
Expand Down
3 changes: 3 additions & 0 deletions backend/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ paths:
- COST_SHARE
- IAA
- IDDA
- OTHER
example: [ "DIRECT", "IAA" ]
- name: portfolio
in: query
Expand Down Expand Up @@ -2967,6 +2968,7 @@ components:
- COST_SHARE
- IAA
- IDDA
- OTHER
sub_allowance:
type: string
FundingDetails:
Expand Down Expand Up @@ -3002,6 +3004,7 @@ components:
- COST_SHARE
- IAA
- IDDA
- OTHER
sub_allowance:
type: string
created_on:
Expand Down
2 changes: 1 addition & 1 deletion backend/ops_api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ loguru = "==0.7.3"
markupsafe = "==3.0.2"
marshmallow-dataclass = "==8.7.1"
marshmallow-enum = "==1.5.1"
marshmallow-sqlalchemy = "==1.2.0"
marshmallow-sqlalchemy = "==1.3.0"
mypy = "==1.14.1"
psycopg2-binary = "==2.9.10"
PyYAML = "==6.0.2"
Expand Down
8 changes: 4 additions & 4 deletions backend/ops_api/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_can_get_can_funding_summary_invalid_transfer(auth_client: FlaskClient):
query_params = f"can_ids={0}&fiscal_year=2023&transfer=INVALID"
response = auth_client.get(f"/api/v1/can-funding-summary?{query_params}")
assert response.status_code == 400
assert response.json["Error"] == "Invalid 'transfer' value. Must be one of: DIRECT, COST_SHARE, IAA, IDDA."
assert response.json["Error"] == "Invalid 'transfer' value. Must be one of: DIRECT, COST_SHARE, IAA, IDDA, OTHER."


def test_can_get_can_funding_summary_mou_transfer(auth_client: FlaskClient):
Expand Down
Binary file modified frontend/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@azure/storage-blob": "12.26.0",
"@eslint/compat": "1.2.4",
"@eslint/js": "9.17.0",
"@eslint/js": "9.18.0",
"@fortawesome/fontawesome-svg-core": "6.5.2",
"@fortawesome/free-regular-svg-icons": "6.5.2",
"@fortawesome/free-solid-svg-icons": "6.5.2",
Expand All @@ -21,7 +21,7 @@
"axios": "1.7.9",
"clsx": "2.1.1",
"crypto-random-string": "5.0.0",
"eslint": "9.17.0",
"eslint": "9.18.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-cypress": "4.1.0",
"eslint-plugin-import": "2.31.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/CANs/CAN.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export const CAN_TRANSFER = {
DIRECT: "Direct",
COST_SHARE: "COST_SHARE",
IDDA: "IDDA",
IAA: "IAA"
IAA: "IAA",
OTHER: "OTHER"
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const CANTransferComboBox = ({
{ id: 1, title: convertCodeForDisplay("methodOfTransfer", CAN_TRANSFER.DIRECT) },
{ id: 2, title: convertCodeForDisplay("methodOfTransfer", CAN_TRANSFER.COST_SHARE) },
{ id: 3, title: convertCodeForDisplay("methodOfTransfer", CAN_TRANSFER.IAA) },
{ id: 4, title: convertCodeForDisplay("methodOfTransfer", CAN_TRANSFER.IDDA) }
{ id: 4, title: convertCodeForDisplay("methodOfTransfer", CAN_TRANSFER.IDDA) },
{ id: 5, title: convertCodeForDisplay("methodOfTransfer", CAN_TRANSFER.OTHER) }
];

return (
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ export const codesToDisplayText = {
},
methodOfTransfer: {
DIRECT: "Direct",
COST_SHARE: "MOU",
COST_SHARE: "Cost Share",
IAA: "IAA",
IDDA: "IDDA"
IDDA: "IDDA",
OTHER: "Other"
},
project: {
ADMINISTRATIVE_AND_SUPPORT: "Admin & Support",
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/cans/list/CanList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ const CanList = () => {

const activePeriodIds = filters.activePeriod.map((ap) => ap.id);
const transferTitles = filters.transfer.map((t) => {
const title = t.title.toUpperCase();
return title === "MOU" ? "COST_SHARE" : title;
return t.title.toUpperCase();
});
const portfolioAbbreviations = filters.portfolio.map((p) => p.abbr);

Expand Down

0 comments on commit bcb44d9

Please sign in to comment.