Files
twenty_crm/front/src/modules/pipeline/editable-field/components/PipelineProgressPointOfContactPickerFieldEditMode.tsx
Jérémy M 872ec9e6bb feat: disable atomic operation on nestjs graphql models (#751)
* feat: no atomic

* feat: update front not atomic operations

* feat: optional fields for person model & use proper gql type

* Fix bug display name

* Fix bug update user

* Fixed bug avatar URL

* Fixed display name on people cell

* Fix lint

* Fixed storybook display name

* Fix storybook requests

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2023-07-20 19:23:35 +00:00

51 lines
1.3 KiB
TypeScript

import styled from '@emotion/styled';
import { PipelineProgressPointOfContactPicker } from '@/pipeline/components/PipelineProgressPointOfContactPicker';
import { useEditableField } from '@/ui/editable-field/hooks/useEditableField';
import { Person, PipelineProgress } from '~/generated/graphql';
const PipelineProgressPointOfContactPickerContainer = styled.div`
left: 24px;
position: absolute;
top: -8px;
`;
export type OwnProps = {
pipelineProgress: Pick<PipelineProgress, 'id'> & {
pointOfContact?: Pick<
Person,
'id' | 'firstName' | 'lastName' | 'displayName'
> | null;
};
onSubmit?: () => void;
onCancel?: () => void;
};
export function PipelineProgressPointOfContactPickerFieldEditMode({
pipelineProgress,
onSubmit,
onCancel,
}: OwnProps) {
const { closeEditableField } = useEditableField();
function handleSubmit() {
closeEditableField();
onSubmit?.();
}
function handleCancel() {
closeEditableField();
onCancel?.();
}
return (
<PipelineProgressPointOfContactPickerContainer>
<PipelineProgressPointOfContactPicker
pipelineProgress={pipelineProgress}
onCancel={handleCancel}
onSubmit={handleSubmit}
/>
</PipelineProgressPointOfContactPickerContainer>
);
}