Skip to content

Commit

Permalink
fix images issue in review tab
Browse files Browse the repository at this point in the history
  • Loading branch information
barshathakuri authored and AdityaKhatri committed Aug 30, 2024
1 parent 21d9c13 commit 0e7e4ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 8 additions & 3 deletions app/components/entry/EntryInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import NonFieldError from '#components/NonFieldError';
import {
WidgetType as WidgetRaw,
AnalysisFrameworkDetailType,
EntryType,
LeadPreviewAttachmentType,
} from '#generated/types';

// FIXME: move this component
Expand Down Expand Up @@ -85,7 +85,8 @@ interface EntryInputProps<T extends string | number | undefined> {
rightComponent?: React.ReactNode;
noPaddingInWidgetContainer?: boolean;

entryAttachment: EntryType['entryAttachment'] | undefined;
entryAttachment: Entry['entryAttachment'] | undefined;
leadAttachment?: LeadPreviewAttachmentType;

excerptShown?: boolean;
displayHorizontally?: boolean;
Expand Down Expand Up @@ -124,6 +125,7 @@ function EntryInput<T extends string | number | undefined>(props: EntryInputProp
displayHorizontally = false,
relevant = true,
entryAttachment,
leadAttachment,
} = props;

const error = getErrorObject(riskyError);
Expand Down Expand Up @@ -257,9 +259,12 @@ function EntryInput<T extends string | number | undefined>(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}
/>
</Container>
)}
Expand Down
6 changes: 5 additions & 1 deletion app/views/EntryEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
<>
<EntryVerification
Expand Down Expand Up @@ -1450,6 +1449,10 @@ function EntryEdit(props: Props) {
),
disabled: !!selectedEntry,
entryImage: datum?.image ? entryImagesMap?.[datum.image] : undefined,
entryAttachment: entryAttachmentsMap?.[entryId],
leadAttachment: datum.leadAttachment
? leadAttachmentsMap?.[datum.leadAttachment]
: undefined,
error: entriesError?.[entryId],
geoAreaOptions,
onGeoAreaOptionsChange: setGeoAreaOptions,
Expand All @@ -1474,6 +1477,7 @@ function EntryEdit(props: Props) {
selectedEntry,
entriesError,
handleApplyToAll,
leadAttachmentsMap,
],
);

Expand Down

0 comments on commit 0e7e4ba

Please sign in to comment.