forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 3.7.5-release-notes
- Loading branch information
Showing
10 changed files
with
185 additions
and
23 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
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
53 changes: 53 additions & 0 deletions
53
tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.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,53 @@ | ||
import React, { useState } from 'react' | ||
import Modal from '../Modal' | ||
|
||
const Message = ({ date }) => { | ||
return ( | ||
<> | ||
We've reprocessed your submission with updated validation criteria, based | ||
on system improvements, to improve accuracy of error reports. No changes | ||
have been made to your original data submission. | ||
<br /> | ||
<br /> | ||
Data was reprocessed on: {date} | ||
</> | ||
) | ||
} | ||
|
||
export const ReprocessedButton = ({ date, reprocessedState }) => { | ||
return ( | ||
<div> | ||
<button | ||
className="reprocessed" | ||
onClick={() => { | ||
reprocessedState.setDate(date) | ||
reprocessedState.setModalVisible(true) | ||
}} | ||
> | ||
Reprocessed ⓘ | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
const ReprocessedModal = ({ date, isVisible, setModalVisible }) => { | ||
const message = <Message date={date} /> | ||
return ( | ||
<Modal | ||
title="Most Recent Reprocessed Date" | ||
message={message} | ||
isVisible={isVisible} | ||
buttons={[ | ||
{ | ||
key: '1', | ||
text: 'Close', | ||
onClick: () => { | ||
setModalVisible(false) | ||
}, | ||
}, | ||
]} | ||
/> | ||
) | ||
} | ||
|
||
export default ReprocessedModal |
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 |
---|---|---|
|
@@ -22,10 +22,22 @@ describe('SubmissionHistory', () => { | |
file_type: 'TANF', | ||
} | ||
|
||
const setup = (store = appStore, filterValues = defaultFilterValues) => | ||
const defaultReprocessedState = { | ||
setDate: () => {}, | ||
setModalVisible: () => {}, | ||
} | ||
|
||
const setup = ( | ||
store = appStore, | ||
filterValues = defaultFilterValues, | ||
reprocessedState = defaultReprocessedState | ||
) => | ||
render( | ||
<Provider store={store}> | ||
<SubmissionHistory filterValues={filterValues} /> | ||
<SubmissionHistory | ||
filterValues={filterValues} | ||
reprocessedState={reprocessedState} | ||
/> | ||
</Provider> | ||
) | ||
|
||
|
@@ -474,4 +486,42 @@ describe('SubmissionHistory', () => { | |
} | ||
} | ||
) | ||
|
||
it('Shows Reprocessed button', () => { | ||
const state = { | ||
reports: { | ||
files: [ | ||
{ | ||
id: '123', | ||
fileName: 'test1.txt', | ||
fileType: 'TANF', | ||
quarter: 'Q1', | ||
section: 'Active Case Data', | ||
uuid: '123-4-4-321', | ||
year: '2023', | ||
s3_version_id: '321-0-0-123', | ||
createdAt: '12/12/2012 12:12', | ||
submittedBy: '[email protected]', | ||
latest_reparse_file_meta: { | ||
finished: true, | ||
success: true, | ||
started_at: '2024-12-09T18:38:14+0000', | ||
finished_at: '2024-12-09T18:38:16+0000', | ||
}, | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
const store = appConfigureStore(state) | ||
const dispatch = jest.fn(store.dispatch) | ||
store.dispatch = dispatch | ||
|
||
setup(store) | ||
|
||
expect(screen.queryByText('test1.txt')).toBeInTheDocument() | ||
|
||
const reprocessedBtn = screen.queryByText('Reprocessed ⓘ') | ||
expect(reprocessedBtn).toBeInTheDocument() | ||
}) | ||
}) |
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