Refacto/abstract inplace input (#530)

* Move code to new folder

* Deduplicate code, remove dependancy on table

* Remove more table dependency

* Move close logic to input

* Migrate editable text cell

* Rename EditableTextInput

* Fix component test id
This commit is contained in:
Emilien Chauvet
2023-07-07 12:11:57 -07:00
committed by GitHub
parent 26b033abc9
commit c847bca293
19 changed files with 189 additions and 138 deletions

View File

@ -2,8 +2,8 @@ import { useRecoilScopedState } from '@/recoil-scope/hooks/useRecoilScopedState'
import { SingleEntitySelect } from '@/relation-picker/components/SingleEntitySelect';
import { useFilteredSearchEntityQuery } from '@/relation-picker/hooks/useFilteredSearchEntityQuery';
import { relationPickerSearchFilterScopedState } from '@/relation-picker/states/relationPickerSearchFilterScopedState';
import { useEditableCell } from '@/ui/components/editable-cell/hooks/useCloseEditableCell';
import { isCreateModeScopedState } from '@/ui/components/editable-cell/states/isCreateModeScopedState';
import { useInplaceInput } from '@/ui/components/inplace-input/hooks/useCloseInplaceInput';
import { isCreateModeScopedState } from '@/ui/components/inplace-input/states/isCreateModeScopedState';
import { getLogoUrlFromDomainName } from '@/utils/utils';
import {
CommentableType,
@ -25,7 +25,7 @@ export function PeopleCompanyPicker({ people }: OwnProps) {
);
const [updatePeople] = useUpdatePeopleMutation();
const { closeEditableCell } = useEditableCell();
const { closeInplaceInput } = useInplaceInput();
const companies = useFilteredSearchEntityQuery({
queryHook: useSearchCompanyQuery,
@ -50,7 +50,7 @@ export function PeopleCompanyPicker({ people }: OwnProps) {
},
});
closeEditableCell();
closeInplaceInput();
}
function handleCreate() {