Skip to content

Commit

Permalink
Updated Issue Type Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
badalkhatri0924 committed Oct 6, 2023
1 parent 8a5c35b commit aebf260
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ const TaskTitleBlock = () => {
)} */}
{/* Parent Issue/Task Name */}

{/* Current Issue Type is Task|Bug and Parent Issue is Not an Epic */}
{(!task?.issueType ||
task?.issueType === 'Task' ||
task?.issueType === 'Bug') &&
task?.rootEpic && (
task?.rootEpic &&
task?.parentId !== task?.rootEpic.id && (
<ParentTaskBadge
task={{
...task,
Expand Down
14 changes: 13 additions & 1 deletion apps/web/lib/features/task/task-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,22 @@ export function TaskInput(props: Props) {

let updatedTaskList: ITeamTask[] = [];
if (props.forParentChildRelationship) {
if (props.task?.issueType === 'Story') {
if (
// Story can have ParentId set to Epic ID
props.task?.issueType === 'Story'
) {
updatedTaskList = datas.filteredTasks.filter(
(item) => item.issueType === 'Epic'
);
} else if (
// TASK|BUG can have ParentId to be set either to Story ID or Epic ID
props.task?.issueType === 'Task' ||
props.task?.issueType === 'Bug' ||
!props.task?.issueType
) {
updatedTaskList = datas.filteredTasks.filter(
(item) => item.issueType === 'Epic' || item.issueType === 'Story'
);
} else {
updatedTaskList = datas.filteredTasks;
}
Expand Down

0 comments on commit aebf260

Please sign in to comment.