1cf08c797f
* Convert metadata tables to camelCase * datasourcemetadataid to datasourceid * refactor metadata folders * fix command * move commands out of metadata * fix seed * rename objectId and fieldId in objectMetadataId and fieldMetadataId in FE * fix field-metadata * Fix * Fix * remove logs --------- Co-authored-by: Charles Bochet <charles@twenty.com>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { IconCalendar } from '@/ui/display/icon/index';
|
|
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
|
import { FieldDefinition } from '@/ui/object/field/types/FieldDefinition';
|
|
import { FieldDateMetadata } from '@/ui/object/field/types/FieldMetadata';
|
|
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
|
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
|
import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope';
|
|
import { useUpdateActivityMutation } from '~/generated/graphql';
|
|
|
|
type ActivityEditorDateFieldProps = {
|
|
activityId: string;
|
|
};
|
|
|
|
export const ActivityEditorDateField = ({
|
|
activityId,
|
|
}: ActivityEditorDateFieldProps) => {
|
|
return (
|
|
<RecoilScope>
|
|
<FieldContext.Provider
|
|
value={{
|
|
entityId: activityId,
|
|
recoilScopeId: 'activityDueAt',
|
|
fieldDefinition: {
|
|
fieldMetadataId: 'activityDueAt',
|
|
label: 'Due date',
|
|
Icon: IconCalendar,
|
|
type: 'DATE',
|
|
metadata: {
|
|
fieldName: 'dueAt',
|
|
},
|
|
} satisfies FieldDefinition<FieldDateMetadata>,
|
|
useUpdateEntityMutation: useUpdateActivityMutation,
|
|
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
|
}}
|
|
>
|
|
<RecordInlineCell />
|
|
</FieldContext.Provider>
|
|
</RecoilScope>
|
|
);
|
|
};
|