Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Task | Add project information in the task #3350

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading