Fix/table remove and mock data (#653)

* Removed tanstack react table

* Fixed remove table feature without tanstack table

* Fixed delete people and companies

* Fixed hotkeys on editable date cell

* Fixed double text

* Fixed company mock mode

* Fixed lint

* Fixed right click selection
This commit is contained in:
Lucas Bordeau
2023-07-13 21:43:00 +02:00
committed by GitHub
parent e8bd3b7a14
commit d70234f918
21 changed files with 132 additions and 111 deletions

View File

@ -5,11 +5,11 @@ import { GET_PEOPLE } from '@/people/services';
import { EntityTableActionBarButton } from '@/ui/components/table/action-bar/EntityTableActionBarButton';
import { IconTrash } from '@/ui/icons/index';
import { useResetTableRowSelection } from '@/ui/tables/hooks/useResetTableRowSelection';
import { selectedRowIdsState } from '@/ui/tables/states/selectedRowIdsState';
import { selectedRowIdsSelector } from '@/ui/tables/states/selectedRowIdsSelector';
import { useDeletePeopleMutation } from '~/generated/graphql';
export function TableActionBarButtonDeletePeople() {
const selectedRowIds = useRecoilValue(selectedRowIdsState);
const selectedRowIds = useRecoilValue(selectedRowIdsSelector);
const resetRowSelection = useResetTableRowSelection();
@ -18,13 +18,15 @@ export function TableActionBarButtonDeletePeople() {
});
async function handleDeleteClick() {
await deletePeople({
variables: {
ids: selectedRowIds,
},
});
const rowIdsToDelete = selectedRowIds;
resetRowSelection();
await deletePeople({
variables: {
ids: rowIdsToDelete,
},
});
}
return (