From 2876685a4937e0b8afb366abad83619fdd802176 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 28 Aug 2025 13:03:29 -0300 Subject: [PATCH 1/5] remake keyresult task into a new more ordened file, fix task mythings error --- .../KeyResult/Single/Drawer/Body/body.tsx | 5 +- .../ActionButtons/create-task-in-kr.tsx | 3 +- .../Single/Sections/Checklist/checklist.tsx | 2 +- .../Single/Sections/Checklist/wrapper.tsx | 2 + .../KeyResult/Single/Sections/Tasks/index.tsx | 93 ++++++++++++++++ .../Single/Sections/Tasks/messages.ts | 53 +++++++++ .../Single/Sections/Tasks/use-logic.tsx | 103 ++++++++++++++++++ 7 files changed, 256 insertions(+), 5 deletions(-) create mode 100644 src/components/KeyResult/Single/Sections/Tasks/index.tsx create mode 100644 src/components/KeyResult/Single/Sections/Tasks/messages.ts create mode 100644 src/components/KeyResult/Single/Sections/Tasks/use-logic.tsx diff --git a/src/components/KeyResult/Single/Drawer/Body/body.tsx b/src/components/KeyResult/Single/Drawer/Body/body.tsx index 951a3e851..19e95db1b 100644 --- a/src/components/KeyResult/Single/Drawer/Body/body.tsx +++ b/src/components/KeyResult/Single/Drawer/Body/body.tsx @@ -19,13 +19,14 @@ import { KeyResult } from 'src/components/KeyResult/types' import { keyResultAtomFamily } from 'src/state/recoil/key-result' import { keyResultChecklistAtom } from 'src/state/recoil/key-result/checklist' -import { KeyResultChecklistWrapper } from '../../Sections/Checklist/wrapper' import { KeyResultHistory } from '../../Sections/KeyResultHistory' import { KeyResultProgress } from '../../Sections/Progress/wrapper' +import { KeyResultTasks } from '../../Sections/Tasks' import { SCROLLBAR_ID } from './constants' import messages from './messages' + export interface KeyResultDrawerBodyProperties { readonly keyResultID: KeyResult['id'] readonly isLoading?: boolean @@ -120,7 +121,7 @@ const KeyResultDrawerBody = ({ )} - + diff --git a/src/components/KeyResult/Single/Sections/Checklist/ActionButtons/create-task-in-kr.tsx b/src/components/KeyResult/Single/Sections/Checklist/ActionButtons/create-task-in-kr.tsx index 797eac597..df2dcbacb 100644 --- a/src/components/KeyResult/Single/Sections/Checklist/ActionButtons/create-task-in-kr.tsx +++ b/src/components/KeyResult/Single/Sections/Checklist/ActionButtons/create-task-in-kr.tsx @@ -56,7 +56,6 @@ export const CreateTaskButton = ({ const { dispatch } = useEvent(EventType.TASK_MANAGER_CREATE_TASK_CLICK) const keyResult = useRecoilValue(keyResultAtomFamily(keyResultID)) - const hasData = Boolean(keyResult?.teamId) const handleNewCheckMark = async (title: NewTask['title']) => { if (isSubmitting) return @@ -115,7 +114,7 @@ export const CreateTaskButton = ({ /> )} - {(teamId ?? hasData) && ( + {(teamId ?? keyResult) && (