2024-01-11 12:49:19 +00:00
|
|
|
import { IIssueDisplayProperties, TIssue, TIssueOrderByOptions } from "@plane/types";
|
2023-12-05 10:35:50 +00:00
|
|
|
import { LayersIcon, DoubleCircleIcon, UserGroupIcon } from "@plane/ui";
|
2023-12-11 11:57:29 +00:00
|
|
|
import { CalendarDays, Link2, Signal, Tag, Triangle, Paperclip, CalendarClock, CalendarCheck } from "lucide-react";
|
2023-12-05 10:35:50 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
import { ISvgIcons } from "@plane/ui/src/icons/type";
|
2024-01-11 12:49:19 +00:00
|
|
|
import {
|
|
|
|
SpreadsheetAssigneeColumn,
|
|
|
|
SpreadsheetAttachmentColumn,
|
|
|
|
SpreadsheetCreatedOnColumn,
|
|
|
|
SpreadsheetDueDateColumn,
|
|
|
|
SpreadsheetEstimateColumn,
|
|
|
|
SpreadsheetLabelColumn,
|
|
|
|
SpreadsheetLinkColumn,
|
|
|
|
SpreadsheetPriorityColumn,
|
|
|
|
SpreadsheetStartDateColumn,
|
|
|
|
SpreadsheetStateColumn,
|
|
|
|
SpreadsheetSubIssueColumn,
|
|
|
|
SpreadsheetUpdatedOnColumn,
|
|
|
|
} from "components/issues/issue-layouts/spreadsheet";
|
2023-06-23 11:50:05 +00:00
|
|
|
|
2023-10-18 07:02:02 +00:00
|
|
|
export const SPREADSHEET_PROPERTY_DETAILS: {
|
|
|
|
[key: string]: {
|
|
|
|
title: string;
|
|
|
|
ascendingOrderKey: TIssueOrderByOptions;
|
|
|
|
ascendingOrderTitle: string;
|
|
|
|
descendingOrderKey: TIssueOrderByOptions;
|
|
|
|
descendingOrderTitle: string;
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: FC<ISvgIcons>;
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: React.FC<{ issue: TIssue; onChange: (issue: TIssue, data: Partial<TIssue>) => void; disabled: boolean }>;
|
2023-10-18 07:02:02 +00:00
|
|
|
};
|
|
|
|
} = {
|
|
|
|
assignee: {
|
|
|
|
title: "Assignees",
|
|
|
|
ascendingOrderKey: "assignees__first_name",
|
|
|
|
ascendingOrderTitle: "A",
|
|
|
|
descendingOrderKey: "-assignees__first_name",
|
|
|
|
descendingOrderTitle: "Z",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: UserGroupIcon,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetAssigneeColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
created_on: {
|
|
|
|
title: "Created on",
|
|
|
|
ascendingOrderKey: "-created_at",
|
|
|
|
ascendingOrderTitle: "New",
|
|
|
|
descendingOrderKey: "created_at",
|
|
|
|
descendingOrderTitle: "Old",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: CalendarDays,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetCreatedOnColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
due_date: {
|
|
|
|
title: "Due date",
|
|
|
|
ascendingOrderKey: "-target_date",
|
|
|
|
ascendingOrderTitle: "New",
|
|
|
|
descendingOrderKey: "target_date",
|
|
|
|
descendingOrderTitle: "Old",
|
2023-12-11 11:57:29 +00:00
|
|
|
icon: CalendarCheck,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetDueDateColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
estimate: {
|
|
|
|
title: "Estimate",
|
|
|
|
ascendingOrderKey: "estimate_point",
|
|
|
|
ascendingOrderTitle: "Low",
|
|
|
|
descendingOrderKey: "-estimate_point",
|
|
|
|
descendingOrderTitle: "High",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: Triangle,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetEstimateColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
labels: {
|
|
|
|
title: "Labels",
|
|
|
|
ascendingOrderKey: "labels__name",
|
|
|
|
ascendingOrderTitle: "A",
|
|
|
|
descendingOrderKey: "-labels__name",
|
|
|
|
descendingOrderTitle: "Z",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: Tag,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetLabelColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
priority: {
|
|
|
|
title: "Priority",
|
|
|
|
ascendingOrderKey: "priority",
|
|
|
|
ascendingOrderTitle: "None",
|
|
|
|
descendingOrderKey: "-priority",
|
|
|
|
descendingOrderTitle: "Urgent",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: Signal,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetPriorityColumn,
|
2023-08-11 13:44:54 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
start_date: {
|
|
|
|
title: "Start date",
|
|
|
|
ascendingOrderKey: "-start_date",
|
|
|
|
ascendingOrderTitle: "New",
|
|
|
|
descendingOrderKey: "start_date",
|
|
|
|
descendingOrderTitle: "Old",
|
2023-12-11 11:57:29 +00:00
|
|
|
icon: CalendarClock,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetStartDateColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
state: {
|
|
|
|
title: "State",
|
|
|
|
ascendingOrderKey: "state__name",
|
|
|
|
ascendingOrderTitle: "A",
|
|
|
|
descendingOrderKey: "-state__name",
|
|
|
|
descendingOrderTitle: "Z",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: DoubleCircleIcon,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetStateColumn,
|
2023-06-23 11:50:05 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
updated_on: {
|
|
|
|
title: "Updated on",
|
|
|
|
ascendingOrderKey: "-updated_at",
|
|
|
|
ascendingOrderTitle: "New",
|
|
|
|
descendingOrderKey: "updated_at",
|
|
|
|
descendingOrderTitle: "Old",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: CalendarDays,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetUpdatedOnColumn,
|
2023-07-07 08:41:07 +00:00
|
|
|
},
|
2023-11-03 13:45:09 +00:00
|
|
|
link: {
|
|
|
|
title: "Link",
|
|
|
|
ascendingOrderKey: "-link_count",
|
|
|
|
ascendingOrderTitle: "Most",
|
|
|
|
descendingOrderKey: "link_count",
|
|
|
|
descendingOrderTitle: "Least",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: Link2,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetLinkColumn,
|
2023-11-03 13:45:09 +00:00
|
|
|
},
|
|
|
|
attachment_count: {
|
|
|
|
title: "Attachment",
|
|
|
|
ascendingOrderKey: "-attachment_count",
|
|
|
|
ascendingOrderTitle: "Most",
|
|
|
|
descendingOrderKey: "attachment_count",
|
|
|
|
descendingOrderTitle: "Least",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: Paperclip,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetAttachmentColumn,
|
2023-11-03 13:45:09 +00:00
|
|
|
},
|
|
|
|
sub_issue_count: {
|
|
|
|
title: "Sub-issue",
|
|
|
|
ascendingOrderKey: "-sub_issues_count",
|
|
|
|
ascendingOrderTitle: "Most",
|
|
|
|
descendingOrderKey: "sub_issues_count",
|
|
|
|
descendingOrderTitle: "Least",
|
2023-12-05 10:35:50 +00:00
|
|
|
icon: LayersIcon,
|
2024-01-11 12:49:19 +00:00
|
|
|
Column: SpreadsheetSubIssueColumn,
|
2023-11-03 13:45:09 +00:00
|
|
|
},
|
2023-10-18 07:02:02 +00:00
|
|
|
};
|
2024-01-11 12:49:19 +00:00
|
|
|
|
|
|
|
export const SPREADSHEET_PROPERTY_LIST: (keyof IIssueDisplayProperties)[] = [
|
|
|
|
"state",
|
|
|
|
"priority",
|
|
|
|
"assignee",
|
|
|
|
"labels",
|
|
|
|
"start_date",
|
|
|
|
"due_date",
|
|
|
|
"estimate",
|
|
|
|
"created_on",
|
|
|
|
"updated_on",
|
|
|
|
"link",
|
|
|
|
"attachment_count",
|
|
|
|
"sub_issue_count",
|
|
|
|
];
|