feat: rename RICH_TEXT_V2 → RICH_TEXT in codebase (keep DB value) (#18628)
## Summary - Renames the `FieldMetadataType` enum key from `RICH_TEXT_V2` to `RICH_TEXT` across the entire codebase, while keeping the underlying string value as `'RICH_TEXT_V2'` to maintain PostgreSQL database compatibility - Renames all related types, guards, hooks, components, and files from `*RichTextV2*` / `*rich-text-v2*` to `*RichText*` / `*rich-text*` (e.g. `FormRichTextV2FieldInput` → `FormRichTextFieldInput`, `isFieldRichTextV2` → `isFieldRichText`) - Updates generated files (GraphQL schema, SDK types) to use the new key while preserving the `RICH_TEXT_V2` string value for DB/API layer - Updates i18n locale files, test snapshots, and integration tests to reflect the rename ## Context The legacy `RICH_TEXT` (V1) field type was deprecated and migrated to `TEXT` in a previous PR (#18623). With V1 gone, the `RICH_TEXT_V2` naming is no longer necessary — `RICH_TEXT` is now the canonical name. The DB enum value stays `'RICH_TEXT_V2'` to avoid confusion with the just-deprecated V1 type and to prevent a database migration. ## Test plan - [x] `twenty-server` typecheck passes - [x] `twenty-front` typecheck passes (only pre-existing Apollo client errors remain) - [x] `twenty-server` lint passes - [x] `twenty-front` lint passes - [x] `twenty-shared` build passes - [ ] CI passes Made with [Cursor](https://cursor.com)
This commit is contained in:
+1
-1
@@ -151,7 +151,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'bodyV2',
|
||||
type: FieldMetadataType.RICH_TEXT_V2,
|
||||
type: FieldMetadataType.RICH_TEXT,
|
||||
label: 'Body',
|
||||
description: 'Note body',
|
||||
icon: 'IconFilePencil',
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'bodyV2',
|
||||
type: FieldMetadataType.RICH_TEXT_V2,
|
||||
type: FieldMetadataType.RICH_TEXT,
|
||||
label: 'Body',
|
||||
description: 'Task body',
|
||||
icon: 'IconFilePencil',
|
||||
|
||||
+1
-1
@@ -367,7 +367,7 @@ You help users manage their workspace data model by creating, updating, and orga
|
||||
- **CURRENCY**: Monetary values
|
||||
- **RATING**: Star ratings
|
||||
- **RELATION**: Links to other objects
|
||||
- **RICH_TEXT_V2**: Formatted rich text content
|
||||
- **RICH_TEXT**: Formatted rich text content
|
||||
|
||||
## Best Practices
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ describe('getTsVectorColumnExpressionFromFields', () => {
|
||||
|
||||
it('should handle rich text v2 fields', () => {
|
||||
const fields = [
|
||||
{ name: 'bodyV2', type: FieldMetadataType.RICH_TEXT_V2 },
|
||||
{ name: 'bodyV2', type: FieldMetadataType.RICH_TEXT },
|
||||
] as FieldTypeAndNameMetadata[];
|
||||
const result = getTsVectorColumnExpressionFromFields(fields);
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ const SEARCHABLE_FIELD_TYPES = [
|
||||
FieldMetadataType.ADDRESS,
|
||||
FieldMetadataType.LINKS,
|
||||
FieldMetadataType.PHONES,
|
||||
FieldMetadataType.RICH_TEXT_V2,
|
||||
FieldMetadataType.RICH_TEXT,
|
||||
FieldMetadataType.UUID,
|
||||
] as const;
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ export const isSearchableSubfield = (
|
||||
}
|
||||
|
||||
switch (compositeFieldMetadataType) {
|
||||
case FieldMetadataType.RICH_TEXT_V2:
|
||||
case FieldMetadataType.RICH_TEXT:
|
||||
return ['markdown'].includes(subFieldName);
|
||||
case FieldMetadataType.PHONES:
|
||||
return ['primaryPhoneNumber', 'primaryPhoneCallingCode'].includes(
|
||||
|
||||
+3
-2
@@ -1,11 +1,12 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
// 'RICH_TEXT' kept as a raw string for pre-upgrade workspaces that haven't
|
||||
// yet run the 1.20 migrate-rich-text-to-text command.
|
||||
// Raw strings kept for pre-upgrade workspaces that haven't yet run
|
||||
// the 1.20 migrate-rich-text-to-text / rename-rich-text-v2 commands.
|
||||
export const isTextColumnType = (type: FieldMetadataType) => {
|
||||
return (
|
||||
type === FieldMetadataType.TEXT ||
|
||||
type === FieldMetadataType.ARRAY ||
|
||||
(type as string) === 'RICH_TEXT_V2' ||
|
||||
(type as string) === 'RICH_TEXT'
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user