Skip to content

Commit

Permalink
Fix missing team member images in calendar event (twentyhq#5414)
Browse files Browse the repository at this point in the history
### Work
Fixed issue: twentyhq#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 <[email protected]>
  • Loading branch information
mritosa and charlesBochet authored May 15, 2024
1 parent fde5520 commit 9bb7117
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
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';

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]),
});

Expand Down

0 comments on commit 9bb7117

Please sign in to comment.