From a5a7d03d125b427dee55880bd238ed085635774e Mon Sep 17 00:00:00 2001 From: Asad Ali Date: Tue, 9 Sep 2025 08:45:27 +0500 Subject: [PATCH] fix: allow thumbnail upload on Videos page if no thumbnail (#2388) (#2434) * fix: allow thumbnail upload if no thumbnail * fix: improve thumbnail upload impl * test: fix tests * test: fix tests * fix: do not show thumbnail upload if not allowed * test: fix coverage * test: add thumbnail test * fix: display thumbnail overlay when video status is success --- .../videos-page/VideoThumbnail.jsx | 27 ++++++++++------ .../videos-page/VideoThumbnail.test.jsx | 32 +++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 src/files-and-videos/videos-page/VideoThumbnail.test.jsx diff --git a/src/files-and-videos/videos-page/VideoThumbnail.jsx b/src/files-and-videos/videos-page/VideoThumbnail.jsx index 2929c6d32..fb7bf6205 100644 --- a/src/files-and-videos/videos-page/VideoThumbnail.jsx +++ b/src/files-and-videos/videos-page/VideoThumbnail.jsx @@ -48,21 +48,30 @@ const VideoThumbnail = ({ const isFailed = VIDEO_FAILURE_STATUSES.includes(status); const failedMessage = intl.formatMessage(messages.failedCheckboxLabel); - const showThumbnail = allowThumbnailUpload && thumbnail && isUploaded; + const showThumbnail = allowThumbnailUpload && isUploaded; return (
- {allowThumbnailUpload && showThumbnail &&
} + {allowThumbnailUpload && isUploaded &&
} {showThumbnail && !thumbnailError && pageLoadStatus === RequestStatus.SUCCESSFUL ? ( <>
- {intl.formatMessage(messages.thumbnailAltMessage, setThumbnailError(true)} - /> + { thumbnail ? ( + {intl.formatMessage(messages.thumbnailAltMessage, setThumbnailError(true)} + /> + ) : ( +
+ +
+ )}