Conversation
There was a problem hiding this comment.
The preview click uses window.open(attachment.src, "_blank"), and browsers block navigating a top-level frame to data: (“Not allowed to navigate top frame to data URL”), so it opens a blank tab.
This doesn’t happen with Supabase (http URLs).
There was a problem hiding this comment.
I know this is not related to this PR. but still
There was a problem hiding this comment.
1- Edit a Note, add an image and save (You see the preview of the image)
2- Edit the same Note again an add a file (not an image)
Result: Yo see boath items but no preview of the image
With Fakerest or Supabase is the same.
You also cannot click the image to enlarge it
Madeorsk
left a comment
There was a problem hiding this comment.
Looks good, but needs rebase
There was a problem hiding this comment.
1- Edit a Note, add an image and save (You see the preview of the image)
2- Edit the same Note again an add a file (not an image)
Result: Yo see boath items but no preview of the image
With Fakerest or Supabase is the same.
You also cannot click the image to enlarge it
|
@WiXSL I can't reproduce the issue with Supabase. I fixed the fakerest implementation |
Its fix now. |
I can't reproduce this on neither supabase nor fakerest. When are you trying to open attachments? If it's in the form, I didn't add any code to do it indeed. However, in the note "show" view, it works |
I've try it with supabase and everything worked. |
I can't reproduce this issue. With both FakeRest and Supabase, I can open the attachments by clicking them. |
There was a problem hiding this comment.
I can't reproduce this issue. With both FakeRest and Supabase, I can open the attachments by clicking them.
Mmm, I still can with Fakerest in Chrome v145.
Another issue:
1- Goto Deals, and add a new note
2- Add an image as attachment (you see the preview)
3- Save the new note
Result: You no longer see the preview in the new note
| import type { AttachmentNote, ContactNote, DealNote } from "../types"; | ||
| import { isImageMimeType } from "./isImageMimeType"; | ||
|
|
||
| export const NoteAttachments = ({ note }: { note: ContactNote | DealNote }) => { |
There was a problem hiding this comment.
Now this component seems to overlap with AttachmentField. When should we use one or the other? It's not clear.
There was a problem hiding this comment.
AttachmentField renders a single attachment record, while NoteAttachments renders the note.attachments[] collection.
I clarified that distinction in the JSDoc.
slax57
left a comment
There was a problem hiding this comment.
Other than that it works great! 💪
5273570 to
b84885a
Compare

Problem
Solution
Note form:

Note list:

How To Test
For both demos (fakerest and supabase):
Additional Checks
Also, please make sure to read the contributing guidelines.