Skip to content

Upload image for use in blocknote editor#3044

Merged
lucasbordeau merged 4 commits intotwentyhq:mainfrom
brendanlaschke:upload-image-notes
Dec 20, 2023
Merged

Upload image for use in blocknote editor#3044
lucasbordeau merged 4 commits intotwentyhq:mainfrom
brendanlaschke:upload-image-notes

Conversation

@brendanlaschke
Copy link
Copy Markdown
Contributor

@brendanlaschke brendanlaschke commented Dec 17, 2023

Completes the work of #1964 to also upload images.

Bildschirmfoto 2023-12-17 um 19 45 04

closes #1878

Fixed also local-storage not in gitignore

charlesBochet
charlesBochet previously approved these changes Dec 18, 2023
Copy link
Copy Markdown
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

LGTM with minor comment @brendanlaschke, thanks as always!

@charlesBochet
Copy link
Copy Markdown
Member

@brendanlaschke I've found a bug actually. If the image is the first child of the body:
image

I think it's because it has no "content" section. We should update this logic:

  const body = JSON.parse(isNonEmptyString(task.body) ? task.body : '{}')[0]
    ?.content[0]?.text;

I also think we should extract it to an util getActivitySummary and cover it with jest tests to make sure it's behaving properly with task.body payload being: '{}', '', [...imageFirst], [...paragraphFirst], ... so this doesn't happen again

@FelixMalfait FelixMalfait mentioned this pull request Dec 18, 2023
add tests for body parsing notes and tasks
@brendanlaschke
Copy link
Copy Markdown
Contributor Author

done - also for the similar preview in the notes tab ...

@lucasbordeau lucasbordeau merged commit c4fecb0 into twentyhq:main Dec 20, 2023
@brendanlaschke brendanlaschke deleted the upload-image-notes branch December 20, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to insert images within notes

3 participants