4506 change field labels and field type for calendarevent object metadata to match figma (#4679)
* update calendarEvent labels and description to match Figma * modify conferenceUri to conferenceLink with LINK type * update format-google-calendar-event.util to match new conferenceLink * update CalendarEventDetails since overriding the fields is no longer needed * fix mock metadata * generate new uuid for field conferenceLink
This commit is contained in:
@ -175,6 +175,12 @@ export type CreateRelationInput = {
|
||||
toObjectMetadataId: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type CreateRemoteServerInput = {
|
||||
foreignDataWrapperOptions: Scalars['JSON']['input'];
|
||||
foreignDataWrapperType: Scalars['String']['input'];
|
||||
userMappingOptions?: InputMaybe<Scalars['JSON']['input']>;
|
||||
};
|
||||
|
||||
export type CursorPaging = {
|
||||
/** Paginate after opaque cursor */
|
||||
after?: InputMaybe<Scalars['ConnectionCursor']['input']>;
|
||||
@ -315,6 +321,12 @@ export type InvalidatePassword = {
|
||||
success: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
export type LinkMetadata = {
|
||||
__typename?: 'LinkMetadata';
|
||||
label: Scalars['String']['output'];
|
||||
url: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type LoginToken = {
|
||||
__typename?: 'LoginToken';
|
||||
loginToken: AuthToken;
|
||||
@ -329,10 +341,12 @@ export type Mutation = {
|
||||
createOneObject: Object;
|
||||
createOneRefreshToken: RefreshToken;
|
||||
createOneRelation: Relation;
|
||||
createOneRemoteServer: RemoteServer;
|
||||
deleteCurrentWorkspace: Workspace;
|
||||
deleteOneField: FieldDeleteResponse;
|
||||
deleteOneObject: Object;
|
||||
deleteOneRelation: RelationDeleteResponse;
|
||||
deleteOneRemoteServer: RemoteServer;
|
||||
deleteUser: User;
|
||||
emailPasswordResetLink: EmailPasswordResetLink;
|
||||
generateApiKeyToken: ApiKeyToken;
|
||||
@ -392,6 +406,11 @@ export type MutationCreateOneRelationArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateOneRemoteServerArgs = {
|
||||
input: CreateRemoteServerInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteOneFieldArgs = {
|
||||
input: DeleteOneFieldInput;
|
||||
};
|
||||
@ -407,6 +426,11 @@ export type MutationDeleteOneRelationArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteOneRemoteServerArgs = {
|
||||
input: RemoteServerIdInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationEmailPasswordResetLinkArgs = {
|
||||
email: Scalars['String']['input'];
|
||||
};
|
||||
@ -545,6 +569,9 @@ export type Query = {
|
||||
currentWorkspace: Workspace;
|
||||
field: Field;
|
||||
fields: FieldConnection;
|
||||
findAvailableRemoteTablesByServerId: Array<RemoteTable>;
|
||||
findManyRemoteServersByType: Array<RemoteServer>;
|
||||
findOneRemoteServerById: RemoteServer;
|
||||
findWorkspaceFromInviteHash: Workspace;
|
||||
getProductPrices: ProductPricesEntity;
|
||||
getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal;
|
||||
@ -585,6 +612,21 @@ export type QueryFieldsArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindAvailableRemoteTablesByServerIdArgs = {
|
||||
input: RemoteServerIdInput;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindManyRemoteServersByTypeArgs = {
|
||||
input: RemoteServerTypeInput;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindOneRemoteServerByIdArgs = {
|
||||
input: RemoteServerIdInput;
|
||||
};
|
||||
|
||||
|
||||
export type QueryFindWorkspaceFromInviteHashArgs = {
|
||||
inviteHash: Scalars['String']['input'];
|
||||
};
|
||||
@ -708,6 +750,38 @@ export enum RelationMetadataType {
|
||||
OneToOne = 'ONE_TO_ONE'
|
||||
}
|
||||
|
||||
export type RemoteServer = {
|
||||
__typename?: 'RemoteServer';
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
foreignDataWrapperId: Scalars['ID']['output'];
|
||||
foreignDataWrapperOptions?: Maybe<Scalars['JSON']['output']>;
|
||||
foreignDataWrapperType: Scalars['String']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
updatedAt: Scalars['DateTime']['output'];
|
||||
};
|
||||
|
||||
export type RemoteServerIdInput = {
|
||||
/** The id of the record. */
|
||||
id: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
export type RemoteServerTypeInput = {
|
||||
foreignDataWrapperType: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type RemoteTable = {
|
||||
__typename?: 'RemoteTable';
|
||||
name: Scalars['String']['output'];
|
||||
schema: Scalars['String']['output'];
|
||||
status: RemoteTableStatus;
|
||||
};
|
||||
|
||||
/** Status of the table */
|
||||
export enum RemoteTableStatus {
|
||||
NotSynced = 'NOT_SYNCED',
|
||||
Synced = 'SYNCED'
|
||||
}
|
||||
|
||||
export type Sentry = {
|
||||
__typename?: 'Sentry';
|
||||
dsn?: Maybe<Scalars['String']['output']>;
|
||||
@ -745,8 +819,8 @@ export type Telemetry = {
|
||||
export type TimelineCalendarEvent = {
|
||||
__typename?: 'TimelineCalendarEvent';
|
||||
attendees: Array<TimelineCalendarEventAttendee>;
|
||||
conferenceLink: LinkMetadata;
|
||||
conferenceSolution: Scalars['String']['output'];
|
||||
conferenceUri: Scalars['String']['output'];
|
||||
description: Scalars['String']['output'];
|
||||
endsAt: Scalars['DateTime']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
|
||||
@ -235,6 +235,12 @@ export type InvalidatePassword = {
|
||||
success: Scalars['Boolean'];
|
||||
};
|
||||
|
||||
export type LinkMetadata = {
|
||||
__typename?: 'LinkMetadata';
|
||||
label: Scalars['String'];
|
||||
url: Scalars['String'];
|
||||
};
|
||||
|
||||
export type LoginToken = {
|
||||
__typename?: 'LoginToken';
|
||||
loginToken: AuthToken;
|
||||
@ -547,6 +553,29 @@ export enum RelationMetadataType {
|
||||
OneToOne = 'ONE_TO_ONE'
|
||||
}
|
||||
|
||||
export type RemoteServer = {
|
||||
__typename?: 'RemoteServer';
|
||||
createdAt: Scalars['DateTime'];
|
||||
foreignDataWrapperId: Scalars['ID'];
|
||||
foreignDataWrapperOptions?: Maybe<Scalars['JSON']>;
|
||||
foreignDataWrapperType: Scalars['String'];
|
||||
id: Scalars['ID'];
|
||||
updatedAt: Scalars['DateTime'];
|
||||
};
|
||||
|
||||
export type RemoteTable = {
|
||||
__typename?: 'RemoteTable';
|
||||
name: Scalars['String'];
|
||||
schema: Scalars['String'];
|
||||
status: RemoteTableStatus;
|
||||
};
|
||||
|
||||
/** Status of the table */
|
||||
export enum RemoteTableStatus {
|
||||
NotSynced = 'NOT_SYNCED',
|
||||
Synced = 'SYNCED'
|
||||
}
|
||||
|
||||
export type Sentry = {
|
||||
__typename?: 'Sentry';
|
||||
dsn?: Maybe<Scalars['String']>;
|
||||
@ -584,8 +613,8 @@ export type Telemetry = {
|
||||
export type TimelineCalendarEvent = {
|
||||
__typename?: 'TimelineCalendarEvent';
|
||||
attendees: Array<TimelineCalendarEventAttendee>;
|
||||
conferenceLink: LinkMetadata;
|
||||
conferenceSolution: Scalars['String'];
|
||||
conferenceUri: Scalars['String'];
|
||||
description: Scalars['String'];
|
||||
endsAt: Scalars['DateTime'];
|
||||
id: Scalars['ID'];
|
||||
@ -878,9 +907,9 @@ export type RelationEdge = {
|
||||
|
||||
export type AttendeeFragmentFragment = { __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
||||
|
||||
export type CalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
||||
export type CalendarEventFragmentFragment = { __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, 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, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> };
|
||||
|
||||
export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
|
||||
companyId: Scalars['ID'];
|
||||
@ -889,7 +918,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, 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, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
|
||||
|
||||
export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
|
||||
personId: Scalars['ID'];
|
||||
@ -898,7 +927,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, 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, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', 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 };
|
||||
|
||||
@ -1145,6 +1174,7 @@ export const CalendarEventFragmentFragmentDoc = gql`
|
||||
startsAt
|
||||
endsAt
|
||||
isFullDay
|
||||
visibility
|
||||
attendees {
|
||||
...AttendeeFragment
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@ import { useObjectMetadataItemOnly } from '@/object-metadata/hooks/useObjectMeta
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition';
|
||||
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
|
||||
import { FieldDefinition } from '@/object-record/record-field/types/FieldDefinition';
|
||||
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { RecordInlineCell } from '@/object-record/record-inline-cell/components/RecordInlineCell';
|
||||
import { PropertyBox } from '@/object-record/record-inline-cell/property-box/components/PropertyBox';
|
||||
import {
|
||||
@ -77,18 +75,14 @@ export const CalendarEventDetails = ({
|
||||
objectNameSingular: CoreObjectNameSingular.CalendarEvent,
|
||||
});
|
||||
|
||||
const fieldsToDisplay: Partial<
|
||||
Record<
|
||||
keyof CalendarEvent,
|
||||
Partial<Pick<FieldDefinition<FieldMetadata>, 'label'>>
|
||||
>
|
||||
> = {
|
||||
startsAt: { label: 'Start Date' },
|
||||
endsAt: { label: 'End Date' },
|
||||
conferenceUri: { label: 'Meet link' },
|
||||
location: {},
|
||||
description: {},
|
||||
};
|
||||
const fieldsToDisplay = [
|
||||
'startsAt',
|
||||
'endsAt',
|
||||
'conferenceLink',
|
||||
'location',
|
||||
'description',
|
||||
];
|
||||
|
||||
const fieldsByName = mapArrayToObject(
|
||||
objectMetadataItem.fields,
|
||||
({ name }) => name,
|
||||
@ -116,7 +110,7 @@ export const CalendarEventDetails = ({
|
||||
</StyledCreatedAt>
|
||||
</StyledHeader>
|
||||
<StyledFields>
|
||||
{Object.entries(fieldsToDisplay).map(([fieldName, fieldOverride]) => (
|
||||
{fieldsToDisplay.map((fieldName) => (
|
||||
<StyledPropertyBox key={fieldName}>
|
||||
<FieldContext.Provider
|
||||
value={{
|
||||
@ -125,10 +119,7 @@ export const CalendarEventDetails = ({
|
||||
recoilScopeId: `${calendarEvent.id}-${fieldName}`,
|
||||
isLabelIdentifier: false,
|
||||
fieldDefinition: formatFieldMetadataItemAsFieldDefinition({
|
||||
field: {
|
||||
...fieldsByName[fieldName],
|
||||
...fieldOverride,
|
||||
},
|
||||
field: fieldsByName[fieldName],
|
||||
objectMetadataItem,
|
||||
showLabel: true,
|
||||
labelWidth: 72,
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
// TODO: use backend CalendarEvent type when ready
|
||||
export type CalendarEvent = {
|
||||
conferenceUri?: string;
|
||||
conferenceLink?: {
|
||||
label: string;
|
||||
url: string;
|
||||
};
|
||||
description?: string;
|
||||
endsAt?: string;
|
||||
externalCreatedAt: string;
|
||||
|
||||
@ -69,7 +69,10 @@ export const SettingsAccountsCalendars = () => {
|
||||
isFullDay: false,
|
||||
startsAt: exampleStartDate.toISOString(),
|
||||
conferenceSolution: '',
|
||||
conferenceUri: '',
|
||||
conferenceLink: {
|
||||
label: '',
|
||||
url: '',
|
||||
},
|
||||
description: '',
|
||||
isCanceled: false,
|
||||
location: '',
|
||||
|
||||
@ -1240,19 +1240,20 @@ const mockedCalendarEventsMetadata = {
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '071d3b2a-9168-45bb-9a83-e840eb707d14',
|
||||
type: 'TEXT',
|
||||
name: 'conferenceUri',
|
||||
label: 'Conference URI',
|
||||
description: 'Conference URI',
|
||||
type: FieldMetadataType.Link,
|
||||
name: 'conferenceLink',
|
||||
label: 'Conference Link',
|
||||
description: 'Conference Link',
|
||||
icon: 'IconLink',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isNullable: true,
|
||||
createdAt: '2024-03-15T13:39:09.965Z',
|
||||
updatedAt: '2024-03-15T13:39:09.965Z',
|
||||
defaultValue: {
|
||||
value: '',
|
||||
label: 'https://zoom.us',
|
||||
value: 'https://zoom.us',
|
||||
},
|
||||
options: null,
|
||||
fromRelationMetadata: null,
|
||||
|
||||
Reference in New Issue
Block a user