From 0117c1eae367db05e5fc3875256d29c1237f8917 Mon Sep 17 00:00:00 2001 From: Asad Ali Date: Mon, 8 Sep 2025 21:40:32 +0500 Subject: [PATCH] fix: allow thumbnail upload on Videos page if no thumbnail (#2388) * 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 54ea2c98e..b529c18ee 100644 --- a/src/files-and-videos/videos-page/VideoThumbnail.jsx +++ b/src/files-and-videos/videos-page/VideoThumbnail.jsx @@ -47,21 +47,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)} + /> + ) : ( +
+ +
+ )}