From 0e7e4ba9ded1a466e6b4a64a128f39300ac92235 Mon Sep 17 00:00:00 2001 From: barshathakuri Date: Wed, 31 Jul 2024 14:04:09 +0545 Subject: [PATCH] fix images issue in review tab --- app/components/entry/EntryInput/index.tsx | 11 ++++++++--- app/views/EntryEdit/index.tsx | 6 +++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/components/entry/EntryInput/index.tsx b/app/components/entry/EntryInput/index.tsx index 1a3c7d0e82..048e0e5896 100644 --- a/app/components/entry/EntryInput/index.tsx +++ b/app/components/entry/EntryInput/index.tsx @@ -24,7 +24,7 @@ import NonFieldError from '#components/NonFieldError'; import { WidgetType as WidgetRaw, AnalysisFrameworkDetailType, - EntryType, + LeadPreviewAttachmentType, } from '#generated/types'; // FIXME: move this component @@ -85,7 +85,8 @@ interface EntryInputProps { rightComponent?: React.ReactNode; noPaddingInWidgetContainer?: boolean; - entryAttachment: EntryType['entryAttachment'] | undefined; + entryAttachment: Entry['entryAttachment'] | undefined; + leadAttachment?: LeadPreviewAttachmentType; excerptShown?: boolean; displayHorizontally?: boolean; @@ -124,6 +125,7 @@ function EntryInput(props: EntryInputProp displayHorizontally = false, relevant = true, entryAttachment, + leadAttachment, } = props; const error = getErrorObject(riskyError); @@ -257,9 +259,12 @@ function EntryInput(props: EntryInputProp value={value.excerpt} // droppedExcerpt={value.droppedExcerpt} image={entryImage} - imageRaw={value.imageRaw} + imageRaw={ + value.imageRaw ?? leadAttachment?.filePreview?.url ?? undefined + } readOnly={readOnly} entryAttachment={entryAttachment} + leadAttachment={leadAttachment} /> )} diff --git a/app/views/EntryEdit/index.tsx b/app/views/EntryEdit/index.tsx index 3a43d95e80..737911941a 100644 --- a/app/views/EntryEdit/index.tsx +++ b/app/views/EntryEdit/index.tsx @@ -1404,7 +1404,6 @@ function EntryEdit(props: Props) { secondaryTagging: frameworkDetails?.secondaryTagging, onAddButtonClick: handleAddButtonClick, primaryTagging: frameworkDetails?.primaryTagging, - entryAttachment: isDefined(datum.id) ? entryAttachmentsMap?.[datum.id] : undefined, excerptHeaderActions: datum.id && projectId && ( <>