Merged PR 2266: update media tabs display and query
update media tabs display and query Related work items: #22698
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) => {
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{isObjectNotEmpty(props, "eventsObj") && (
|
||||
{hasEventsTabData && (
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-events"
|
||||
@@ -468,7 +478,7 @@ const CaseSummary = (props) => {
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{isObjectNotEmpty(props, "mediaObj") && (
|
||||
{hasMediaTabData && (
|
||||
<li
|
||||
className={
|
||||
whichTab == "case-media"
|
||||
@@ -1878,7 +1888,7 @@ const CaseSummary = (props) => {
|
||||
.PrimaryIdAttribute == "pinswg_sipscase" && (
|
||||
<EIADetails props={props} />
|
||||
)}
|
||||
{isObjectNotEmpty(props, "eventsObj") && (
|
||||
{hasEventsTabData && (
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-events"
|
||||
@@ -1891,7 +1901,7 @@ const CaseSummary = (props) => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isObjectNotEmpty(props, "mediaObj") && (
|
||||
{hasMediaTabData && (
|
||||
<div
|
||||
className={
|
||||
whichTab == "case-media"
|
||||
|
||||
Reference in New Issue
Block a user