Fixed bug for refectch activities and create activity on the currently filtered user. (#1493)
* Fixed bug for refectch activities and create activity on the currently filtered user. * Refactor optimistif effect --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -43,21 +43,6 @@ export function Companies() {
|
||||
address: '',
|
||||
},
|
||||
},
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
createOneCompany: {
|
||||
__typename: 'Company',
|
||||
id: newCompanyId,
|
||||
name: '',
|
||||
domainName: '',
|
||||
address: '',
|
||||
createdAt: new Date().toISOString(),
|
||||
accountOwner: null,
|
||||
linkedinUrl: '',
|
||||
idealCustomerProfile: false,
|
||||
employees: null,
|
||||
},
|
||||
},
|
||||
update: (_cache, { data }) => {
|
||||
if (data?.createOneCompany) {
|
||||
upsertTableRowIds(data?.createOneCompany.id);
|
||||
|
||||
@ -40,17 +40,6 @@ export function People() {
|
||||
lastName: '',
|
||||
},
|
||||
},
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
createOnePerson: {
|
||||
__typename: 'Person',
|
||||
id: newPersonId,
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
displayName: '',
|
||||
createdAt: '',
|
||||
},
|
||||
},
|
||||
update: (_cache, { data }) => {
|
||||
if (data?.createOnePerson) {
|
||||
upsertTableRowIds(data?.createOnePerson.id);
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer';
|
||||
import { TasksRecoilScopeContext } from '@/activities/states/recoil-scope-contexts/TasksRecoilScopeContext';
|
||||
import { PageAddTaskButton } from '@/activities/tasks/components/PageAddTaskButton';
|
||||
import { TaskGroups } from '@/activities/tasks/components/TaskGroups';
|
||||
import { DropdownRecoilScopeContext } from '@/ui/dropdown/states/recoil-scope-contexts/DropdownRecoilScopeContext';
|
||||
import { IconArchive, IconCheck, IconCheckbox } from '@/ui/icon/index';
|
||||
import { RelationPickerHotkeyScope } from '@/ui/input/relation-picker/types/RelationPickerHotkeyScope';
|
||||
import { PageAddButton } from '@/ui/layout/components/PageAddButton';
|
||||
import { PageBody } from '@/ui/layout/components/PageBody';
|
||||
import { PageContainer } from '@/ui/layout/components/PageContainer';
|
||||
import { PageHeader } from '@/ui/layout/components/PageHeader';
|
||||
@ -14,7 +12,6 @@ import { TabList } from '@/ui/tab/components/TabList';
|
||||
import { TopBar } from '@/ui/top-bar/TopBar';
|
||||
import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope';
|
||||
import { FilterDropdownButton } from '@/ui/view-bar/components/FilterDropdownButton';
|
||||
import { ActivityType } from '~/generated/graphql';
|
||||
|
||||
const StyledTasksContainer = styled.div`
|
||||
display: flex;
|
||||
@ -32,8 +29,6 @@ const StyledTabListContainer = styled.div`
|
||||
`;
|
||||
|
||||
export function Tasks() {
|
||||
const openCreateActivity = useOpenCreateActivityDrawer();
|
||||
|
||||
const TASK_TABS = [
|
||||
{
|
||||
id: 'to-do',
|
||||
@ -49,16 +44,12 @@ export function Tasks() {
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<PageHeader title="Tasks" Icon={IconCheckbox}>
|
||||
<RecoilScope SpecificContext={DropdownRecoilScopeContext}>
|
||||
<PageAddButton
|
||||
onClick={() => openCreateActivity(ActivityType.Task)}
|
||||
/>
|
||||
</RecoilScope>
|
||||
</PageHeader>
|
||||
<PageBody>
|
||||
<StyledTasksContainer>
|
||||
<RecoilScope SpecificContext={TasksRecoilScopeContext}>
|
||||
<RecoilScope SpecificContext={TasksRecoilScopeContext}>
|
||||
<PageHeader title="Tasks" Icon={IconCheckbox}>
|
||||
<PageAddTaskButton />
|
||||
</PageHeader>
|
||||
<PageBody>
|
||||
<StyledTasksContainer>
|
||||
<TopBar
|
||||
leftComponent={
|
||||
<StyledTabListContainer>
|
||||
@ -74,9 +65,9 @@ export function Tasks() {
|
||||
}
|
||||
/>
|
||||
<TaskGroups />
|
||||
</RecoilScope>
|
||||
</StyledTasksContainer>
|
||||
</PageBody>
|
||||
</StyledTasksContainer>
|
||||
</PageBody>
|
||||
</RecoilScope>
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user