Removing Prisma and Grapql-nestjs-prisma resolvers (#2574)
* Some cleaning * Fix seeds * Fix all sign in, sign up flow and apiKey optimistic rendering * Fix
This commit is contained in:
@ -2,7 +2,6 @@ import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateAct
|
||||
import { ActivityTargetableEntity } from '@/activities/types/ActivityTargetableEntity';
|
||||
import { IconPlus } from '@/ui/display/icon';
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { ActivityType } from '~/generated/graphql';
|
||||
|
||||
export const AddTaskButton = ({
|
||||
activityTargetEntity,
|
||||
@ -23,7 +22,7 @@ export const AddTaskButton = ({
|
||||
title="Add task"
|
||||
onClick={() =>
|
||||
openCreateActivity({
|
||||
type: ActivityType.Task,
|
||||
type: 'Task',
|
||||
targetableEntities: [activityTargetEntity],
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer';
|
||||
import { PageAddButton } from '@/ui/layout/page/PageAddButton';
|
||||
import { useFilter } from '@/ui/object/object-filter-dropdown/hooks/useFilter';
|
||||
import { ActivityType } from '~/generated/graphql';
|
||||
|
||||
export const PageAddTaskButton = () => {
|
||||
const { selectedFilter } = useFilter();
|
||||
@ -9,7 +8,7 @@ export const PageAddTaskButton = () => {
|
||||
|
||||
const handleClick = () => {
|
||||
openCreateActivity({
|
||||
type: ActivityType.Task,
|
||||
type: 'Task',
|
||||
assigneeId: selectedFilter?.value,
|
||||
});
|
||||
};
|
||||
|
||||
@ -8,7 +8,6 @@ import { IconPlus } from '@/ui/display/icon';
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { activeTabIdScopedState } from '@/ui/layout/tab/states/activeTabIdScopedState';
|
||||
import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
|
||||
import { ActivityType } from '~/generated/graphql';
|
||||
|
||||
import { AddTaskButton } from './AddTaskButton';
|
||||
import { TaskList } from './TaskList';
|
||||
@ -84,7 +83,7 @@ export const TaskGroups = ({ entity, showAddButton }: TaskGroupsProps) => {
|
||||
variant={'secondary'}
|
||||
onClick={() =>
|
||||
openCreateActivity({
|
||||
type: ActivityType.Task,
|
||||
type: 'Task',
|
||||
targetableEntities: entity ? [entity] : undefined,
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { Activity } from '@/activities/types/Activity';
|
||||
import { useUpdateOneObjectRecord } from '@/object-record/hooks/useUpdateOneObjectRecord';
|
||||
import { Activity } from '~/generated/graphql';
|
||||
|
||||
type Task = Pick<Activity, 'id' | 'completedAt'>;
|
||||
|
||||
export const useCompleteTask = (task: Task) => {
|
||||
const { updateOneObject } = useUpdateOneObjectRecord({
|
||||
objectNameSingular: 'activityV2',
|
||||
objectNameSingular: 'activity',
|
||||
});
|
||||
|
||||
const completeTask = useCallback(
|
||||
|
||||
@ -9,7 +9,7 @@ export const useCurrentUserTaskCount = () => {
|
||||
const currentWorkspaceMember = useRecoilValue(currentWorkspaceMemberState);
|
||||
|
||||
const { objects } = useFindManyObjectRecords({
|
||||
objectNamePlural: 'activitiesV2',
|
||||
objectNamePlural: 'activities',
|
||||
filter: {
|
||||
type: { eq: 'Task' },
|
||||
completedAt: { eq: null },
|
||||
|
||||
@ -4,8 +4,7 @@ import { Activity } from '@/activities/types/Activity';
|
||||
import { ActivityTargetableEntity } from '@/activities/types/ActivityTargetableEntity';
|
||||
import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords';
|
||||
import { useFilter } from '@/ui/object/object-filter-dropdown/hooks/useFilter';
|
||||
import { turnFilterIntoWhereClause } from '@/ui/object/object-filter-dropdown/utils/turnFilterIntoWhereClause';
|
||||
import { SortOrder } from '~/generated/graphql';
|
||||
import { turnFiltersIntoWhereClauseV2 } from '@/ui/object/object-filter-dropdown/utils/turnFiltersIntoWhereClauseV2';
|
||||
import { parseDate } from '~/utils/date-utils';
|
||||
|
||||
export const useTasks = (entity?: ActivityTargetableEntity) => {
|
||||
@ -22,10 +21,10 @@ export const useTasks = (entity?: ActivityTargetableEntity) => {
|
||||
},
|
||||
},
|
||||
}
|
||||
: Object.assign({}, turnFilterIntoWhereClause(selectedFilter));
|
||||
: Object.assign({}, turnFiltersIntoWhereClauseV2([], []));
|
||||
|
||||
const { objects: completeTasksData } = useFindManyObjectRecords({
|
||||
objectNamePlural: 'activitiesV2',
|
||||
objectNamePlural: 'activities',
|
||||
skip: !entity && !selectedFilter,
|
||||
filter: {
|
||||
type: { equals: 'Task' },
|
||||
@ -34,13 +33,13 @@ export const useTasks = (entity?: ActivityTargetableEntity) => {
|
||||
},
|
||||
orderBy: [
|
||||
{
|
||||
createdAt: SortOrder.Desc,
|
||||
createdAt: 'AscNullIsFirst',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const { objects: incompleteTaskData } = useFindManyObjectRecords({
|
||||
objectNamePlural: 'activitiesV2',
|
||||
objectNamePlural: 'activities',
|
||||
skip: !entity && !selectedFilter,
|
||||
filter: {
|
||||
type: { equals: 'Task' },
|
||||
@ -49,7 +48,7 @@ export const useTasks = (entity?: ActivityTargetableEntity) => {
|
||||
},
|
||||
orderBy: [
|
||||
{
|
||||
createdAt: SortOrder.Desc,
|
||||
createdAt: 'DescNullIsFirst',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user