2024-01-12 08:22:04 +00:00
|
|
|
import { observer } from "mobx-react-lite";
|
|
|
|
//types
|
|
|
|
import { IIssueDisplayFilterOptions, IIssueDisplayProperties, TIssue } from "@plane/types";
|
|
|
|
import { EIssueActions } from "../types";
|
|
|
|
//components
|
|
|
|
import { SpreadsheetIssueRow } from "./issue-row";
|
|
|
|
import { SpreadsheetHeader } from "./spreadsheet-header";
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
displayProperties: IIssueDisplayProperties;
|
|
|
|
displayFilters: IIssueDisplayFilterOptions;
|
|
|
|
handleDisplayFilterUpdate: (data: Partial<IIssueDisplayFilterOptions>) => void;
|
2024-01-18 10:21:17 +00:00
|
|
|
issueIds: string[];
|
2024-01-12 08:22:04 +00:00
|
|
|
isEstimateEnabled: boolean;
|
|
|
|
quickActions: (
|
|
|
|
issue: TIssue,
|
|
|
|
customActionButton?: React.ReactElement,
|
|
|
|
portalElement?: HTMLDivElement | null
|
|
|
|
) => React.ReactNode;
|
|
|
|
handleIssues: (issue: TIssue, action: EIssueActions) => Promise<void>;
|
|
|
|
canEditProperties: (projectId: string | undefined) => boolean;
|
|
|
|
portalElement: React.MutableRefObject<HTMLDivElement | null>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const SpreadsheetTable = observer((props: Props) => {
|
|
|
|
const {
|
|
|
|
displayProperties,
|
|
|
|
displayFilters,
|
|
|
|
handleDisplayFilterUpdate,
|
2024-01-18 10:21:17 +00:00
|
|
|
issueIds,
|
2024-01-12 08:22:04 +00:00
|
|
|
isEstimateEnabled,
|
|
|
|
portalElement,
|
|
|
|
quickActions,
|
|
|
|
handleIssues,
|
|
|
|
canEditProperties,
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<table className="divide-x-[0.5px] divide-custom-border-200 overflow-y-auto">
|
|
|
|
<SpreadsheetHeader
|
|
|
|
displayProperties={displayProperties}
|
|
|
|
displayFilters={displayFilters}
|
|
|
|
handleDisplayFilterUpdate={handleDisplayFilterUpdate}
|
|
|
|
isEstimateEnabled={isEstimateEnabled}
|
|
|
|
/>
|
|
|
|
<tbody>
|
2024-01-18 10:21:17 +00:00
|
|
|
{issueIds.map((id) => (
|
2024-01-12 08:22:04 +00:00
|
|
|
<SpreadsheetIssueRow
|
|
|
|
key={id}
|
|
|
|
issueId={id}
|
|
|
|
displayProperties={displayProperties}
|
|
|
|
quickActions={quickActions}
|
|
|
|
canEditProperties={canEditProperties}
|
|
|
|
nestingLevel={0}
|
|
|
|
isEstimateEnabled={isEstimateEnabled}
|
|
|
|
handleIssues={handleIssues}
|
|
|
|
portalElement={portalElement}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
);
|
|
|
|
});
|