Skip to content

Commit

Permalink
[Feature] Task | Add project information in the task (#3350)
Browse files Browse the repository at this point in the history
* add project in task details page / possiblity to edit

* set the project when creating task
  • Loading branch information
CREDO23 authored Nov 19, 2024
1 parent f37fac7 commit bc63849
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 155 deletions.
7 changes: 5 additions & 2 deletions apps/web/app/hooks/features/useTaskInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function useTaskInput({
const taskSize = useRef<null | string>(null);
const taskDescription = useRef<null | string>(null);
const taskLabels = useRef<[] | ITaskLabelsItemList[]>([]);
const taskProject = useRef<null | string>(null);

const tasks = customTasks || teamTasks;

Expand Down Expand Up @@ -160,7 +161,8 @@ export function useTaskInput({
priority: taskPriority.current || undefined,
size: taskSize.current || undefined,
tags: taskLabels.current || [],
description: taskDescription.current
description: taskDescription.current,
projectId : taskProject.current
},
!autoAssignTaskAuth ? assignToUsers : undefined
).then((res) => {
Expand Down Expand Up @@ -233,7 +235,8 @@ export function useTaskInput({
taskLabels,
taskDescription,
user,
userRef
userRef,
taskProject,
};
}

Expand Down
16 changes: 10 additions & 6 deletions apps/web/app/hooks/features/useTeamTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ export function useTeamTasks() {
priority,
size,
tags,
description
description,
projectId
}: {
taskName: string;
issueType?: string;
Expand All @@ -306,6 +307,7 @@ export function useTeamTasks() {
size?: string;
tags?: ITaskLabelsItemList[];
description?: string | null;
projectId?: string | null;
},
members?: { id: string }[]
) => {
Expand All @@ -319,11 +321,13 @@ export function useTeamTasks() {
tags,
// Set Project Id to cookie
// TODO: Make it dynamic when we add Dropdown in Navbar
...(activeTeam?.projects && activeTeam?.projects.length > 0
? {
projectId: activeTeam.projects[0].id
}
: {}),

// ...(activeTeam?.projects && activeTeam?.projects.length > 0
// ? {
// projectId: activeTeam.projects[0].id
// }
// : {}),
projectId,
...(description ? { description: `<p>${description}</p>` } : {}),
...(members ? { members } : {}),
taskStatusId: taskStatusId
Expand Down
Loading

0 comments on commit bc63849

Please sign in to comment.