Upload image for use in blocknote editor (#3044)

* - upload image to use in blocknote editor
- fix local-storage not in gitignore

* fix lint

* fix runtime config
add tests for body parsing notes and tasks

* lint
This commit is contained in:
brendanlaschke
2023-12-20 15:16:19 +01:00
committed by GitHub
parent 351dc6488c
commit c4fecb0a1a
11 changed files with 282 additions and 24 deletions

View File

@ -0,0 +1,14 @@
export const getActivityPreview = (activityBody: string) => {
const noteBody = activityBody ? JSON.parse(activityBody) : [];
return noteBody.length
? noteBody
.map((x: any) =>
Array.isArray(x.content)
? x.content?.map((content: any) => content?.text).join(' ')
: x.content?.text,
)
.filter((x: string) => x)
.join('\n')
: '';
};