diff --git a/apps/app/components/core/list-view/all-lists.tsx b/apps/app/components/core/list-view/all-lists.tsx index d7c93cb78ab..0e067513d8f 100644 --- a/apps/app/components/core/list-view/all-lists.tsx +++ b/apps/app/components/core/list-view/all-lists.tsx @@ -38,15 +38,25 @@ export const AllLists: React.FC = ({ return (
{Object.keys(groupedByIssues).map((singleGroup) => { + const currentState = + selectedGroup === "state_detail.name" + ? states?.find((s) => s.name === singleGroup) + : null; const stateId = selectedGroup === "state_detail.name" ? states?.find((s) => s.name === singleGroup)?.id ?? null : null; + const bgColor = + selectedGroup === "state_detail.name" + ? states?.find((s) => s.name === singleGroup)?.color + : "#000000"; return ( = ({ Copy issue link -
{ - e.preventDefault(); - setContextMenu(true); - setContextMenuPosition({ x: e.pageX, y: e.pageY }); - }} - > -
- +
+ -
- {properties.priority && ( - - )} - {properties.state && ( - - )} - {properties.due_date && ( - - )} - {properties.sub_issue_count && ( -
- {issue.sub_issues_count} {issue.sub_issues_count === 1 ? "sub-issue" : "sub-issues"} -
- )} - {properties.labels && ( -
- {issue.label_details.map((label) => ( - + +
+ {properties.priority && ( + + )} + {properties.state && ( + + )} + {properties.due_date && ( + + )} + {properties.sub_issue_count && ( +
+ {issue.sub_issues_count} {issue.sub_issues_count === 1 ? "sub-issue" : "sub-issues"} +
+ )} + {properties.labels && issue.label_details.length > 0 ? ( +
+ {issue.label_details.map((label) => ( - {label.name} - - ))} -
- )} - {properties.assignee && ( - - )} - {type && !isNotAllowed && ( - - Edit issue - {type !== "issue" && removeIssue && ( - - <>Remove from {type} + key={label.id} + className="group flex items-center gap-1 rounded-2xl border px-2 py-0.5 text-xs" + > + + {label.name} + + ))} +
+ ) : ( + "" + )} + {properties.assignee && ( + + )} + {type && !isNotAllowed && ( + + Edit issue + {type !== "issue" && removeIssue && ( + + <>Remove from {type} + + )} + handleDeleteIssue(issue)}> + Delete issue - )} - handleDeleteIssue(issue)}> - Delete issue - - Copy issue link - - )} + Copy issue link + + )} +
diff --git a/apps/app/components/core/list-view/single-list.tsx b/apps/app/components/core/list-view/single-list.tsx index 478b27380f1..1ca09ff9905 100644 --- a/apps/app/components/core/list-view/single-list.tsx +++ b/apps/app/components/core/list-view/single-list.tsx @@ -7,15 +7,18 @@ import useIssuesProperties from "hooks/use-issue-properties"; // components import { SingleListIssue } from "components/core"; // icons -import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; +import { PlusIcon } from "@heroicons/react/24/outline"; +import { getStateGroupIcon } from "components/icons"; // helpers import { addSpaceIfCamelCase } from "helpers/string.helper"; // types -import { IIssue, IProjectMember, NestedKeyOf, UserAuth } from "types"; +import { IIssue, IProjectMember, IState, NestedKeyOf, UserAuth } from "types"; import { CustomMenu } from "components/ui"; type Props = { type?: "issue" | "cycle" | "module"; + currentState?: IState | null; + bgColor?: string; groupTitle: string; groupedByIssues: { [key: string]: IIssue[]; @@ -33,6 +36,8 @@ type Props = { export const SingleList: React.FC = ({ type, + currentState, + bgColor, groupTitle, groupedByIssues, selectedGroup, @@ -69,17 +74,23 @@ export const SingleList: React.FC = ({ return ( {({ open }) => ( -
-
+
+
-
- - - +
+ {selectedGroup !== null && selectedGroup === "state_detail.name" ? ( + + {currentState && getStateGroupIcon(currentState.group, "20", "20", bgColor)} + + ) : ( + "" + )} {selectedGroup !== null ? ( -

+

{selectedGroup === "created_by" ? createdBy : selectedGroup === "assignees" @@ -89,65 +100,25 @@ export const SingleList: React.FC = ({ ) : (

All Issues

)} -

+ {groupedByIssues[groupTitle as keyof IIssue].length} -

+

-
- - -
- {groupedByIssues[groupTitle] ? ( - groupedByIssues[groupTitle].length > 0 ? ( - groupedByIssues[groupTitle].map((issue: IIssue) => ( - handleEditIssue(issue)} - makeIssueCopy={() => makeIssueCopy(issue)} - handleDeleteIssue={handleDeleteIssue} - removeIssue={() => { - removeIssue && removeIssue(issue.bridge); - }} - userAuth={userAuth} - /> - )) - ) : ( -

No issues.

- ) - ) : ( -
Loading...
- )} -
-
-
-
+ {type === "issue" ? ( ) : ( - - Add issue + + } optionsPosition="left" @@ -162,6 +133,41 @@ export const SingleList: React.FC = ({ )}
+ + + {groupedByIssues[groupTitle] ? ( + groupedByIssues[groupTitle].length > 0 ? ( + groupedByIssues[groupTitle].map((issue: IIssue) => ( + handleEditIssue(issue)} + makeIssueCopy={() => makeIssueCopy(issue)} + handleDeleteIssue={handleDeleteIssue} + removeIssue={() => { + removeIssue && removeIssue(issue.bridge); + }} + userAuth={userAuth} + /> + )) + ) : ( +

No issues.

+ ) + ) : ( +
Loading...
+ )} +
+
)}