Import - richTextV2 import (#12868)
- Enable markdown import - Decrease the createMany batch size on import
This commit is contained in:
@ -467,7 +467,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
|
||||
subFieldLabel:
|
||||
COMPOSITE_FIELD_SUB_FIELD_LABELS[FieldMetadataType.RICH_TEXT_V2]
|
||||
.markdown,
|
||||
isImportable: false,
|
||||
isImportable: true,
|
||||
isFilterable: false,
|
||||
isIncludedInUniqueConstraint: false,
|
||||
},
|
||||
|
||||
@ -1 +1 @@
|
||||
export const SpreadsheetImportCreateRecordsBatchSize = 500;
|
||||
export const SpreadsheetImportCreateRecordsBatchSize = 200;
|
||||
|
||||
@ -39,6 +39,7 @@ export const useDownloadFakeRecords = () => {
|
||||
|
||||
break;
|
||||
}
|
||||
case FieldMetadataType.RICH_TEXT_V2:
|
||||
case FieldMetadataType.ACTOR:
|
||||
case FieldMetadataType.EMAILS:
|
||||
case FieldMetadataType.CURRENCY:
|
||||
|
||||
@ -99,13 +99,13 @@ export class RecordInputTransformerService {
|
||||
let convertedMarkdown: string | null = null;
|
||||
|
||||
try {
|
||||
convertedMarkdown = parsedValue.blocknote
|
||||
convertedMarkdown = isDefined(parsedValue.blocknote)
|
||||
? await serverBlockNoteEditor.blocksToMarkdownLossy(
|
||||
JSON.parse(parsedValue.blocknote),
|
||||
)
|
||||
: null;
|
||||
} catch {
|
||||
convertedMarkdown = parsedValue.blocknote;
|
||||
convertedMarkdown = parsedValue.blocknote || null;
|
||||
}
|
||||
|
||||
const convertedBlocknote = parsedValue.markdown
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { z } from 'zod';
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { CompositeType } from 'src/engine/metadata-modules/field-metadata/interfaces/composite-type.interface';
|
||||
|
||||
@ -21,8 +21,9 @@ export const richTextV2CompositeType: CompositeType = {
|
||||
],
|
||||
};
|
||||
|
||||
// with import only markdown subfield is filled, then blocknote is undefined
|
||||
export const richTextV2ValueSchema = z.object({
|
||||
blocknote: z.string().nullable(),
|
||||
blocknote: z.string().nullable().optional(),
|
||||
markdown: z.string().nullable(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user