Skip to content
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
13 changes: 8 additions & 5 deletions apps/app/components/core/views/board-view/board-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useProjects from "hooks/use-projects";
// component
import { Avatar, Icon } from "components/ui";
// icons
import { ArrowsPointingInIcon, ArrowsPointingOutIcon, PlusIcon } from "@heroicons/react/24/outline";
import { PlusIcon } from "@heroicons/react/24/outline";
import { getPriorityIcon, getStateGroupIcon } from "components/icons";
// helpers
import { addSpaceIfCamelCase } from "helpers/string.helper";
Expand Down Expand Up @@ -56,10 +56,10 @@ export const BoardHeader: React.FC<Props> = ({
);

const { data: members } = useSWR(
workspaceSlug && projectId && selectedGroup === "created_by"
workspaceSlug && projectId && (selectedGroup === "created_by" || selectedGroup === "assignees")
? PROJECT_MEMBERS(projectId.toString())
: null,
workspaceSlug && projectId && selectedGroup === "created_by"
workspaceSlug && projectId && (selectedGroup === "created_by" || selectedGroup === "assignees")
? () => projectService.projectMembers(workspaceSlug.toString(), projectId.toString())
: null
);
Expand All @@ -79,9 +79,11 @@ export const BoardHeader: React.FC<Props> = ({
case "project":
title = projects?.find((p) => p.id === groupTitle)?.name ?? "None";
break;
case "assignees":
case "created_by":
const member = members?.find((member) => member.member.id === groupTitle)?.member;
title = member?.display_name ?? "";
title = member ? member.display_name : "None";

break;
}

Expand Down Expand Up @@ -122,9 +124,10 @@ export const BoardHeader: React.FC<Props> = ({
/>
);
break;
case "assignees":
case "created_by":
const member = members?.find((member) => member.member.id === groupTitle)?.member;
icon = <Avatar user={member} height="24px" width="24px" fontSize="12px" />;
icon = member ? <Avatar user={member} height="24px" width="24px" fontSize="12px" /> : <></>;

break;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/app/components/core/views/issues-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ export const IssuesView: React.FC<Props> = ({
dragDisabled={
selectedGroup === "created_by" ||
selectedGroup === "labels" ||
selectedGroup === "state_detail.group"
selectedGroup === "state_detail.group" ||
selectedGroup === "assignees"
}
emptyState={{
title: cycleId
Expand Down
6 changes: 4 additions & 2 deletions apps/app/components/core/views/list-view/single-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ export const SingleList: React.FC<Props> = ({
case "project":
title = projects?.find((p) => p.id === groupTitle)?.name ?? "None";
break;
case "assignees":
case "created_by":
const member = members?.find((member) => member.member.id === groupTitle)?.member;
title = member?.display_name ?? "";
title = member ? member.display_name : "None";
break;
}

Expand Down Expand Up @@ -137,9 +138,10 @@ export const SingleList: React.FC<Props> = ({
/>
);
break;
case "assignees":
case "created_by":
const member = members?.find((member) => member.member.id === groupTitle)?.member;
icon = <Avatar user={member} height="24px" width="24px" fontSize="12px" />;
icon = member ? <Avatar user={member} height="24px" width="24px" fontSize="12px" /> : <></>;

break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ export const MyIssuesViewOptions: React.FC = () => {
>
{GROUP_BY_OPTIONS.map((option) => {
if (issueView === "kanban" && option.key === null) return null;
if (option.key === "state" || option.key === "created_by")
if (
option.key === "state" ||
option.key === "created_by" ||
option.key === "assignees"
)
return null;

return (
Expand Down
6 changes: 5 additions & 1 deletion apps/app/components/profile/profile-issues-view-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ export const ProfileIssuesViewOptions: React.FC = () => {
>
{GROUP_BY_OPTIONS.map((option) => {
if (issueView === "kanban" && option.key === null) return null;
if (option.key === "state" || option.key === "created_by")
if (
option.key === "state" ||
option.key === "created_by" ||
option.key === "assignees"
)
return null;

return (
Expand Down
1 change: 1 addition & 0 deletions apps/app/constants/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const GROUP_BY_OPTIONS: Array<{
{ name: "Priority", key: "priority" },
{ name: "Project", key: "project" },
{ name: "Labels", key: "labels" },
{ name: "Assignees", key: "assignees" },
{ name: "Created by", key: "created_by" },
{ name: "None", key: null },
];
Expand Down
1 change: 1 addition & 0 deletions apps/app/types/issues.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export type TIssueGroupByOptions =
| "created_by"
| "state_detail.group"
| "project"
| "assignees"
| null;

export type TIssueOrderByOptions =
Expand Down