4702 rename calendareventattendee to calendareventparticipant (#4761)

Closes #4702
This commit is contained in:
bosiraphael
2024-04-04 14:00:10 +02:00
committed by GitHub
parent 357882c395
commit 85caed3463
36 changed files with 305 additions and 330 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,6 +34,23 @@ export type ApiKeyToken = {
token: Scalars['String'];
};
export type AppToken = {
__typename?: 'AppToken';
createdAt: Scalars['DateTime'];
expiresAt: Scalars['DateTime'];
id: Scalars['ID'];
type: Scalars['String'];
updatedAt: Scalars['DateTime'];
};
export type AppTokenEdge = {
__typename?: 'AppTokenEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the AppToken */
node: AppToken;
};
export type AuthProviders = {
__typename?: 'AuthProviders';
google: Scalars['Boolean'];
@ -110,12 +127,6 @@ export type ClientConfig = {
telemetry: Telemetry;
};
export type CreateRemoteServerInput = {
foreignDataWrapperOptions: Scalars['JSON'];
foreignDataWrapperType: Scalars['String'];
userMappingOptions?: InputMaybe<Scalars['JSON']>;
};
export type CursorPaging = {
/** Paginate after opaque cursor */
after?: InputMaybe<Scalars['ConnectionCursor']>;
@ -271,12 +282,10 @@ export type Mutation = {
authorizeApp: AuthorizeApp;
challenge: LoginToken;
checkoutSession: SessionEntity;
createOneAppToken: AppToken;
createOneObject: Object;
createOneRefreshToken: RefreshToken;
createOneRemoteServer: RemoteServer;
deleteCurrentWorkspace: Workspace;
deleteOneObject: Object;
deleteOneRemoteServer: RemoteServer;
deleteUser: User;
emailPasswordResetLink: EmailPasswordResetLink;
generateApiKeyToken: ApiKeyToken;
@ -321,21 +330,11 @@ export type MutationCheckoutSessionArgs = {
};
export type MutationCreateOneRemoteServerArgs = {
input: CreateRemoteServerInput;
};
export type MutationDeleteOneObjectArgs = {
input: DeleteOneObjectInput;
};
export type MutationDeleteOneRemoteServerArgs = {
input: RemoteServerIdInput;
};
export type MutationEmailPasswordResetLinkArgs = {
email: Scalars['String'];
};
@ -358,7 +357,7 @@ export type MutationImpersonateArgs = {
export type MutationRenewTokenArgs = {
refreshToken: Scalars['String'];
appToken: Scalars['String'];
};
@ -463,8 +462,6 @@ export type Query = {
currentUser: User;
currentWorkspace: Workspace;
exchangeAuthorizationCode: ExchangeAuthCode;
findManyRemoteServersByType: Array<RemoteServer>;
findOneRemoteServerById: RemoteServer;
findWorkspaceFromInviteHash: Workspace;
getProductPrices: ProductPricesEntity;
getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal;
@ -498,16 +495,6 @@ export type QueryExchangeAuthorizationCodeArgs = {
};
export type QueryFindManyRemoteServersByTypeArgs = {
input: RemoteServerTypeInput;
};
export type QueryFindOneRemoteServerByIdArgs = {
input: RemoteServerIdInput;
};
export type QueryFindWorkspaceFromInviteHashArgs = {
inviteHash: Scalars['String'];
};
@ -550,22 +537,6 @@ export type QueryValidatePasswordResetTokenArgs = {
passwordResetToken: Scalars['String'];
};
export type RefreshToken = {
__typename?: 'RefreshToken';
createdAt: Scalars['DateTime'];
expiresAt: Scalars['DateTime'];
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
};
export type RefreshTokenEdge = {
__typename?: 'RefreshTokenEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the RefreshToken */
node: RefreshToken;
};
export type RelationConnection = {
__typename?: 'RelationConnection';
/** Array of edges. */
@ -620,14 +591,6 @@ export type RemoteServer = {
updatedAt: Scalars['DateTime'];
};
export type RemoteServerIdInput = {
/** The id of the record. */
id: Scalars['ID'];
};
export type RemoteServerTypeInput = {
foreignDataWrapperType: Scalars['String'];
};
export type RemoteTable = {
__typename?: 'RemoteTable';
name: Scalars['String'];
@ -677,7 +640,6 @@ export type Telemetry = {
export type TimelineCalendarEvent = {
__typename?: 'TimelineCalendarEvent';
attendees: Array<TimelineCalendarEventAttendee>;
conferenceLink: LinkMetadata;
conferenceSolution: Scalars['String'];
description: Scalars['String'];
@ -686,13 +648,14 @@ export type TimelineCalendarEvent = {
isCanceled: Scalars['Boolean'];
isFullDay: Scalars['Boolean'];
location: Scalars['String'];
participants: Array<TimelineCalendarEventParticipant>;
startsAt: Scalars['DateTime'];
title: Scalars['String'];
visibility: TimelineCalendarEventVisibility;
};
export type TimelineCalendarEventAttendee = {
__typename?: 'TimelineCalendarEventAttendee';
export type TimelineCalendarEventParticipant = {
__typename?: 'TimelineCalendarEventParticipant';
avatarUrl: Scalars['String'];
displayName: Scalars['String'];
firstName: Scalars['String'];
@ -972,11 +935,11 @@ export type RelationEdge = {
node: Relation;
};
export type TimelineCalendarEventAttendeeFragmentFragment = { __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
export type TimelineCalendarEventsWithTotalFragmentFragment = { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> };
export type TimelineCalendarEventsWithTotalFragmentFragment = { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> };
export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
companyId: Scalars['ID'];
@ -985,7 +948,7 @@ export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
}>;
export type GetTimelineCalendarEventsFromCompanyIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromCompanyId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
export type GetTimelineCalendarEventsFromCompanyIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromCompanyId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
personId: Scalars['ID'];
@ -994,7 +957,7 @@ export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
}>;
export type GetTimelineCalendarEventsFromPersonIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromPersonId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
export type GetTimelineCalendarEventsFromPersonIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromPersonId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
export type ParticipantFragmentFragment = { __typename?: 'TimelineThreadParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
@ -1085,7 +1048,7 @@ export type ImpersonateMutationVariables = Exact<{
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale: string, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, defaultWorkspace: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null, inviteHash?: string | null, allowImpersonation: boolean, subscriptionStatus: string, activationStatus: string, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: string, key: string, value: boolean, workspaceId: string }> | null }, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: string, logo?: string | null, displayName?: string | null, domainName?: string | null } | null }> }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
export type RenewTokenMutationVariables = Exact<{
refreshToken: Scalars['String'];
appToken: Scalars['String'];
}>;
@ -1229,8 +1192,8 @@ export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
export type GetWorkspaceFromInviteHashQuery = { __typename?: 'Query', findWorkspaceFromInviteHash: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean } };
export const TimelineCalendarEventAttendeeFragmentFragmentDoc = gql`
fragment TimelineCalendarEventAttendeeFragment on TimelineCalendarEventAttendee {
export const TimelineCalendarEventParticipantFragmentFragmentDoc = gql`
fragment TimelineCalendarEventParticipantFragment on TimelineCalendarEventParticipant {
personId
workspaceMemberId
firstName
@ -1250,11 +1213,11 @@ export const TimelineCalendarEventFragmentFragmentDoc = gql`
endsAt
isFullDay
visibility
attendees {
...TimelineCalendarEventAttendeeFragment
participants {
...TimelineCalendarEventParticipantFragment
}
}
${TimelineCalendarEventAttendeeFragmentFragmentDoc}`;
${TimelineCalendarEventParticipantFragmentFragmentDoc}`;
export const TimelineCalendarEventsWithTotalFragmentFragmentDoc = gql`
fragment TimelineCalendarEventsWithTotalFragment on TimelineCalendarEventsWithTotal {
totalNumberOfCalendarEvents
@ -1811,8 +1774,8 @@ export type ImpersonateMutationHookResult = ReturnType<typeof useImpersonateMuta
export type ImpersonateMutationResult = Apollo.MutationResult<ImpersonateMutation>;
export type ImpersonateMutationOptions = Apollo.BaseMutationOptions<ImpersonateMutation, ImpersonateMutationVariables>;
export const RenewTokenDocument = gql`
mutation RenewToken($refreshToken: String!) {
renewToken(refreshToken: $refreshToken) {
mutation RenewToken($appToken: String!) {
renewToken(appToken: $appToken) {
tokens {
...AuthTokensFragment
}
@ -1834,7 +1797,7 @@ export type RenewTokenMutationFn = Apollo.MutationFunction<RenewTokenMutation, R
* @example
* const [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({
* variables: {
* refreshToken: // value for 'refreshToken'
* appToken: // value for 'appToken'
* },
* });
*/

View File

@ -115,7 +115,7 @@ export const CalendarEventRow = ({
: format(startsAt, 'HH:mm');
const endTimeLabel = calendarEvent.isFullDay ? '' : format(endsAt, 'HH:mm');
const isCurrentWorkspaceMemberAttending = calendarEvent.attendees?.some(
const isCurrentWorkspaceMemberAttending = calendarEvent.participants?.some(
({ workspaceMemberId }) => workspaceMemberId === currentWorkspaceMember?.id,
);
const showTitle = calendarEvent.visibility === 'SHARE_EVERYTHING';
@ -154,19 +154,19 @@ export const CalendarEventRow = ({
</StyledVisibilityCard>
)}
</StyledLabels>
{!!calendarEvent.attendees?.length && (
{!!calendarEvent.participants?.length && (
<AvatarGroup
avatars={calendarEvent.attendees.map((attendee) => (
avatars={calendarEvent.participants.map((participant) => (
<Avatar
key={[attendee.workspaceMemberId, attendee.displayName]
key={[participant.workspaceMemberId, participant.displayName]
.filter(isDefined)
.join('-')}
avatarUrl={
attendee.workspaceMemberId === currentWorkspaceMember?.id
participant.workspaceMemberId === currentWorkspaceMember?.id
? currentWorkspaceMember?.avatarUrl
: undefined
}
placeholder={attendee.displayName}
placeholder={participant.displayName}
type="rounded"
/>
))}

View File

@ -10,7 +10,7 @@ import { sortDesc } from '~/utils/sort';
type CalendarEventGeneric = Omit<
CalendarEvent,
'attendees' | 'externalCreatedAt'
'participants' | 'externalCreatedAt'
>;
export const useCalendarEvents = <T extends CalendarEventGeneric>(

View File

@ -1,13 +0,0 @@
import { gql } from '@apollo/client';
export const timelineCalendarEventAttendeeFragment = gql`
fragment TimelineCalendarEventAttendeeFragment on TimelineCalendarEventAttendee {
personId
workspaceMemberId
firstName
lastName
displayName
avatarUrl
handle
}
`;

View File

@ -1,6 +1,6 @@
import { gql } from '@apollo/client';
import { timelineCalendarEventAttendeeFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventAttendeeFragment';
import { timelineCalendarEventParticipantFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventParticipantFragment';
export const timelineCalendarEventFragment = gql`
fragment TimelineCalendarEventFragment on TimelineCalendarEvent {
@ -12,9 +12,9 @@ export const timelineCalendarEventFragment = gql`
endsAt
isFullDay
visibility
attendees {
...TimelineCalendarEventAttendeeFragment
participants {
...TimelineCalendarEventParticipantFragment
}
}
${timelineCalendarEventAttendeeFragment}
${timelineCalendarEventParticipantFragment}
`;

View File

@ -0,0 +1,13 @@
import { gql } from '@apollo/client';
export const timelineCalendarEventParticipantFragment = gql`
fragment TimelineCalendarEventParticipantFragment on TimelineCalendarEventParticipant {
personId
workspaceMemberId
firstName
lastName
displayName
avatarUrl
handle
}
`;

View File

@ -14,7 +14,7 @@ export type CalendarEvent = {
startsAt: string;
title?: string;
visibility: 'METADATA' | 'SHARE_EVERYTHING';
attendees?: {
participants?: {
displayName: string;
workspaceMemberId?: string;
}[];

View File

@ -1,8 +1,8 @@
import { gql } from '@apollo/client';
export const RENEW_TOKEN = gql`
mutation RenewToken($refreshToken: String!) {
renewToken(refreshToken: $refreshToken) {
mutation RenewToken($appToken: String!) {
renewToken(appToken: $appToken) {
tokens {
...AuthTokensFragment
}

View File

@ -42,7 +42,7 @@ const renewTokenMutation = async (
>({
mutation: RenewTokenDocument,
variables: {
refreshToken: refreshToken,
appToken: refreshToken,
},
fetchPolicy: 'network-only',
});

View File

@ -51,7 +51,7 @@ export const SettingsAccountsCalendars = () => {
const exampleDayTime = startOfDay(exampleStartDate).getTime();
const exampleCalendarEvent: TimelineCalendarEvent = {
id: '',
attendees: [
participants: [
{
firstName: currentWorkspaceMember?.name.firstName || '',
lastName: currentWorkspaceMember?.name.lastName || '',

View File

@ -10,7 +10,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
isFullDay: false,
startsAt: addDays(new Date().setHours(10, 0), 1).toISOString(),
visibility: 'METADATA',
attendees: [
participants: [
{ displayName: 'John Doe', workspaceMemberId: 'john-doe' },
{ displayName: 'Jane Doe', workspaceMemberId: 'jane-doe' },
{ displayName: 'Tim Apple', workspaceMemberId: 'tim-apple' },

View File

@ -1443,9 +1443,9 @@ const mockedCalendarEventsMetadata = {
__typename: 'field',
id: '07880d2d-4f08-458f-be0b-876402d2a769',
type: 'RELATION',
name: 'eventAttendees',
label: 'Event Attendees',
description: 'Event Attendees',
name: 'eventParticipants',
label: 'Event Participants',
description: 'Event Participants',
icon: 'IconUserCircle',
isCustom: false,
isActive: true,
@ -1465,8 +1465,8 @@ const mockedCalendarEventsMetadata = {
__typename: 'object',
id: '4adb1b1a-9643-4d1c-a2a0-b1b02ae192ad',
dataSourceId: 'fa94b810-e848-490c-a5f7-24a1ee5bfaa6',
nameSingular: 'calendarEventAttendee',
namePlural: 'calendarEventAttendees',
nameSingular: 'calendarEventParticipant',
namePlural: 'calendarEventParticipants',
isSystem: true,
},
},