From ebf8f373ed0fcd2be12263c93e42579837706263 Mon Sep 17 00:00:00 2001 From: Johnny Richardson Date: Fri, 17 May 2024 16:35:35 -0400 Subject: [PATCH] fix(apps): cms - slideshow component query. --- .../cms/admin/components/component-blocks.tsx | 2 +- .../admin/components/video-field/views.tsx | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/cms/admin/components/component-blocks.tsx b/apps/cms/admin/components/component-blocks.tsx index ab0aab45..9cb5d4ce 100644 --- a/apps/cms/admin/components/component-blocks.tsx +++ b/apps/cms/admin/components/component-blocks.tsx @@ -887,7 +887,7 @@ export const componentBlocks = { listKey: 'Slideshow', label: 'Select:', selection: - 'key name slides { image {publicId} altText caption video {file} order }', + 'key name slides { image {publicId publicUrl} altText caption video {file} order }', }), }, }), diff --git a/apps/cms/admin/components/video-field/views.tsx b/apps/cms/admin/components/video-field/views.tsx index 2f6327ea..ed37591b 100644 --- a/apps/cms/admin/components/video-field/views.tsx +++ b/apps/cms/admin/components/video-field/views.tsx @@ -78,8 +78,27 @@ export function Field({ } export const Cell: CellComponent = ({ item, field, linkTo }) => { - let value = item[field.path] + ''; - return {value}; + let value = item[field.path]; + return ( + + {value.file && value.file.length > 5 && value.thumbSmUrl.length > 5 ? ( + + +

{value.label}

+
+ ) : ( + None + )} +
+ ); }; export const CardValue: CardValueComponent = ({ item, field }) => {