Fixed: Inconsistent Field Label Display on Task Side Panel (#5687)

Now all the required fields are displayed with the respective labels.

- Added a `FieldContextProvider` for the field `Reminder` in the
`ActivityEditorFields`.
- Fixed the missing label values, by adding a missed optional
`showLabel` within the `fieldDefinition` in the `useFieldContext`.

fixes: #5667 

![Screenshot
(342)](https://github.com/twentyhq/twenty/assets/140178357/adf9563a-6cab-4809-8616-1c256abab717)
This commit is contained in:
Shashank Vishwakarma 2024-06-03 19:28:58 +05:30 committed by GitHub
parent 2886664b62
commit 04dcbffe75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View File

@ -57,11 +57,21 @@ export const ActivityEditorFields = ({
return [upsertActivityMutation, { loading: false }];
};
const { FieldContextProvider: ReminderAtFieldContextProvider } =
useFieldContext({
objectNameSingular: CoreObjectNameSingular.Activity,
objectRecordId: activityId,
fieldMetadataName: 'reminderAt',
fieldPosition: 0,
clearable: true,
customUseUpdateOneObjectHook: useUpsertOneActivityMutation,
});
const { FieldContextProvider: DueAtFieldContextProvider } = useFieldContext({
objectNameSingular: CoreObjectNameSingular.Activity,
objectRecordId: activityId,
fieldMetadataName: 'dueAt',
fieldPosition: 0,
fieldPosition: 1,
clearable: true,
customUseUpdateOneObjectHook: useUpsertOneActivityMutation,
});
@ -71,7 +81,7 @@ export const ActivityEditorFields = ({
objectNameSingular: CoreObjectNameSingular.Activity,
objectRecordId: activityId,
fieldMetadataName: 'assignee',
fieldPosition: 1,
fieldPosition: 2,
clearable: true,
customUseUpdateOneObjectHook: useUpsertOneActivityMutation,
});
@ -81,15 +91,19 @@ export const ActivityEditorFields = ({
objectNameSingular: CoreObjectNameSingular.Activity,
objectRecordId: activityId,
fieldMetadataName: 'activityTargets',
fieldPosition: 2,
fieldPosition: 3,
});
return (
<StyledPropertyBox>
{activity.type === 'Task' &&
ReminderAtFieldContextProvider &&
DueAtFieldContextProvider &&
AssigneeFieldContextProvider && (
<>
<ReminderAtFieldContextProvider>
<RecordInlineCell />
</ReminderAtFieldContextProvider>
<DueAtFieldContextProvider>
<RecordInlineCell />
</DueAtFieldContextProvider>

View File

@ -69,6 +69,7 @@ export const useFieldContext = ({
isLabelIdentifier,
fieldDefinition: formatFieldMetadataItemAsColumnDefinition({
field: fieldMetadataItem,
showLabel: true,
position: fieldPosition,
objectMetadataItem,
}),