2023-12-05 10:35:50 +00:00
|
|
|
import { FC } from "react";
|
2024-05-28 06:20:04 +00:00
|
|
|
// icons
|
2024-06-04 05:42:24 +00:00
|
|
|
import {
|
|
|
|
CalendarDays,
|
|
|
|
Link2,
|
|
|
|
Signal,
|
|
|
|
Tag,
|
|
|
|
Triangle,
|
|
|
|
Paperclip,
|
|
|
|
CalendarCheck2,
|
|
|
|
CalendarClock,
|
|
|
|
Users,
|
|
|
|
} from "lucide-react";
|
2024-05-28 06:20:04 +00:00
|
|
|
// types
|
|
|
|
import { IIssueDisplayProperties, TIssue, TIssueOrderByOptions } from "@plane/types";
|
|
|
|
// ui
|
|
|
|
import { LayersIcon, DoubleCircleIcon, DiceIcon, ContrastIcon } from "@plane/ui";
|
2023-12-05 10:35:50 +00:00
|
|
|
import { ISvgIcons } from "@plane/ui/src/icons/type";
|
2024-05-28 06:20:04 +00:00
|
|
|
// components
|
2024-01-11 12:49:19 +00:00
|
|
|
import {
|
|
|
|
SpreadsheetAssigneeColumn,
|
|
|
|
SpreadsheetAttachmentColumn,
|
|
|
|
SpreadsheetCreatedOnColumn,
|
|
|
|
SpreadsheetDueDateColumn,
|
|
|
|
SpreadsheetEstimateColumn,
|
|
|
|
SpreadsheetLabelColumn,
|
2024-02-21 13:50:46 +00:00
|
|
|
SpreadsheetModuleColumn,
|
|
|
|
SpreadsheetCycleColumn,
|
2024-01-11 12:49:19 +00:00
|
|
|
SpreadsheetLinkColumn,
|
|
|
|
SpreadsheetPriorityColumn,
|
|
|
|
SpreadsheetStartDateColumn,
|
|
|
|
SpreadsheetStateColumn,
|
|
|
|
SpreadsheetSubIssueColumn,
|
|
|
|
SpreadsheetUpdatedOnColumn,
|
2024-03-19 14:38:35 +00:00
|
|
|
} 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-02-05 07:49:07 +00:00
|
|
|
Column: React.FC<{
|
|
|
|
issue: TIssue;
|
2024-02-08 06:19:00 +00:00
|
|
|
onClose: () => void;
|
2024-02-05 07:49:07 +00:00
|
|
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => 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",
|
2024-05-28 06:20:04 +00:00
|
|
|
icon: Users,
|
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",
|
2024-02-28 13:43:17 +00:00
|
|
|
icon: CalendarCheck2,
|
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
|
|
|
},
|
2024-02-21 13:50:46 +00:00
|
|
|
modules: {
|
|
|
|
title: "Modules",
|
|
|
|
ascendingOrderKey: "modules__name",
|
|
|
|
ascendingOrderTitle: "A",
|
|
|
|
descendingOrderKey: "-modules__name",
|
|
|
|
descendingOrderTitle: "Z",
|
|
|
|
icon: DiceIcon,
|
|
|
|
Column: SpreadsheetModuleColumn,
|
|
|
|
},
|
|
|
|
cycle: {
|
|
|
|
title: "Cycle",
|
|
|
|
ascendingOrderKey: "cycle__name",
|
|
|
|
ascendingOrderTitle: "A",
|
|
|
|
descendingOrderKey: "-cycle__name",
|
|
|
|
descendingOrderTitle: "Z",
|
|
|
|
icon: ContrastIcon,
|
|
|
|
Column: SpreadsheetCycleColumn,
|
|
|
|
},
|
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",
|
2024-02-28 13:43:17 +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",
|
2024-02-21 13:50:46 +00:00
|
|
|
"modules",
|
|
|
|
"cycle",
|
2024-01-11 12:49:19 +00:00
|
|
|
"start_date",
|
|
|
|
"due_date",
|
|
|
|
"estimate",
|
|
|
|
"created_on",
|
|
|
|
"updated_on",
|
|
|
|
"link",
|
|
|
|
"attachment_count",
|
|
|
|
"sub_issue_count",
|
|
|
|
];
|
2024-06-04 05:42:24 +00:00
|
|
|
|
|
|
|
export const SPREADSHEET_SELECT_GROUP = "spreadsheet-issues";
|