From 4e2acb4ecc6ad700e6cf79ac957f849aa4dba9a8 Mon Sep 17 00:00:00 2001 From: Jacob Lowe Date: Thu, 21 Nov 2024 14:41:15 -0600 Subject: [PATCH 1/7] Adding error messages to upload modal ui --- .../DataFilesUploadModalListingTable.jsx | 8 ++++- .../components/Submissions/Submissions.jsx | 36 ++++++++++++++----- client/src/components/Workbench/Workbench.jsx | 3 +- .../src/redux/reducers/datafiles.reducers.js | 10 ++++++ client/src/redux/sagas/datafiles.sagas.js | 25 +++++++++++++ server/portal/settings/settings_default.py | 2 +- 6 files changed, 73 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 (