RICH_TEXT_V2 frontend (#10083)
Adds task and note support for the new `bodyV2` field. (Field metadata type of `bodyV2` is `RICH_TEXT_V2`.) Related to issue https://github.com/twentyhq/twenty/issues/7613 Upgrade commands will be in separate PRs. Fixes https://github.com/twentyhq/twenty/issues/10084 --------- Co-authored-by: ad-elias <elias@autodiligence.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -2,14 +2,14 @@ import { PartialBlock } from '@blocknote/core';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
|
||||
export const getFirstNonEmptyLineOfRichText = (
|
||||
fieldValue: PartialBlock[] | null,
|
||||
blocks: PartialBlock[] | null,
|
||||
): string => {
|
||||
if (fieldValue === null) {
|
||||
if (blocks === null) {
|
||||
return '';
|
||||
}
|
||||
for (const node of fieldValue) {
|
||||
if (!isUndefinedOrNull(node.content)) {
|
||||
const contentArray = node.content as Array<
|
||||
for (const block of blocks) {
|
||||
if (!isUndefinedOrNull(block.content)) {
|
||||
const contentArray = block.content as Array<
|
||||
{ text: string } | { link: string }
|
||||
>;
|
||||
if (contentArray.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user