From c6976c8c28ad7aaa0e63329d840c24dcfd435749 Mon Sep 17 00:00:00 2001 From: Jody Clements Date: Wed, 24 Jan 2024 11:03:15 -0500 Subject: [PATCH] fix: Replaces missing thumbnail in image alignment If the file that was uploaded can not be displayed as a thumbnail or fails during the alignment step, then the site will replace it with a placeholder graphic to remove "broken" images from the page. --- .../CustomSearch/ImageAlignmentStep.jsx | 32 ++++++++++++------- src/components/CustomSearch/SearchSteps.css | 4 +-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/CustomSearch/ImageAlignmentStep.jsx b/src/components/CustomSearch/ImageAlignmentStep.jsx index a1de9a5..7549fc9 100644 --- a/src/components/CustomSearch/ImageAlignmentStep.jsx +++ b/src/components/CustomSearch/ImageAlignmentStep.jsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from "react"; import PropTypes from "prop-types"; +import { Skeleton } from "antd"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFileVideo } from "@fortawesome/pro-regular-svg-icons"; import { signedLink } from "../../libs/awsLib"; @@ -33,19 +34,19 @@ export default function ImageAlignmentStep({ state, search }) { }, [search.searchDir, search.uploadThumbnail]); const handleQualityCheck = () => { - if (Object.prototype.hasOwnProperty.call(window, 'fathom')) { + if (Object.prototype.hasOwnProperty.call(window, "fathom")) { // make sure the fathom code has been loaded and not blocked by an ad blocker. if (window.fathom) { - window.fathom.trackGoal('View Alignment Quality check', 0); + window.fathom.trackGoal("View Alignment Quality check", 0); } } }; const handleHelpClick = () => { - if (Object.prototype.hasOwnProperty.call(window, 'fathom')) { + if (Object.prototype.hasOwnProperty.call(window, "fathom")) { // make sure the fathom code has been loaded and not blocked by an ad blocker. if (window.fathom) { - window.fathom.trackGoal('Alignment Help Link', 0); + window.fathom.trackGoal("Alignment Help Link", 0); } } }; @@ -59,17 +60,22 @@ export default function ImageAlignmentStep({ state, search }) { content = ( <> - Alignment Thumbnail + {thumbnailUrl ? ( + Alignment Thumbnail + ) : ( + + )} Score: {search.alignmentScore || "N/A"} {movieUrl ? ( - Alignment Quality Check + Alignment Quality + Check ) : ( "" @@ -78,7 +84,11 @@ export default function ImageAlignmentStep({ state, search }) { ); } else if (search.alignmentErrorMessage || search.errorMessage) { content = ( - + ); } diff --git a/src/components/CustomSearch/SearchSteps.css b/src/components/CustomSearch/SearchSteps.css index 2fb9d06..3d321b1 100644 --- a/src/components/CustomSearch/SearchSteps.css +++ b/src/components/CustomSearch/SearchSteps.css @@ -3,8 +3,8 @@ } .completeThumbnail { - width: 150px; - height: auto; + width: 150px !important; + height: auto !important; } .verticalThumbnail {