Allow Card field update and card drag on new record board (#3661)

This commit is contained in:
Charles Bochet
2024-01-29 08:59:13 +01:00
committed by GitHub
parent 6eca6dc780
commit 7fdd7119d2
10 changed files with 240 additions and 35 deletions

View File

@ -1,9 +1,25 @@
import { isArray } from '@sniptt/guards';
export const getActivitySummary = (activityBody: string) => {
const noteBody = activityBody ? JSON.parse(activityBody) : [];
return (
noteBody[0]?.content?.text ||
noteBody[0]?.content?.map((content: any) => content?.text).join(' ') ||
''
);
if (!noteBody.length) {
return '';
}
const firstNoteBlockContent = noteBody[0].content;
if (!firstNoteBlockContent) {
return '';
}
if (firstNoteBlockContent.text) {
return noteBody[0].content.text;
}
if (isArray(firstNoteBlockContent)) {
return firstNoteBlockContent.map((content: any) => content.text).join(' ');
}
return '';
};