From 186fe5bab6a14fca00732ec0a4fa5ece4f214e7e Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Fri, 6 Dec 2024 12:06:02 -0500 Subject: [PATCH 01/12] - Add css class for reprocessed modal - Add ReprocessedModal component - Use new component for submission history tables --- tdrs-frontend/src/assets/Reports.scss | 13 ++++++ .../SubmissionHistory/CaseAggregatesTable.jsx | 20 ++++++-- .../SubmissionHistory/ReprocessedModal.jsx | 46 +++++++++++++++++++ .../TotalAggregatesTable.jsx | 5 +- .../components/SubmissionHistory/helpers.jsx | 3 +- 5 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx diff --git a/tdrs-frontend/src/assets/Reports.scss b/tdrs-frontend/src/assets/Reports.scss index 58b89ce6c..0c6de7dfb 100644 --- a/tdrs-frontend/src/assets/Reports.scss +++ b/tdrs-frontend/src/assets/Reports.scss @@ -42,6 +42,19 @@ cursor: pointer; } +.reprocessed { + background-color: transparent; + border: none; + color: #264A64; + text-align: left; + margin: 0; + padding: 0; +} + +.reprocessed:hover { + cursor: pointer; +} + .usa-table caption { width: 100%; } \ No newline at end of file diff --git a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx index 56b1b5ecc..f5be03616 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx @@ -8,6 +8,7 @@ import { downloadFile, getErrorReportStatus, } from './helpers' +import ReprocessedModal from './ReprocessedModal' const MonthSubRow = ({ data }) => data ? ( @@ -24,15 +25,28 @@ const MonthSubRow = ({ data }) => ) +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. +
+
+ Data was reprocessed on: {date} + + ) +} + const CaseAggregatesRow = ({ file }) => { const dispatch = useDispatch() - + const reprocessedOn = formatDate(getReprocessedDate(file)) return ( <> - + {formatDate(file.createdAt) + ' by ' + file.submittedBy} - {hasReparsed(file) && <>} + {hasReparsed(file) && } diff --git a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx new file mode 100644 index 000000000..cfb38101d --- /dev/null +++ b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx @@ -0,0 +1,46 @@ +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. +
+
+ Data was reprocessed on: {date} + + ) +} + +const ReprocessedModal = ({ date }) => { + const [modalVisible, setModalVisible] = useState(false) + const message = + return ( +
+
+ +
+
+ { + setModalVisible(false) + }, + }, + ]} + /> +
+ ) +} + +export default ReprocessedModal diff --git a/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx index 2d05fba6c..7e19bbaee 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx @@ -8,6 +8,7 @@ import { downloadFile, getErrorReportStatus, } from './helpers' +import ReprocessedModal from './ReprocessedModal' const MonthSubRow = ({ data }) => data ? ( @@ -24,13 +25,13 @@ const MonthSubRow = ({ data }) => const TotalAggregatesRow = ({ file }) => { const dispatch = useDispatch() - + const reprocessedOn = formatDate(getReprocessedDate(file)) return ( <> {formatDate(file.createdAt) + ' by ' + file.submittedBy} - {hasReparsed(file) && <>} + {hasReparsed(file) && } diff --git a/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx b/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx index 5bb71d0e4..2301485fe 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx @@ -31,7 +31,8 @@ export const hasReparsed = (f) => f.latest_reparse_file_meta.finished_at && f.latest_reparse_file_meta.finished_at !== null -export const getReprocessedDate = (f) => f.latest_reparse_file_meta.finished_at +export const getReprocessedDate = (f) => + f?.latest_reparse_file_meta?.finished_at export const getErrorReportStatus = (file) => { if ( From 26bebd8a7b2a77b74bf657974d249fedb30312e4 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Fri, 6 Dec 2024 12:21:05 -0500 Subject: [PATCH 02/12] - remove component --- .../SubmissionHistory/CaseAggregatesTable.jsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx index f5be03616..c5b18d1fb 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx @@ -25,19 +25,6 @@ const MonthSubRow = ({ data }) => ) -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. -
-
- Data was reprocessed on: {date} - - ) -} - const CaseAggregatesRow = ({ file }) => { const dispatch = useDispatch() const reprocessedOn = formatDate(getReprocessedDate(file)) From fc56eb5cdf8259fab095f34af836ab66c27ed3bb Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Fri, 6 Dec 2024 12:23:19 -0500 Subject: [PATCH 03/12] - removed unnecessary span --- .../src/components/SubmissionHistory/ReprocessedModal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx index cfb38101d..4a28658fc 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx @@ -21,7 +21,7 @@ const ReprocessedModal = ({ date }) => {



From 224e3d3172755d1509bf68da31e44a35c810c445 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 9 Dec 2024 14:44:57 -0500 Subject: [PATCH 04/12] Small fix to rowspan --- .../src/components/SubmissionHistory/CaseAggregatesTable.jsx | 2 +- .../src/components/SubmissionHistory/ReprocessedModal.jsx | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx index c5b18d1fb..7a0ee3222 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx @@ -31,7 +31,7 @@ const CaseAggregatesRow = ({ file }) => { return ( <> - + {formatDate(file.createdAt) + ' by ' + file.submittedBy} {hasReparsed(file) && } diff --git a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx index 4a28658fc..7fb5dcd97 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx @@ -19,12 +19,9 @@ const ReprocessedModal = ({ date }) => { const message = return (
-
-
-
Date: Tue, 10 Dec 2024 08:57:24 -0500 Subject: [PATCH 05/12] - Add test for reprocessed button/modal --- .../SubmissionHistory.test.js | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js index eda2d13b8..c43b48d7a 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js @@ -474,4 +474,46 @@ 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: 'test@teamraft.com', + 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() + + fireEvent.click(reprocessedBtn) + expect(screen.queryByText('Data was reprocessed on: 12/9/2024, 1:38:16 PM')) + }) }) From 75f5ba7aed8cf45a3c4b3194c63848e2182b2d72 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 10 Dec 2024 08:59:56 -0500 Subject: [PATCH 06/12] - linting --- .../SubmissionHistory/SubmissionHistory.test.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js index c43b48d7a..1b22dd24d 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js @@ -490,13 +490,12 @@ describe('SubmissionHistory', () => { s3_version_id: '321-0-0-123', createdAt: '12/12/2012 12:12', submittedBy: 'test@teamraft.com', - latest_reparse_file_meta: - { - "finished": true, - "success": true, - "started_at": "2024-12-09T18:38:14+0000", - "finished_at": "2024-12-09T18:38:16+0000" - } + latest_reparse_file_meta: { + 'finished': true, + 'success': true, + 'started_at': '2024-12-09T18:38:14+0000', + 'finished_at': '2024-12-09T18:38:16+0000' + } }, ], }, From 08c346aae49ca722939b47ccfedf60bcdc0fd41d Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 10 Dec 2024 09:02:31 -0500 Subject: [PATCH 07/12] - linting --- .../SubmissionHistory/SubmissionHistory.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js index 1b22dd24d..39c2a32c8 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js @@ -491,11 +491,11 @@ describe('SubmissionHistory', () => { createdAt: '12/12/2012 12:12', submittedBy: 'test@teamraft.com', latest_reparse_file_meta: { - 'finished': true, - 'success': true, - 'started_at': '2024-12-09T18:38:14+0000', - 'finished_at': '2024-12-09T18:38:16+0000' - } + finished: true, + success: true, + started_at: '2024-12-09T18:38:14+0000', + finished_at: '2024-12-09T18:38:16+0000', + }, }, ], }, From eab0955f6b5328bf3a8d5c6b420850c11ccf6468 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 11 Dec 2024 11:10:05 -0500 Subject: [PATCH 08/12] - Add underline text decoration - Fixed bug in Modal that caused it to crash when tabbing or shift tabbing with only one button --- tdrs-frontend/src/assets/Reports.scss | 1 + tdrs-frontend/src/components/Modal/Modal.jsx | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tdrs-frontend/src/assets/Reports.scss b/tdrs-frontend/src/assets/Reports.scss index 0c6de7dfb..946e9ece6 100644 --- a/tdrs-frontend/src/assets/Reports.scss +++ b/tdrs-frontend/src/assets/Reports.scss @@ -47,6 +47,7 @@ border: none; color: #264A64; text-align: left; + text-decoration: underline; margin: 0; padding: 0; } diff --git a/tdrs-frontend/src/components/Modal/Modal.jsx b/tdrs-frontend/src/components/Modal/Modal.jsx index eb2b0d87c..323639f9b 100644 --- a/tdrs-frontend/src/components/Modal/Modal.jsx +++ b/tdrs-frontend/src/components/Modal/Modal.jsx @@ -24,18 +24,17 @@ const Modal = ({ title, message, buttons = [], isVisible = false }) => { (b) => b.key === selectedButtonKey ) + const btnIdxMinOne = Math.max(0, buttons.length - 1) if (shiftKey) { // go backward + const selectedIdxMinOne = Math.max(0, selectedButtonIndex - 1) nextButtonIndex = - selectedButtonIndex >= 0 - ? selectedButtonIndex - 1 - : buttons.length - 1 + selectedButtonIndex >= 0 ? selectedIdxMinOne : btnIdxMinOne } else { nextButtonIndex = - selectedButtonIndex < buttons.length - 1 ? selectedButtonIndex + 1 : 0 + selectedButtonIndex < btnIdxMinOne ? selectedButtonIndex + 1 : 0 } } - const nextButtonKey = buttons[nextButtonIndex].key const nextButton = modalRef.current.querySelector( `button[buttonkey="${nextButtonKey}"]` @@ -45,7 +44,6 @@ const Modal = ({ title, message, buttons = [], isVisible = false }) => { const onKeyDown = (e) => { const { key, shiftKey } = e - switch (key) { case 'Tab': onTabPressed(shiftKey) From 8f5e524d4e42e1b2110a2887c25be35651e96f50 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 11 Dec 2024 13:37:02 -0500 Subject: [PATCH 09/12] - Moved model to parent component - Add state props to update modal based on which files reprocessed button is clicked - made the reprocessed button a separate component --- .../src/components/Reports/Reports.jsx | 13 ++++++ .../SubmissionHistory/CaseAggregatesTable.jsx | 21 ++++++--- .../SubmissionHistory/ReprocessedModal.jsx | 46 +++++++++++-------- .../SubmissionHistory/SubmissionHistory.jsx | 19 ++++++-- .../TotalAggregatesTable.jsx | 21 ++++++--- 5 files changed, 87 insertions(+), 33 deletions(-) diff --git a/tdrs-frontend/src/components/Reports/Reports.jsx b/tdrs-frontend/src/components/Reports/Reports.jsx index 0ac0f3d98..19e0f3ec8 100644 --- a/tdrs-frontend/src/components/Reports/Reports.jsx +++ b/tdrs-frontend/src/components/Reports/Reports.jsx @@ -17,6 +17,7 @@ import { fetchSttList } from '../../actions/sttList' import Modal from '../Modal' import SegmentedControl from '../SegmentedControl' import SubmissionHistory from '../SubmissionHistory' +import ReprocessedModal from '../SubmissionHistory/ReprocessedModal' import { selectPrimaryUserRole } from '../../selectors/auth' /** @@ -55,6 +56,9 @@ function Reports() { const [formValidation, setFormValidationState] = useState({}) const [touched, setTouched] = useState({}) + const [reprocessedModalVisible, setReprocessedModalVisible] = useState(false) + const [reprocessedDate, setReprocessedDate] = useState('') + const quarters = { Q1: 'Quarter 1 (October - December)', Q2: 'Quarter 2 (January - March)', @@ -472,6 +476,10 @@ function Reports() { stt: stt, file_type: fileTypeInputValue, }} + reprocessedState={{ + setModalVisible: setReprocessedModalVisible, + setDate: setReprocessedDate, + }} /> )} @@ -499,6 +507,11 @@ function Reports() { }, ]} /> + ) } diff --git a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx index 7a0ee3222..13dfe1d2d 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx @@ -8,7 +8,7 @@ import { downloadFile, getErrorReportStatus, } from './helpers' -import ReprocessedModal from './ReprocessedModal' +import { ReprocessedButton } from './ReprocessedModal' const MonthSubRow = ({ data }) => data ? ( @@ -25,15 +25,20 @@ const MonthSubRow = ({ data }) => ) -const CaseAggregatesRow = ({ file }) => { +const CaseAggregatesRow = ({ file, reprocessedState }) => { const dispatch = useDispatch() - const reprocessedOn = formatDate(getReprocessedDate(file)) + const reprocessedDate = formatDate(getReprocessedDate(file)) return ( <> {formatDate(file.createdAt) + ' by ' + file.submittedBy} - {hasReparsed(file) && } + {hasReparsed(file) && ( + + )} @@ -76,7 +81,7 @@ const CaseAggregatesRow = ({ file }) => { ) } -export const CaseAggregatesTable = ({ files }) => ( +export const CaseAggregatesTable = ({ files, reprocessedState }) => ( <> @@ -108,7 +113,11 @@ export const CaseAggregatesTable = ({ files }) => ( {files.map((file) => ( - + ))} diff --git a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx index 7fb5dcd97..5d1a7eaaa 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/ReprocessedModal.jsx @@ -14,30 +14,40 @@ const Message = ({ date }) => { ) } -const ReprocessedModal = ({ date }) => { - const [modalVisible, setModalVisible] = useState(false) - const message = +export const ReprocessedButton = ({ date, reprocessedState }) => { return (
- - { - setModalVisible(false) - }, - }, - ]} - />
) } +const ReprocessedModal = ({ date, isVisible, setModalVisible }) => { + const message = + return ( + { + setModalVisible(false) + }, + }, + ]} + /> + ) +} + export default ReprocessedModal diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx index b768fb7cd..c10e8daec 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx @@ -9,7 +9,12 @@ import { useState } from 'react' import { CaseAggregatesTable } from './CaseAggregatesTable' import { TotalAggregatesTable } from './TotalAggregatesTable' -const SectionSubmissionHistory = ({ section, label, files }) => { +const SectionSubmissionHistory = ({ + section, + label, + files, + reprocessedState, +}) => { const pageSize = 5 const [resultsPage, setResultsPage] = useState(1) @@ -30,7 +35,10 @@ const SectionSubmissionHistory = ({ section, label, files }) => { {files && files.length > 0 ? ( - + ) : ( No data available. )} @@ -57,9 +65,13 @@ SectionSubmissionHistory.propTypes = { year: PropTypes.string, }), files: PropTypes.array, + reprocessedState: PropTypes.shape({ + setModalVisible: PropTypes.func, + setDate: PropTypes.func, + }), } -const SubmissionHistory = ({ filterValues }) => { +const SubmissionHistory = ({ filterValues, reprocessedState }) => { const dispatch = useDispatch() const [hasFetchedFiles, setHasFetchedFiles] = useState(false) const { files } = useSelector((state) => state.reports) @@ -95,6 +107,7 @@ const SubmissionHistory = ({ filterValues }) => { label={section} filterValues={filterValues} files={files.filter((f) => f.section.includes(section))} + reprocessedState={reprocessedState} /> ) })} diff --git a/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx index 7e19bbaee..913ed337b 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/TotalAggregatesTable.jsx @@ -8,7 +8,7 @@ import { downloadFile, getErrorReportStatus, } from './helpers' -import ReprocessedModal from './ReprocessedModal' +import { ReprocessedButton } from './ReprocessedModal' const MonthSubRow = ({ data }) => data ? ( @@ -23,15 +23,20 @@ const MonthSubRow = ({ data }) => ) -const TotalAggregatesRow = ({ file }) => { +const TotalAggregatesRow = ({ file, reprocessedState }) => { const dispatch = useDispatch() - const reprocessedOn = formatDate(getReprocessedDate(file)) + const reprocessedDate = formatDate(getReprocessedDate(file)) return ( <> @@ -96,7 +101,11 @@ export const TotalAggregatesTable = ({ files }) => ( {files.map((file) => ( - + ))} From d04656e69260f1f81d1c043f8c9d663f8753ae66 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 11 Dec 2024 13:43:37 -0500 Subject: [PATCH 10/12] - Updated test --- .../SubmissionHistory/SubmissionHistory.test.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js index 39c2a32c8..b0cee5b0d 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js @@ -22,10 +22,15 @@ describe('SubmissionHistory', () => { file_type: 'TANF', } - const setup = (store = appStore, filterValues = defaultFilterValues) => + const defaultReprocessedState = { + setDate: () => {}, + setModalVisible: () => {} + } + + const setup = (store = appStore, filterValues = defaultFilterValues, reprocessedState = defaultReprocessedState) => render( - + ) @@ -511,8 +516,5 @@ describe('SubmissionHistory', () => { const reprocessedBtn = screen.queryByText('Reprocessed ⓘ') expect(reprocessedBtn).toBeInTheDocument() - - fireEvent.click(reprocessedBtn) - expect(screen.queryByText('Data was reprocessed on: 12/9/2024, 1:38:16 PM')) }) }) From 04483ad9132872bc8849d866903b44d495ffc667 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 11 Dec 2024 13:46:21 -0500 Subject: [PATCH 11/12] - linting --- .../SubmissionHistory/SubmissionHistory.test.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js index b0cee5b0d..34bebed53 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js @@ -24,13 +24,20 @@ describe('SubmissionHistory', () => { const defaultReprocessedState = { setDate: () => {}, - setModalVisible: () => {} + setModalVisible: () => {}, } - const setup = (store = appStore, filterValues = defaultFilterValues, reprocessedState = defaultReprocessedState) => + const setup = ( + store = appStore, + filterValues = defaultFilterValues, + reprocessedState = defaultReprocessedState + ) => render( - + ) From defdbea8bb4647aab5f1f2c674e86739f5c61888 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 17 Dec 2024 09:26:55 -0500 Subject: [PATCH 12/12] - do NOT consider an unfinished reparse event to be the latest reparse --- tdrs-backend/tdpservice/data_files/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/data_files/serializers.py b/tdrs-backend/tdpservice/data_files/serializers.py index a279d3d5a..2460c1366 100644 --- a/tdrs-backend/tdpservice/data_files/serializers.py +++ b/tdrs-backend/tdpservice/data_files/serializers.py @@ -78,7 +78,7 @@ def get_has_error(self, obj): def get_latest_reparse_file_meta(self, instance): """Return related reparse_file_metas, ordered by finished_at decending.""" - reparse_file_metas = instance.reparse_file_metas.all().order_by('-finished_at') + reparse_file_metas = instance.reparse_file_metas.all().exclude(finished_at=None).order_by('-finished_at') if reparse_file_metas.count() > 0: return ReparseFileMetaSerializer(reparse_file_metas.first(), many=False, read_only=True).data return None
{`Section ${section} - ${label}`}
{formatDate(file.createdAt) + ' by ' + file.submittedBy} - {hasReparsed(file) && } + {hasReparsed(file) && ( + + )} @@ -70,7 +75,7 @@ const TotalAggregatesRow = ({ file }) => { ) } -export const TotalAggregatesTable = ({ files }) => ( +export const TotalAggregatesTable = ({ files, reprocessedState }) => ( <>