From 6add4ef0318b2a4a28428c982ec07194030fc61c Mon Sep 17 00:00:00 2001 From: Merlijn Vos Date: Mon, 15 Nov 2021 10:15:52 +0000 Subject: [PATCH] Status bar error state improvements (#3299) - Show error state of status bar if there is only _one_ failed file instead of _all_ failed files. Used to be stuck in the uploading state when a file failed. - Add "x of x files uploaded" below "Upload failed" for extra context. - Improve the error details button styling in the statusbar - Improve the error details button styling in the file info card. Now placed next to the file name. - Set status bar state to complete if the user manually removes the failed files. --- .../src/components/FileItem/FileInfo/index.js | 17 +++--- .../components/FileItem/FileInfo/index.scss | 9 +++ .../src/components/FileItem/index.scss | 11 ++-- packages/@uppy/status-bar/src/Components.js | 55 +++++++++---------- packages/@uppy/status-bar/src/StatusBar.js | 19 ++++--- packages/@uppy/status-bar/src/index.js | 6 +- packages/@uppy/status-bar/src/locale.js | 1 + packages/@uppy/status-bar/src/style.scss | 5 ++ 8 files changed, 72 insertions(+), 51 deletions(-) diff --git a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js index c9c974b286..b7d08afd05 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js +++ b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js @@ -77,7 +77,7 @@ const ErrorButton = ({ file, onClick }) => { if (file.error) { return ( + + - ) } diff --git a/packages/@uppy/status-bar/src/StatusBar.js b/packages/@uppy/status-bar/src/StatusBar.js index 7f52cbeee6..b5ab955e81 100644 --- a/packages/@uppy/status-bar/src/StatusBar.js +++ b/packages/@uppy/status-bar/src/StatusBar.js @@ -139,7 +139,7 @@ function StatusBar (props) { && !hidePauseResumeButton && uploadState === STATE_UPLOADING - const showRetryBtn = error && !hideRetryButton + const showRetryBtn = error && !isAllComplete && !hideRetryButton const showDoneBtn = doneButtonHandler && uploadState === STATE_COMPLETE @@ -171,15 +171,18 @@ function StatusBar (props) { switch (uploadState) { case STATE_PREPROCESSING: case STATE_POSTPROCESSING: - return ( - - ) + return case STATE_COMPLETE: return case STATE_ERROR: - return + return ( + + ) case STATE_UPLOADING: return ( - {(recoveredState || showUploadBtn) ? ( + {recoveredState || showUploadBtn ? (