Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attachment issue #2976

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Fix attachment issue #2976

merged 2 commits into from
Aug 30, 2024

Conversation

barshathakuri
Copy link
Contributor

@barshathakuri barshathakuri commented Jul 30, 2024

Changes

  • Fix attachment issue in primary and secondary tab.
  • Move attachment state

This PR doesn't introduce any:

  • temporary files, auto-generated files or secret keys
  • build works
  • eslint issues
  • typescript issues
  • codegen errors
  • console.log meant for debugging
  • typos
  • unwanted comments
  • conflict markers

This PR contains valid:

  • permission checks
  • translations

@barshathakuri barshathakuri force-pushed the fix/ocr-image-issue branch 2 times, most recently from 98f19cd to f1042e4 Compare July 30, 2024 12:21
Copy link
Contributor

@subinasr subinasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix all type issues.

Comment on lines -399 to -415
const handleAttachmentClick = useCallback((attachment: LeadPreviewAttachmentType) => {
if (onEntryCreate) {
onEntryCreate({
clientId: randomString(),
entryType: 'ATTACHMENT',
lead: leadId,
leadAttachment: attachment.id,
excerpt: '',
droppedExcerpt: '',
});
setLeadAttachmentsMap((oldValue) => ({
...oldValue,
[attachment.id]: attachment,
}));
}
}, [leadId, onEntryCreate]);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we're handling this in 'EntryEdit' and not here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subinasr By adding handleAttachmentClick to the LeftPane Entries, the leadId is utilized in both the secondary and review tabs. Moving it to entryEdit makes the leadId accessible across all tabs, which explains why the image was only visible in the primary tab previously.

@AdityaKhatri AdityaKhatri merged commit f088b2f into develop Aug 30, 2024
3 of 5 checks passed
@AdityaKhatri AdityaKhatri deleted the fix/ocr-image-issue branch August 30, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants