feat: enable Rich Text as a creatable field type (#18634)
## Summary - Removes `RICH_TEXT` from the excluded/hidden field types in the settings UI so users can create rich text fields on any object (not just Note/Task) - Creates a generic `RichTextFieldEditor` component that uses standard `useUpdateOneRecord` for persistence, decoupled from the Note/Task-specific `ActivityRichTextEditor` - Updates the inline `RichTextFieldInput` and side panel to route to the appropriate editor based on object type (activity editor for Note/Task, generic editor for everything else) ## Details ### Tier 1 — Settings UI unlock - Removed `RICH_TEXT` from `excludedFieldTypes` in `SettingsObjectNewFieldSelect.tsx` - Removed `RICH_TEXT` from `SettingsExcludedFieldType` type union - Added `RICH_TEXT` to `previewableTypes` in `SettingsDataModelFieldSettingsFormCard` ### Tier 2 — Generic inline editing - New `RichTextFieldEditor` — a generic BlockNote editor that works for any object using `useUpdateOneRecord` (no activity-specific coupling) - `RichTextFieldInput` now branches: `ActivityRichTextEditor` for Note/Task, `RichTextFieldEditor` for all other objects - Generalized side panel state (`viewableRichTextComponentState`) from `activityId`/`activityObjectNameSingular` to `recordId`/`objectNameSingular`/`fieldName` - `useOpenRichTextInSidePanel` now accepts an optional `fieldName` parameter ### Tier 3 — Verification - Search: only `markdown` subfield is indexed (correct behavior) - Filters: `RichTextFilter` GraphQL input type already exists - Import/export: `markdown` subfield is already marked `isImportable: true`
This commit is contained in:
@@ -12,10 +12,11 @@ export const useOpenRichTextInSidePanel = () => {
|
||||
const store = useStore();
|
||||
|
||||
const openRichTextInSidePanel = useCallback(
|
||||
(activityId: string, activityObjectNameSingular: string) => {
|
||||
(recordId: string, objectNameSingular: string, fieldName?: string) => {
|
||||
store.set(viewableRichTextComponentState.atom, {
|
||||
activityId,
|
||||
activityObjectNameSingular,
|
||||
recordId,
|
||||
objectNameSingular,
|
||||
fieldName: fieldName ?? 'bodyV2',
|
||||
});
|
||||
|
||||
openSidePanelMenu();
|
||||
|
||||
Reference in New Issue
Block a user