diff --git a/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx b/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx index 0d5b64c8..a5c7d984 100644 --- a/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx +++ b/frontend/src/components/HomeComponents/Tasks/TaskDialog.tsx @@ -45,6 +45,9 @@ export const TaskDialog = ({ editState, onUpdateState, allTasks, + isCreatingNewProject, + setIsCreatingNewProject, + uniqueProjects, onSaveDescription, onSaveTags, onSavePriority, @@ -825,41 +828,104 @@ export const TaskDialog = ({ {editState.isEditingProject ? ( <> -
- - onUpdateState({ - editedProject: e.target.value, - }) +
+ + + {isCreatingNewProject && ( +
+ + onUpdateState({ + editedProject: e.target.value, + }) + } + /> +
+ + +
+
+ )}
) : ( diff --git a/frontend/src/components/HomeComponents/Tasks/Tasks.tsx b/frontend/src/components/HomeComponents/Tasks/Tasks.tsx index ff98ab4d..d1ab6728 100644 --- a/frontend/src/components/HomeComponents/Tasks/Tasks.tsx +++ b/frontend/src/components/HomeComponents/Tasks/Tasks.tsx @@ -1087,6 +1087,9 @@ export const Tasks = ( editState={editState} onUpdateState={updateEditState} allTasks={tasks} + uniqueProjects={uniqueProjects} + isCreatingNewProject={isCreatingNewProject} + setIsCreatingNewProject={setIsCreatingNewProject} onSaveDescription={handleSaveDescription} onSaveTags={handleSaveTags} onSavePriority={handleSavePriority} diff --git a/frontend/src/components/HomeComponents/Tasks/__tests__/TaskDialog.test.tsx b/frontend/src/components/HomeComponents/Tasks/__tests__/TaskDialog.test.tsx index 05847084..e7c551b0 100644 --- a/frontend/src/components/HomeComponents/Tasks/__tests__/TaskDialog.test.tsx +++ b/frontend/src/components/HomeComponents/Tasks/__tests__/TaskDialog.test.tsx @@ -85,6 +85,9 @@ describe('TaskDialog Component', () => { editState: mockEditState, onUpdateState: jest.fn(), allTasks: mockAllTasks, + uniqueProjects: [], + isCreatingNewProject: false, + setIsCreatingNewProject: jest.fn(), onSaveDescription: jest.fn(), onSaveTags: jest.fn(), onSavePriority: jest.fn(), diff --git a/frontend/src/components/utils/types.ts b/frontend/src/components/utils/types.ts index 61a6357e..76b7a4fa 100644 --- a/frontend/src/components/utils/types.ts +++ b/frontend/src/components/utils/types.ts @@ -136,6 +136,9 @@ export interface EditTaskDialogProps { editState: EditTaskState; onUpdateState: (updates: Partial) => void; allTasks: Task[]; + uniqueProjects: string[]; + isCreatingNewProject: boolean; + setIsCreatingNewProject: (value: boolean) => void; onSaveDescription: (task: Task, description: string) => void; onSaveTags: (task: Task, tags: string[]) => void; onSavePriority: (task: Task, priority: string) => void;