From 93f128c67763afcc9d0529abc617c7fd91aaf3d2 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 20 Nov 2024 16:28:40 -0500 Subject: [PATCH] - Fix logic to use correct section index. - need to sort uploads by section index --- .../SubmissionHistory/SubmissionHistory.jsx | 5 +++-- .../src/components/UploadReport/UploadReport.jsx | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx index 5ddfb770f..abddd326d 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import { useDispatch, useSelector } from 'react-redux' import Paginator from '../Paginator' import { getAvailableFileList } from '../../actions/reports' +import { defaultFileUploadSections } from '../../reducers/reports' import { useEffect } from 'react' import { useState } from 'react' import { CaseAggregatesTable } from './CaseAggregatesTable' @@ -88,10 +89,10 @@ const SubmissionHistory = ({ filterValues }) => {
- {fileUploadSections.map((section, index) => ( + {fileUploadSections.map((section) => ( f.section.includes(section))} diff --git a/tdrs-frontend/src/components/UploadReport/UploadReport.jsx b/tdrs-frontend/src/components/UploadReport/UploadReport.jsx index fa5b085a5..451c1ae26 100644 --- a/tdrs-frontend/src/components/UploadReport/UploadReport.jsx +++ b/tdrs-frontend/src/components/UploadReport/UploadReport.jsx @@ -7,6 +7,7 @@ import Button from '../Button' import FileUpload from '../FileUpload' import { submit } from '../../actions/reports' +import { defaultFileUploadSections } from '../../reducers/reports' import { useEventLogger } from '../../utils/eventLogger' function UploadReport({ handleCancel, stt }) { @@ -44,7 +45,7 @@ function UploadReport({ handleCancel, stt }) { const uploadedFiles = files?.filter((file) => file.fileName && !file.id) const uploadedSections = uploadedFiles ? uploadedFiles - .map((file) => fileUploadSections.indexOf(file.section) + 1) + .map((file) => defaultFileUploadSections.indexOf(file.section) + 1) .join(', ') .split(' ') : [] @@ -110,10 +111,13 @@ function UploadReport({ handleCancel, stt }) {
)}
- {fileUploadSections.map((name, index) => ( + {fileUploadSections.map((section) => ( ))}