From fda0d2a1708a3b3f48b795bd2f3e64f928a37cb1 Mon Sep 17 00:00:00 2001 From: Weiko Date: Wed, 5 Jun 2024 18:14:09 +0200 Subject: [PATCH] Fix edit button missing in activity editor (#5757) ## Context Fixing `setIsFocused is not a function` and the fact that edit buttons were not showing up anymore. A new FieldFocusContextProvider has been introduced and added to RecordInlineCell but not ActivityTargetsInlineCell. This should fix the issue. Screenshot 2024-06-05 at 17 42 07 --- .../components/ActivityTargetsInlineCell.tsx | 49 ++++++++++--------- .../object-metadata/utils/getAvatarUrl.ts | 2 +- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/packages/twenty-front/src/modules/activities/inline-cell/components/ActivityTargetsInlineCell.tsx b/packages/twenty-front/src/modules/activities/inline-cell/components/ActivityTargetsInlineCell.tsx index 21310d09aa..7971a5a8f8 100644 --- a/packages/twenty-front/src/modules/activities/inline-cell/components/ActivityTargetsInlineCell.tsx +++ b/packages/twenty-front/src/modules/activities/inline-cell/components/ActivityTargetsInlineCell.tsx @@ -6,6 +6,7 @@ import { useActivityTargetObjectRecords } from '@/activities/hooks/useActivityTa import { ActivityTargetInlineCellEditMode } from '@/activities/inline-cell/components/ActivityTargetInlineCellEditMode'; import { Activity } from '@/activities/types/Activity'; import { ActivityEditorHotkeyScope } from '@/activities/types/ActivityEditorHotkeyScope'; +import { FieldFocusContextProvider } from '@/object-record/record-field/contexts/FieldFocusContextProvider'; import { RecordFieldInputScope } from '@/object-record/record-field/scopes/RecordFieldInputScope'; import { RecordInlineCellContainer } from '@/object-record/record-inline-cell/components/RecordInlineCellContainer'; import { useInlineCell } from '@/object-record/record-inline-cell/hooks/useInlineCell'; @@ -38,29 +39,31 @@ export const ActivityTargetsInlineCell = ({ return ( - - } - label="Relations" - displayModeContent={ - - } - isDisplayModeContentEmpty={activityTargetObjectRecords.length === 0} - /> + + + } + label="Relations" + displayModeContent={ + + } + isDisplayModeContentEmpty={activityTargetObjectRecords.length === 0} + /> + ); }; diff --git a/packages/twenty-front/src/modules/object-metadata/utils/getAvatarUrl.ts b/packages/twenty-front/src/modules/object-metadata/utils/getAvatarUrl.ts index f61197de06..7965b905b4 100644 --- a/packages/twenty-front/src/modules/object-metadata/utils/getAvatarUrl.ts +++ b/packages/twenty-front/src/modules/object-metadata/utils/getAvatarUrl.ts @@ -2,10 +2,10 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem'; import { ObjectRecord } from '@/object-record/types/ObjectRecord'; import { getLogoUrlFromDomainName } from '~/utils'; +import { getImageAbsoluteURIOrBase64 } from '~/utils/image/getImageAbsoluteURIOrBase64'; import { isDefined } from '~/utils/isDefined'; import { getImageIdentifierFieldValue } from './getImageIdentifierFieldValue'; -import { getImageAbsoluteURIOrBase64 } from '~/utils/image/getImageAbsoluteURIOrBase64'; export const getAvatarUrl = ( objectNameSingular: string,