Fix missing team member images in calendar event (#5414)

### Work
Fixed issue: #5308 
### Before
Team member images are absent from Calendar events participant chips.

![Before](https://github.com/twentyhq/twenty/assets/100703401/bd3408ad-4a07-430e-ba23-83cd0775492a)
### After
<img width="383" alt="Screenshot 2024-05-14 at 10 53 24"
src="https://github.com/twentyhq/twenty/assets/100703401/b65efe8a-64de-4214-a60a-ee87d235953a">

### Fix explained
Redefined recordGqlField to fech Person and WorkspaceMember

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
mritosa 2024-05-15 19:14:57 +02:00 committed by GitHub
parent de228be5ca
commit e9a7a8a4a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,33 @@
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { RecordGqlOperationSignature } from '@/object-record/graphql/types/RecordGqlOperationSignature';
export const FIND_ONE_CALENDAR_EVENT_OPERATION_SIGNATURE: RecordGqlOperationSignature =
{
objectNameSingular: CoreObjectNameSingular.CalendarEvent,
variables: {},
fields: {
conferenceLink: true,
description: true,
endsAt: true,
externalCreatedAt: true,
id: true,
isCanceled: true,
isFullDay: true,
location: true,
startsAt: true,
title: true,
visibility: true,
calendarEventParticipants: {
id: true,
person: true,
workspaceMember: true,
isOrganizer: true,
responseStatus: true,
handle: true,
createdAt: true,
calendarEventId: true,
updatedAt: true,
displayName: true,
},
},
};

View File

@ -1,9 +1,9 @@
import { useRecoilValue } from 'recoil';
import { CalendarEventDetails } from '@/activities/calendar/components/CalendarEventDetails';
import { FIND_ONE_CALENDAR_EVENT_OPERATION_SIGNATURE } from '@/activities/calendar/graphql/operation-signatures/FindOneCalendarEventOperationSignature';
import { viewableCalendarEventIdState } from '@/activities/calendar/states/viewableCalendarEventIdState';
import { CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { useSetRecordInStore } from '@/object-record/record-store/hooks/useSetRecordInStore';
@ -11,8 +11,10 @@ export const RightDrawerCalendarEvent = () => {
const { setRecords } = useSetRecordInStore();
const viewableCalendarEventId = useRecoilValue(viewableCalendarEventIdState);
const { record: calendarEvent } = useFindOneRecord<CalendarEvent>({
objectNameSingular: CoreObjectNameSingular.CalendarEvent,
objectNameSingular:
FIND_ONE_CALENDAR_EVENT_OPERATION_SIGNATURE.objectNameSingular,
objectRecordId: viewableCalendarEventId ?? '',
recordGqlFields: FIND_ONE_CALENDAR_EVENT_OPERATION_SIGNATURE.fields,
onCompleted: (record) => setRecords([record]),
});