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

Upload image for use in blocknote editor #3044

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

brendanlaschke
Copy link
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
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
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
Contributor Author

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

@lucasbordeau lucasbordeau merged commit c4fecb0 into twentyhq:main Dec 20, 2023
11 checks passed
@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