-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RICH_TEXT display on cell (#8676)
## Context We added a check of the field type in [useTextFieldDisplay.ts](https://github.com/twentyhq/twenty/compare/c--fix-rich-text-display?expand=1#diff-8e53a2496b9faa67ac9aad3f7016efed19147557904da1bc44e895688513330d) however this hook is also used for RICH_TEXT fields so it fails. I'm removing this check since I don't think this is necessary, the caller should already know its a TEXT or RICH_TEXT
- Loading branch information
Showing
2 changed files
with
6 additions
and
10 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
...src/modules/object-record/record-field/meta-types/display/components/TextFieldDisplay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { useTextFieldDisplay } from '@/object-record/record-field/meta-types/hooks/useTextFieldDisplay'; | ||
import { isFieldText } from '@/object-record/record-field/types/guards/isFieldText'; | ||
import { TextDisplay } from '@/ui/field/display/components/TextDisplay'; | ||
|
||
export const TextFieldDisplay = () => { | ||
const { fieldValue, fieldDefinition } = useTextFieldDisplay(); | ||
|
||
return ( | ||
<TextDisplay | ||
text={fieldValue} | ||
displayedMaxRows={fieldDefinition.metadata?.settings?.displayedMaxRows} | ||
/> | ||
); | ||
const displayedMaxRows = isFieldText(fieldDefinition) | ||
? fieldDefinition.metadata?.settings?.displayedMaxRows | ||
: 1; | ||
|
||
return <TextDisplay text={fieldValue} displayedMaxRows={displayedMaxRows} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters