From 67a9c23c56861f3a5cc02e41d8d49b7c117c23dd Mon Sep 17 00:00:00 2001 From: Jacob Lowe <40873986+jalowe13@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:21:49 -0600 Subject: [PATCH] Task/WP-505: APCD File Upload Failures Logging Request (#1013) * Adding error messages to upload modal ui * response text for 403 * remove logs and testing code * additional testing reversal * console log removal * 500 errors for testing * try catch for http and network errors --- .../DataFilesUploadModalListingTable.jsx | 8 ++++- .../components/Submissions/Submissions.jsx | 2 +- .../src/redux/reducers/datafiles.reducers.js | 9 ++++++ client/src/redux/sagas/datafiles.sagas.js | 29 +++++++++++++------ 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/client/src/components/DataFiles/DataFilesModals/DataFilesUploadModalListing/DataFilesUploadModalListingTable.jsx b/client/src/components/DataFiles/DataFilesModals/DataFilesUploadModalListing/DataFilesUploadModalListingTable.jsx index 4506e2bfd..01126b3e7 100644 --- a/client/src/components/DataFiles/DataFilesModals/DataFilesUploadModalListing/DataFilesUploadModalListingTable.jsx +++ b/client/src/components/DataFiles/DataFilesModals/DataFilesUploadModalListing/DataFilesUploadModalListingTable.jsx @@ -5,11 +5,13 @@ import { LoadingSpinner, InlineMessage, Button } from '_common'; import { FileLengthCell } from '../../DataFilesListing/DataFilesListingCells'; import { useUpload } from 'hooks/datafiles/mutations'; import styles from './DataFilesUploadModalListingTable.module.scss'; +import { useSelector } from 'react-redux'; const DataFilesUploadStatus = ({ i, removeCallback, rejectedFiles }) => { if (rejectedFiles.filter((f) => f.id === i).length > 0) { return Exceeds File Size Limit; } + const errorMessage = useSelector((state) => state.files.error.message); const status = useUpload().status[i]; switch (status) { case 'UPLOADING': @@ -17,7 +19,11 @@ const DataFilesUploadStatus = ({ i, removeCallback, rejectedFiles }) => { case 'SUCCESS': return SUCCESS; case 'ERROR': - return Upload Failed; + return ( + + Upload Failed: {errorMessage} + + ); default: return (