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:
|
subFieldLabel:
|
||||||
COMPOSITE_FIELD_SUB_FIELD_LABELS[FieldMetadataType.RICH_TEXT_V2]
|
COMPOSITE_FIELD_SUB_FIELD_LABELS[FieldMetadataType.RICH_TEXT_V2]
|
||||||
.markdown,
|
.markdown,
|
||||||
isImportable: false,
|
isImportable: true,
|
||||||
isFilterable: false,
|
isFilterable: false,
|
||||||
isIncludedInUniqueConstraint: false,
|
isIncludedInUniqueConstraint: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
export const SpreadsheetImportCreateRecordsBatchSize = 500;
|
export const SpreadsheetImportCreateRecordsBatchSize = 200;
|
||||||
|
|||||||
@ -39,6 +39,7 @@ export const useDownloadFakeRecords = () => {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case FieldMetadataType.RICH_TEXT_V2:
|
||||||
case FieldMetadataType.ACTOR:
|
case FieldMetadataType.ACTOR:
|
||||||
case FieldMetadataType.EMAILS:
|
case FieldMetadataType.EMAILS:
|
||||||
case FieldMetadataType.CURRENCY:
|
case FieldMetadataType.CURRENCY:
|
||||||
|
|||||||
@ -99,13 +99,13 @@ export class RecordInputTransformerService {
|
|||||||
let convertedMarkdown: string | null = null;
|
let convertedMarkdown: string | null = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
convertedMarkdown = parsedValue.blocknote
|
convertedMarkdown = isDefined(parsedValue.blocknote)
|
||||||
? await serverBlockNoteEditor.blocksToMarkdownLossy(
|
? await serverBlockNoteEditor.blocksToMarkdownLossy(
|
||||||
JSON.parse(parsedValue.blocknote),
|
JSON.parse(parsedValue.blocknote),
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
} catch {
|
} catch {
|
||||||
convertedMarkdown = parsedValue.blocknote;
|
convertedMarkdown = parsedValue.blocknote || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const convertedBlocknote = parsedValue.markdown
|
const convertedBlocknote = parsedValue.markdown
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod';
|
|
||||||
import { FieldMetadataType } from 'twenty-shared/types';
|
import { FieldMetadataType } from 'twenty-shared/types';
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
import { CompositeType } from 'src/engine/metadata-modules/field-metadata/interfaces/composite-type.interface';
|
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({
|
export const richTextV2ValueSchema = z.object({
|
||||||
blocknote: z.string().nullable(),
|
blocknote: z.string().nullable().optional(),
|
||||||
markdown: z.string().nullable(),
|
markdown: z.string().nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user