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

2897 finalized reporting language #2962

Merged
merged 19 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
24 changes: 12 additions & 12 deletions tdrs-backend/tdpservice/data_files/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,23 @@ def assert_error_report_tanf_file_content_matches_with_friendly_names(response):
"""Assert the error report file contents match expected with friendly names."""
ws = DataFileAPITestBase.get_spreadsheet(response)

COL_ERROR_MESSAGE = 5
COL_ERROR_MESSAGE = 4

assert ws.cell(row=1, column=1).value == "Error reporting in TDP is still in development.We'll" \
+ " be in touch when it's ready to use!For now please refer to the reports you receive via email"
assert ws.cell(row=4, column=COL_ERROR_MESSAGE).value == "if cash amount :873 validator1 passed" \
assert ws.cell(row=1, column=1).value == "Please refer to the most recent versions of the coding " \
+ "instructions (linked below) when looking up items and allowable values during the data revision process"
assert ws.cell(row=7, column=COL_ERROR_MESSAGE).value == "if cash amount :873 validator1 passed" \
+ " then number of months T1: 0 is not larger than 0."

@staticmethod
def assert_error_report_ssp_file_content_matches_with_friendly_names(response):
"""Assert the error report file contents match expected with friendly names."""
ws = DataFileAPITestBase.get_spreadsheet(response)

COL_ERROR_MESSAGE = 5
COL_ERROR_MESSAGE = 4

assert ws.cell(row=1, column=1).value == "Error reporting in TDP is still in development.We'll" \
+ " be in touch when it's ready to use!For now please refer to the reports you receive via email"
assert ws.cell(row=4, column=COL_ERROR_MESSAGE).value == "TRAILER record length is 15 characters " + \
assert ws.cell(row=1, column=1).value == "Please refer to the most recent versions of the coding " \
+ "instructions (linked below) when looking up items and allowable values during the data revision process"
assert ws.cell(row=7, column=COL_ERROR_MESSAGE).value == "TRAILER record length is 15 characters " + \
"but must be 23."

@staticmethod
Expand All @@ -130,11 +130,11 @@ def assert_error_report_file_content_matches_without_friendly_names(response):
wb = openpyxl.load_workbook('mycls.xlsx')
ws = wb.get_sheet_by_name('Sheet1')

COL_ERROR_MESSAGE = 5
COL_ERROR_MESSAGE = 4

assert ws.cell(row=1, column=1).value == "Error reporting in TDP is still in development.We'll" \
+ " be in touch when it's ready to use!For now please refer to the reports you receive via email"
assert ws.cell(row=4, column=COL_ERROR_MESSAGE).value == ("if CASH_AMOUNT :873 validator1 passed then "
assert ws.cell(row=1, column=1).value == "Please refer to the most recent versions of the coding " \
+ "instructions (linked below) when looking up items and allowable values during the data revision process"
assert ws.cell(row=7, column=COL_ERROR_MESSAGE).value == ("if CASH_AMOUNT :873 validator1 passed then "
"NBR_MONTHS T1: 0 is not larger than 0.")

@staticmethod
Expand Down
36 changes: 30 additions & 6 deletions tdrs-backend/tdpservice/data_files/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def format_error_msg(x):
('month', lambda x: calendar.month_name[
int(str(x['rpt_month_year'])[4:])
] if x['rpt_month_year'] else None),
('error_type', lambda x: x['error_type']),
('error_message', lambda x: format_error_msg(chk(x))),
('item_number', lambda x: x['item_number']),
('item_name', lambda x: ','.join([i for i in chk(x)['fields_json']['friendly_name'].values()])),
Expand All @@ -52,11 +51,36 @@ def format_error_msg(x):
]

# write beta banner
worksheet.write(row, col,
"Error reporting in TDP is still in development." +
"We'll be in touch when it's ready to use!" +
"For now please refer to the reports you receive via email")
worksheet.write(
row, col,
"Please refer to the most recent versions of the coding " +
"instructions (linked below) when looking up items " +
"and allowable values during the data revision process"
)

row, col = 1, 0
worksheet.write_url(
row, col,
'https://www.acf.hhs.gov/ofa/policy-guidance/tribal-tanf-data-coding-instructions',
string='Tribal TANF Instructions'
ADPennington marked this conversation as resolved.
Show resolved Hide resolved
)

row, col = 2, 0
worksheet.write_url(
row, col,
'https://www.acf.hhs.gov/ofa/policy-guidance/acf-ofa-pi-23-04',
string='TANF / SSP-MOE (ACF-199 / ACF-209) Instructions'
)

row, col = 3, 0
worksheet.write_url(
row, col,
'https://tdp-project-updates.app.cloud.gov/knowledge-center/viewing-error-reports.html',
Copy link
Author

@jtimpe jtimpe Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the link provided in the ticket, but it currently 404s - @reitermb

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should start working as soon as we merge #2969

string='Visit the Knowledge Center for further guidance on interpreting error reports'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string='Visit the Knowledge Center for further guidance on interpreting error reports'
string='Visit the Knowledge Center for further guidance on reviewing error reports'

)

row, col = 5, 0

# write csv header
bold = workbook.add_format({'bold': True})

Expand All @@ -68,7 +92,7 @@ def format_header(header_list: list):
[worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)]

[
worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns)
worksheet.write(row + 6, col, key[1](data_i)) for col, key in enumerate(report_columns)
for row, data_i in enumerate(data)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const CaseAggregatesTable = ({ files }) => (
Status
</th>
<th scope="col" rowSpan={2}>
Error Reports (In development)
Error Reports
</th>
</tr>
</thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ describe('SubmissionHistory', () => {
expect(screen.queryByText('test5.txt')).not.toBeInTheDocument()
expect(screen.queryByText('test6.txt')).toBeInTheDocument()

expect(
screen.queryByText('Error Reports (In development)')
).toBeInTheDocument()
expect(screen.queryByText('Error Reports')).toBeInTheDocument()
})

it('Shows SSP results when SSP-MOE file type selected', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const TotalAggregatesTable = ({ files }) => (
Status
</th>
<th scope="col" rowSpan={2}>
Error Reports (In development)
Error Reports
</th>
</tr>
</thead>
Expand Down
Loading