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

@ -4,7 +4,7 @@ import { useFilteredSearchEntityQuery } from '@/relation-picker/hooks/useFiltere
import { relationPickerSearchFilterScopedState } from '@/relation-picker/states/relationPickerSearchFilterScopedState';
import { EntityForSelect } from '@/relation-picker/types/EntityForSelect';
import { Entity } from '@/relation-picker/types/EntityTypeForSelect';
import { useEditableCell } from '@/ui/components/editable-cell/hooks/useCloseEditableCell';
import { useInplaceInput } from '@/ui/components/inplace-input/hooks/useCloseInplaceInput';
import {
Company,
User,
@ -28,7 +28,7 @@ export function CompanyAccountOwnerPicker({ company }: OwnProps) {
);
const [updateCompany] = useUpdateCompanyMutation();
const { closeEditableCell } = useEditableCell();
const { closeInplaceInput } = useInplaceInput();
const companies = useFilteredSearchEntityQuery({
queryHook: useSearchUserQuery,
@ -52,7 +52,7 @@ export function CompanyAccountOwnerPicker({ company }: OwnProps) {
},
});
closeEditableCell();
closeInplaceInput();
}
return (