import React from "react"; import { observer } from "mobx-react-lite"; // components import { ListGroupByHeaderRoot } from "./headers/group-by-root"; import { IssueBlocksList, ListInlineCreateIssueForm } from "components/issues"; // types import { IEstimatePoint, IIssue, IIssueLabels, IProject, IState, IUserLite } from "types"; // constants import { getValueFromObject } from "constants/issue"; export interface IGroupByList { issues: any; group_by: string | null; list: any; listKey: string; handleIssues: (group_by: string | null, issue: IIssue, action: "update" | "delete") => void; quickActions: (group_by: string | null, issue: IIssue) => React.ReactNode; display_properties: any; is_list?: boolean; enableQuickIssueCreate?: boolean; showEmptyGroup?: boolean; } const GroupByList: React.FC = observer((props) => { const { issues, group_by, list, listKey, handleIssues, quickActions, display_properties, is_list = false, enableQuickIssueCreate, showEmptyGroup, } = props; return (
{list && list.length > 0 && list.map((_list: any) => (
{issues && ( )} {enableQuickIssueCreate && ( )}
))}
); }); // TODO: update all the types export interface IList { issues: any; group_by: string | null; handleDragDrop?: (result: any) => void | undefined; handleIssues: (group_by: string | null, issue: IIssue, action: "update" | "delete") => void; quickActions: (group_by: string | null, issue: IIssue) => React.ReactNode; display_properties: any; states: IState[] | null; labels: IIssueLabels[] | null; members: IUserLite[] | null; projects: IProject[] | null; stateGroups: any; priorities: any; enableQuickIssueCreate?: boolean; estimates: IEstimatePoint[] | null; showEmptyGroup?: boolean; } export const List: React.FC = observer((props) => { const { issues, group_by, handleIssues, quickActions, display_properties, states, labels, members, projects, stateGroups, priorities, showEmptyGroup, enableQuickIssueCreate, } = props; return (
{group_by === null && ( )} {group_by && group_by === "project" && projects && ( )} {group_by && group_by === "state" && states && ( )} {group_by && group_by === "state_detail.group" && stateGroups && ( )} {group_by && group_by === "priority" && priorities && ( )} {group_by && group_by === "labels" && labels && ( )} {group_by && group_by === "assignees" && members && ( )} {group_by && group_by === "created_by" && members && ( )}
); });