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:
+5
@@ -0,0 +1,5 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`Create input validation - RICH_TEXT Gql create input - failure RICH_TEXT - should fail with : {"richTextField":"not-a-rich-text"} 1`] = `"Expected type "RichTextCreateInput" to be an object."`;
|
||||
|
||||
exports[`Create input validation - RICH_TEXT Rest create input - failure RICH_TEXT - should fail with : {"richTextField":"not-a-rich-text"} 1`] = `"["Invalid rich text v2 value 'not-a-rich-text' for field \\"richTextField\\" - Should be an object"]"`;
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`Create input validation - RICH_TEXT_V2 Gql create input - failure RICH_TEXT_V2 - should fail with : {"richTextV2Field":"not-a-rich-text"} 1`] = `"Expected type "RichTextV2CreateInput" to be an object."`;
|
||||
|
||||
exports[`Create input validation - RICH_TEXT_V2 Rest create input - failure RICH_TEXT_V2 - should fail with : {"richTextV2Field":"not-a-rich-text"} 1`] = `"["Invalid rich text v2 value 'not-a-rich-text' for field \\"richTextV2Field\\" - Should be an object"]"`;
|
||||
+2
-2
@@ -224,10 +224,10 @@ export const failingCreateInputByFieldMetadataType: {
|
||||
},
|
||||
},
|
||||
],
|
||||
[FieldMetadataType.RICH_TEXT_V2]: [
|
||||
[FieldMetadataType.RICH_TEXT]: [
|
||||
{
|
||||
input: {
|
||||
richTextV2Field: 'not-a-rich-text',
|
||||
richTextField: 'not-a-rich-text',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
+4
-4
@@ -369,18 +369,18 @@ export const successfulCreateInputByFieldMetadataType: {
|
||||
},
|
||||
},
|
||||
],
|
||||
[FieldMetadataType.RICH_TEXT_V2]: [
|
||||
[FieldMetadataType.RICH_TEXT]: [
|
||||
{
|
||||
input: {
|
||||
richTextV2Field: {
|
||||
richTextField: {
|
||||
blocknote: 'test',
|
||||
markdown: 'test',
|
||||
},
|
||||
},
|
||||
validateInput: (record: Record<string, any>) => {
|
||||
return (
|
||||
record.richTextV2Field.blocknote === 'test' &&
|
||||
record.richTextV2Field.markdown === 'test'
|
||||
record.richTextField.blocknote === 'test' &&
|
||||
record.richTextField.markdown === 'test'
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import { destroyManyObjectsMetadata } from 'test/integration/graphql/suites/inpu
|
||||
import { setupTestObjectsWithAllFieldTypes } from 'test/integration/graphql/suites/inputs-validation/utils/setup-test-objects-with-all-field-types.util';
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
const FIELD_METADATA_TYPE = FieldMetadataType.RICH_TEXT_V2;
|
||||
const FIELD_METADATA_TYPE = FieldMetadataType.RICH_TEXT;
|
||||
|
||||
const successfulTestCases =
|
||||
successfulCreateInputByFieldMetadataType[FIELD_METADATA_TYPE];
|
||||
Reference in New Issue
Block a user