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, IIssueDisplayProperties, IIssueLabel, IProject, IState, IUserLite } from "types"; // constants import { getValueFromObject } from "constants/issue"; export interface IGroupByList { issues: any; group_by: string | null; list: any; isReadonly?: boolean; listKey: string; handleIssues: (group_by: string | null, issue: IIssue, action: "update" | "delete") => void; quickActions: (group_by: string | null, issue: IIssue) => React.ReactNode; displayProperties: IIssueDisplayProperties; is_list?: boolean; enableQuickIssueCreate?: boolean; showEmptyGroup?: boolean; } const GroupByList: React.FC = observer((props) => { const { issues, group_by, list, isReadonly, listKey, handleIssues, quickActions, displayProperties, 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; isReadonly?: boolean; 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; displayProperties: IIssueDisplayProperties; states: IState[] | null; labels: IIssueLabel[] | 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, isReadonly, handleIssues, quickActions, displayProperties, 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 && ( )}
); });