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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user