diff --git a/components/case/media.js b/components/case/media.js index 558f919e..355ebcfe 100644 --- a/components/case/media.js +++ b/components/case/media.js @@ -459,7 +459,7 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => { .map((item) => { const link = isWelsh ? item.pinswg_mediaLinkCY - : item.pinswg_mediaLinkEN; + : item.pinswg_videoplatformurl; const videoId = extractYouTubeId(link); if (!videoId) return null; @@ -468,15 +468,15 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => { key: item.pinswg_documentid || item.pinswg_mediaid || - `${item.pinswg_name}-${videoId}`, + `${item.pinswg_eventrecordingid}-${videoId}`, videoId, - name: item.pinswg_name || "Video", + name: item.pinswg_eventrecordingname || "Video", description: item.pinswg_description || "", // If you later store duration in CRM, map it here (e.g. "03:42") duration: item.pinswg_duration || null, thumbnailHQ: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`, thumbnailMax: `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`, - raw: item, + raw: item }; }) .filter(Boolean); diff --git a/components/case/summary.js b/components/case/summary.js index 90e718c3..6cc08be5 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -311,6 +311,16 @@ const CaseSummary = (props) => { let hasEndDate = typeof d != "undefined"; + const hasEventsTabData = + isObjectNotEmpty(props, "eventsObj") && + Array.isArray(props.eventsObj?.value) && + props.eventsObj.value.length > 0; + + const hasMediaTabData = + isObjectNotEmpty(props, "mediaObj") && + Array.isArray(props.mediaObj?.value) && + props.mediaObj.value.length > 0; + let point = {}; let siteCoords = {}; let center = {}; @@ -448,7 +458,7 @@ const CaseSummary = (props) => { )} - {isObjectNotEmpty(props, "eventsObj") && ( + {hasEventsTabData && (