From 2ae71b76c50448d1422cb559d379024164ee1951 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 18 Oct 2023 16:19:46 +0530 Subject: [PATCH] refactor: spreadsheet column components --- .../assignee-column/assignee-column.tsx | 32 --- .../spreadsheet/assignee-column/index.ts | 2 - .../assignee-column.tsx} | 15 +- .../columns-list.tsx} | 0 .../created-on-column.tsx} | 10 +- .../due-date-column.tsx} | 13 +- .../estimate-column.tsx} | 8 +- .../spreadsheet/columns/index.ts | 11 ++ .../{issue-column => columns/issue}/index.ts | 0 .../issue}/issue-column.tsx | 0 .../issue}/spreadsheet-issue-column.tsx | 0 .../label-column.tsx} | 14 +- .../priority-column.tsx} | 10 +- .../start-date-column.tsx} | 13 +- .../state-column.tsx} | 14 +- .../updated-on-column.tsx} | 10 +- .../created-on-column/created-on-column.tsx | 20 -- .../spreadsheet/created-on-column/index.ts | 2 - .../due-date-column/due-date-column.tsx | 23 --- .../spreadsheet/due-date-column/index.ts | 2 - .../estimate-column/estimate-column.tsx | 23 --- .../spreadsheet/estimate-column/index.ts | 2 - .../issues/issue-layouts/spreadsheet/index.ts | 13 +- .../spreadsheet/label-column/index.ts | 2 - .../spreadsheet/label-column/label-column.tsx | 32 --- .../spreadsheet/priority-column/index.ts | 2 - .../priority-column/priority-column.tsx | 28 --- .../spreadsheet/spreadsheet-column.tsx | 177 ++++++++--------- .../spreadsheet/spreadsheet-view.tsx | 186 +++++++++--------- .../spreadsheet/start-date-column/index.ts | 2 - .../start-date-column/start-date-column.tsx | 22 --- .../spreadsheet/state-column/index.ts | 2 - .../spreadsheet/state-column/state-column.tsx | 31 --- .../spreadsheet/updated-on-column/index.ts | 2 - .../updated-on-column/updated-on-column.tsx | 22 --- .../issues/view-select/start-date.tsx | 2 +- web/styles/command-pallette.css | 4 +- 37 files changed, 259 insertions(+), 492 deletions(-) delete mode 100644 web/components/issues/issue-layouts/spreadsheet/assignee-column/assignee-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/assignee-column/index.ts rename web/components/issues/issue-layouts/spreadsheet/{assignee-column/spreadsheet-assignee-column.tsx => columns/assignee-column.tsx} (80%) rename web/components/issues/issue-layouts/spreadsheet/{spreadsheet-columns-list.tsx => columns/columns-list.tsx} (100%) rename web/components/issues/issue-layouts/spreadsheet/{created-on-column/spreadsheet-created-on-column.tsx => columns/created-on-column.tsx} (82%) rename web/components/issues/issue-layouts/spreadsheet/{due-date-column/spreadsheet-due-date-column.tsx => columns/due-date-column.tsx} (80%) rename web/components/issues/issue-layouts/spreadsheet/{estimate-column/spreadsheet-estimate-column.tsx => columns/estimate-column.tsx} (83%) create mode 100644 web/components/issues/issue-layouts/spreadsheet/columns/index.ts rename web/components/issues/issue-layouts/spreadsheet/{issue-column => columns/issue}/index.ts (100%) rename web/components/issues/issue-layouts/spreadsheet/{issue-column => columns/issue}/issue-column.tsx (100%) rename web/components/issues/issue-layouts/spreadsheet/{issue-column => columns/issue}/spreadsheet-issue-column.tsx (100%) rename web/components/issues/issue-layouts/spreadsheet/{label-column/spreadsheet-label-column.tsx => columns/label-column.tsx} (85%) rename web/components/issues/issue-layouts/spreadsheet/{priority-column/spreadsheet-priority-column.tsx => columns/priority-column.tsx} (76%) rename web/components/issues/issue-layouts/spreadsheet/{start-date-column/spreadsheet-start-date-column.tsx => columns/start-date-column.tsx} (80%) rename web/components/issues/issue-layouts/spreadsheet/{state-column/spreadsheet-state-column.tsx => columns/state-column.tsx} (83%) rename web/components/issues/issue-layouts/spreadsheet/{updated-on-column/spreadsheet-updated-on-column.tsx => columns/updated-on-column.tsx} (83%) delete mode 100644 web/components/issues/issue-layouts/spreadsheet/created-on-column/created-on-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/created-on-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/due-date-column/due-date-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/due-date-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/estimate-column/estimate-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/estimate-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/label-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/label-column/label-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/priority-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/priority-column/priority-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/start-date-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/start-date-column/start-date-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/state-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/state-column/state-column.tsx delete mode 100644 web/components/issues/issue-layouts/spreadsheet/updated-on-column/index.ts delete mode 100644 web/components/issues/issue-layouts/spreadsheet/updated-on-column/updated-on-column.tsx diff --git a/web/components/issues/issue-layouts/spreadsheet/assignee-column/assignee-column.tsx b/web/components/issues/issue-layouts/spreadsheet/assignee-column/assignee-column.tsx deleted file mode 100644 index 53484b3f6..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/assignee-column/assignee-column.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from "react"; -// components -import { MembersSelect } from "components/project"; -// types -import { IIssue, IUserLite } from "types"; - -type Props = { - issue: IIssue; - onChange: (members: string[]) => void; - members: IUserLite[] | undefined; - disabled: boolean; -}; - -export const AssigneeColumn: React.FC = (props) => { - const { issue, onChange, members, disabled } = props; - - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/assignee-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/assignee-column/index.ts deleted file mode 100644 index 8750550be..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/assignee-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-assignee-column"; -export * from "./assignee-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/assignee-column/spreadsheet-assignee-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/assignee-column.tsx similarity index 80% rename from web/components/issues/issue-layouts/spreadsheet/assignee-column/spreadsheet-assignee-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/assignee-column.tsx index f0f10880b..f4878d137 100644 --- a/web/components/issues/issue-layouts/spreadsheet/assignee-column/spreadsheet-assignee-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/assignee-column.tsx @@ -1,7 +1,7 @@ import React from "react"; // components -import { AssigneeColumn } from "components/issues"; +import { MembersSelect } from "components/project"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -21,12 +21,15 @@ export const SpreadsheetAssigneeColumn: React.FC = ({ issue, members, onC const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- + onChange({ assignees_list: data })} + members={members ?? []} + buttonClassName="!p-0 !rounded-none !shadow-none !border-0" + hideDropdownArrow disabled={disabled} + multiple /> {isExpanded && @@ -43,6 +46,6 @@ export const SpreadsheetAssigneeColumn: React.FC = ({ issue, members, onC disabled={disabled} /> ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-columns-list.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/columns-list.tsx similarity index 100% rename from web/components/issues/issue-layouts/spreadsheet/spreadsheet-columns-list.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/columns-list.tsx diff --git a/web/components/issues/issue-layouts/spreadsheet/created-on-column/spreadsheet-created-on-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/created-on-column.tsx similarity index 82% rename from web/components/issues/issue-layouts/spreadsheet/created-on-column/spreadsheet-created-on-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/created-on-column.tsx index 5295a8648..54a8ffee5 100644 --- a/web/components/issues/issue-layouts/spreadsheet/created-on-column/spreadsheet-created-on-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/created-on-column.tsx @@ -1,9 +1,9 @@ import React from "react"; -// components -import { CreatedOnColumn } from "components/issues"; // hooks import useSubIssue from "hooks/use-sub-issue"; +// helpers +import { renderLongDetailDateFormat } from "helpers/date-time.helper"; // types import { IIssue } from "types"; @@ -18,8 +18,8 @@ export const SpreadsheetCreatedOnColumn: React.FC = ({ issue, expandedIss const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- + <> + {renderLongDetailDateFormat(issue.created_at)} {isExpanded && !isLoading && @@ -28,6 +28,6 @@ export const SpreadsheetCreatedOnColumn: React.FC = ({ issue, expandedIss subIssues.map((subIssue: IIssue) => ( ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/due-date-column/spreadsheet-due-date-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/due-date-column.tsx similarity index 80% rename from web/components/issues/issue-layouts/spreadsheet/due-date-column/spreadsheet-due-date-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/due-date-column.tsx index 0693ac455..41bafeadc 100644 --- a/web/components/issues/issue-layouts/spreadsheet/due-date-column/spreadsheet-due-date-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/due-date-column.tsx @@ -1,7 +1,7 @@ import React from "react"; // components -import { DueDateColumn } from "components/issues"; +import { ViewDueDateSelect } from "components/issues"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -20,8 +20,13 @@ export const SpreadsheetDueDateColumn: React.FC = ({ issue, onChange, exp const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- onChange({ target_date: val })} disabled={disabled} /> + <> + onChange({ target_date: val })} + noBorder + disabled={disabled} + /> {isExpanded && !isLoading && @@ -36,6 +41,6 @@ export const SpreadsheetDueDateColumn: React.FC = ({ issue, onChange, exp disabled={disabled} /> ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/estimate-column/spreadsheet-estimate-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/estimate-column.tsx similarity index 83% rename from web/components/issues/issue-layouts/spreadsheet/estimate-column/spreadsheet-estimate-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/estimate-column.tsx index a8ae5beb4..156fb707f 100644 --- a/web/components/issues/issue-layouts/spreadsheet/estimate-column/spreadsheet-estimate-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/estimate-column.tsx @@ -1,5 +1,5 @@ // components -import { EstimateColumn } from "components/issues"; +import { ViewEstimateSelect } from "components/issues"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -20,8 +20,8 @@ export const SpreadsheetEstimateColumn: React.FC = (props) => { const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- onChange({ estimate_point: data })} disabled={disabled} /> + <> + onChange({ estimate_point: data })} disabled={disabled} /> {isExpanded && !isLoading && @@ -36,6 +36,6 @@ export const SpreadsheetEstimateColumn: React.FC = (props) => { disabled={disabled} /> ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/columns/index.ts b/web/components/issues/issue-layouts/spreadsheet/columns/index.ts new file mode 100644 index 000000000..a1c4959ab --- /dev/null +++ b/web/components/issues/issue-layouts/spreadsheet/columns/index.ts @@ -0,0 +1,11 @@ +export * from "./issue"; +export * from "./assignee-column"; +export * from "./columns-list"; +export * from "./created-on-column"; +export * from "./due-date-column"; +export * from "./estimate-column"; +export * from "./label-column"; +export * from "./priority-column"; +export * from "./start-date-column"; +export * from "./state-column"; +export * from "./updated-on-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/issue-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/columns/issue/index.ts similarity index 100% rename from web/components/issues/issue-layouts/spreadsheet/issue-column/index.ts rename to web/components/issues/issue-layouts/spreadsheet/columns/issue/index.ts diff --git a/web/components/issues/issue-layouts/spreadsheet/issue-column/issue-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/issue/issue-column.tsx similarity index 100% rename from web/components/issues/issue-layouts/spreadsheet/issue-column/issue-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/issue/issue-column.tsx diff --git a/web/components/issues/issue-layouts/spreadsheet/issue-column/spreadsheet-issue-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/issue/spreadsheet-issue-column.tsx similarity index 100% rename from web/components/issues/issue-layouts/spreadsheet/issue-column/spreadsheet-issue-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/issue/spreadsheet-issue-column.tsx diff --git a/web/components/issues/issue-layouts/spreadsheet/label-column/spreadsheet-label-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/label-column.tsx similarity index 85% rename from web/components/issues/issue-layouts/spreadsheet/label-column/spreadsheet-label-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/label-column.tsx index 465326fcb..d912cad9f 100644 --- a/web/components/issues/issue-layouts/spreadsheet/label-column/spreadsheet-label-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/label-column.tsx @@ -1,7 +1,7 @@ import React from "react"; // components -import { LabelColumn } from "components/issues"; +import { LabelSelect } from "components/project"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -23,11 +23,13 @@ export const SpreadsheetLabelColumn: React.FC = (props) => { const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- + onChange({ labels_list: data })} - labels={labels} + labels={labels ?? []} + hideDropdownArrow + maxRender={1} disabled={disabled} /> @@ -45,6 +47,6 @@ export const SpreadsheetLabelColumn: React.FC = (props) => { disabled={disabled} /> ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/priority-column/spreadsheet-priority-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/priority-column.tsx similarity index 76% rename from web/components/issues/issue-layouts/spreadsheet/priority-column/spreadsheet-priority-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/priority-column.tsx index 1c12054f5..22ef2a0bd 100644 --- a/web/components/issues/issue-layouts/spreadsheet/priority-column/spreadsheet-priority-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/priority-column.tsx @@ -1,7 +1,7 @@ import React from "react"; // components -import { PriorityColumn } from "components/issues"; +import { PrioritySelect } from "components/project"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -21,7 +21,13 @@ export const SpreadsheetPriorityColumn: React.FC = ({ issue, onChange, ex return (
- onChange({ priority: data })} disabled={disabled} /> + onChange({ priority: data })} + buttonClassName="!p-0 !rounded-none !shadow-none !border-0" + hideDropdownArrow + disabled={disabled} + /> {isExpanded && !isLoading && diff --git a/web/components/issues/issue-layouts/spreadsheet/start-date-column/spreadsheet-start-date-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/start-date-column.tsx similarity index 80% rename from web/components/issues/issue-layouts/spreadsheet/start-date-column/spreadsheet-start-date-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/start-date-column.tsx index 61087fa19..cdacf4e72 100644 --- a/web/components/issues/issue-layouts/spreadsheet/start-date-column/spreadsheet-start-date-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/start-date-column.tsx @@ -1,7 +1,7 @@ import React from "react"; // components -import { StartDateColumn } from "components/issues"; +import { ViewStartDateSelect } from "components/issues"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -20,8 +20,13 @@ export const SpreadsheetStartDateColumn: React.FC = ({ issue, onChange, e const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- onChange({ start_date: val })} disabled={disabled} /> + <> + onChange({ start_date: val })} + noBorder + disabled={disabled} + /> {isExpanded && !isLoading && @@ -36,6 +41,6 @@ export const SpreadsheetStartDateColumn: React.FC = ({ issue, onChange, e disabled={disabled} /> ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/state-column/spreadsheet-state-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/state-column.tsx similarity index 83% rename from web/components/issues/issue-layouts/spreadsheet/state-column/spreadsheet-state-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/state-column.tsx index 8a30bbb8c..7873ebe02 100644 --- a/web/components/issues/issue-layouts/spreadsheet/state-column/spreadsheet-state-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/state-column.tsx @@ -1,7 +1,7 @@ import React from "react"; // components -import { StateColumn } from "components/issues"; +import { StateSelect } from "components/states"; // hooks import useSubIssue from "hooks/use-sub-issue"; // types @@ -23,11 +23,13 @@ export const SpreadsheetStateColumn: React.FC = (props) => { const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- + onChange({ state: data.id, state_detail: data })} - states={states} + stateGroups={states} + buttonClassName="!shadow-none !border-0" + hideDropdownArrow disabled={disabled} /> @@ -45,6 +47,6 @@ export const SpreadsheetStateColumn: React.FC = (props) => { disabled={disabled} /> ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/updated-on-column/spreadsheet-updated-on-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/updated-on-column.tsx similarity index 83% rename from web/components/issues/issue-layouts/spreadsheet/updated-on-column/spreadsheet-updated-on-column.tsx rename to web/components/issues/issue-layouts/spreadsheet/columns/updated-on-column.tsx index 4752ea088..b2892f2a9 100644 --- a/web/components/issues/issue-layouts/spreadsheet/updated-on-column/spreadsheet-updated-on-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/updated-on-column.tsx @@ -1,9 +1,9 @@ import React from "react"; -// components -import { UpdatedOnColumn } from "components/issues"; // hooks import useSubIssue from "hooks/use-sub-issue"; +// helpers +import { renderLongDetailDateFormat } from "helpers/date-time.helper"; // types import { IIssue } from "types"; @@ -20,8 +20,8 @@ export const SpreadsheetUpdatedOnColumn: React.FC = (props) => { const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); return ( -
- + <> + {renderLongDetailDateFormat(issue.updated_at)} {isExpanded && !isLoading && @@ -30,6 +30,6 @@ export const SpreadsheetUpdatedOnColumn: React.FC = (props) => { subIssues.map((subIssue: IIssue) => ( ))} -
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/created-on-column/created-on-column.tsx b/web/components/issues/issue-layouts/spreadsheet/created-on-column/created-on-column.tsx deleted file mode 100644 index fe648ac86..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/created-on-column/created-on-column.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; - -// types -import { IIssue } from "types"; -// helper -import { renderLongDetailDateFormat } from "helpers/date-time.helper"; - -type Props = { - issue: IIssue; -}; - -export const CreatedOnColumn: React.FC = ({ issue }) => ( -
- -
- {renderLongDetailDateFormat(issue.created_at)} -
-
-
-); diff --git a/web/components/issues/issue-layouts/spreadsheet/created-on-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/created-on-column/index.ts deleted file mode 100644 index 28781aa17..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/created-on-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-created-on-column"; -export * from "./created-on-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/due-date-column/due-date-column.tsx b/web/components/issues/issue-layouts/spreadsheet/due-date-column/due-date-column.tsx deleted file mode 100644 index 0caca7cd7..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/due-date-column/due-date-column.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { FC } from "react"; -// components -import { ViewDueDateSelect } from "components/issues"; -// types -import { IIssue } from "types"; - -type Props = { - issue: IIssue; - onChange: (date: string | null) => void; - disabled: boolean; -}; - -export const DueDateColumn: FC = (props) => { - const { issue, onChange, disabled } = props; - - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/due-date-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/due-date-column/index.ts deleted file mode 100644 index 64b454877..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/due-date-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-due-date-column"; -export * from "./due-date-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/estimate-column/estimate-column.tsx b/web/components/issues/issue-layouts/spreadsheet/estimate-column/estimate-column.tsx deleted file mode 100644 index f03011135..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/estimate-column/estimate-column.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { FC } from "react"; -// components -import { ViewEstimateSelect } from "components/issues"; -// types -import { IIssue } from "types"; - -type Props = { - issue: IIssue; - onChange: (data: number) => void; - disabled: boolean; -}; - -export const EstimateColumn: FC = (props) => { - const { issue, onChange, disabled } = props; - - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/estimate-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/estimate-column/index.ts deleted file mode 100644 index 31f07e6a7..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/estimate-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-estimate-column"; -export * from "./estimate-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/index.ts b/web/components/issues/issue-layouts/spreadsheet/index.ts index 7a804c6de..64b02a766 100644 --- a/web/components/issues/issue-layouts/spreadsheet/index.ts +++ b/web/components/issues/issue-layouts/spreadsheet/index.ts @@ -1,15 +1,4 @@ -export * from "./assignee-column"; -export * from "./created-on-column"; -export * from "./due-date-column"; -export * from "./estimate-column"; -export * from "./issue-column"; -export * from "./label-column"; -export * from "./priority-column"; +export * from "./columns"; export * from "./roots"; -export * from "./start-date-column"; -export * from "./state-column"; -export * from "./updated-on-column"; -export * from "./issue-column"; export * from "./spreadsheet-column"; -export * from "./spreadsheet-columns-list"; export * from "./spreadsheet-view"; diff --git a/web/components/issues/issue-layouts/spreadsheet/label-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/label-column/index.ts deleted file mode 100644 index a1b69c1a9..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/label-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-label-column"; -export * from "./label-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/label-column/label-column.tsx b/web/components/issues/issue-layouts/spreadsheet/label-column/label-column.tsx deleted file mode 100644 index 3d720da1b..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/label-column/label-column.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from "react"; - -// components -import { LabelSelect } from "components/project"; -// types -import { IIssue, IIssueLabels } from "types"; - -type Props = { - issue: IIssue; - onChange: (data: string[]) => void; - labels: IIssueLabels[] | undefined; - disabled: boolean; -}; - -export const LabelColumn: React.FC = (props) => { - const { issue, onChange, labels, disabled } = props; - - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/priority-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/priority-column/index.ts deleted file mode 100644 index fc542331e..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/priority-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-priority-column"; -export * from "./priority-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/priority-column/priority-column.tsx b/web/components/issues/issue-layouts/spreadsheet/priority-column/priority-column.tsx deleted file mode 100644 index 21f2a5927..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/priority-column/priority-column.tsx +++ /dev/null @@ -1,28 +0,0 @@ -// components -import { PrioritySelect } from "components/project"; -// types -import { IIssue, TIssuePriorities } from "types"; - -type Props = { - issue: IIssue; - onChange: (data: TIssuePriorities) => void; - disabled: boolean; -}; - -export const PriorityColumn: React.FC = (props) => { - const { issue, onChange, disabled } = props; - - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-column.tsx b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-column.tsx index d6f3474f3..172194b83 100644 --- a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-column.tsx @@ -34,6 +34,7 @@ import { } from "types"; // constants import { SPREADSHEET_PROPERTY_DETAILS } from "constants/spreadsheet"; +import { Command } from "cmdk"; type Props = { disableUserActions: boolean; @@ -166,101 +167,89 @@ export const SpreadsheetColumn: React.FC = (props) => {
- {issues?.map((issue) => { - if (property === "state") - return ( - + <> + {issues?.map((issue) => ( + ) => handleUpdateIssue(issue, data)} - states={states} - /> - ); - - if (property === "priority") - return ( - ) => handleUpdateIssue(issue, data)} - /> - ); - - if (property === "estimate") - return ( - ) => handleUpdateIssue(issue, data)} - /> - ); - if (property === "assignee") - return ( - ) => handleUpdateIssue(issue, data)} - /> - ); - if (property === "labels") - return ( - ) => handleUpdateIssue(issue, data)} - /> - ); - if (property === "start_date") - return ( - ) => handleUpdateIssue(issue, data)} - /> - ); - if (property === "due_date") - return ( - ) => handleUpdateIssue(issue, data)} - /> - ); - if (property === "created_on") - return ( - - ); - if (property === "updated_on") - return ( - - ); - - return null; - })} + value={`${property}-${issue.id}`} + className="h-11 flex items-center px-4 py-2.5 border-b-[0.5px] border-custom-border-200" + > + {property === "state" ? ( + ) => handleUpdateIssue(issue, data)} + states={states} + /> + ) : property === "priority" ? ( + ) => handleUpdateIssue(issue, data)} + /> + ) : property === "estimate" ? ( + ) => handleUpdateIssue(issue, data)} + /> + ) : property === "assignee" ? ( + ) => handleUpdateIssue(issue, data)} + /> + ) : property === "labels" ? ( + ) => handleUpdateIssue(issue, data)} + /> + ) : property === "start_date" ? ( + ) => handleUpdateIssue(issue, data)} + /> + ) : property === "due_date" ? ( + ) => handleUpdateIssue(issue, data)} + /> + ) : property === "created_on" ? ( + + ) : property === "updated_on" ? ( + + ) : null} + + ))} + +
); diff --git a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx index a1e642bbc..fe814f5fd 100644 --- a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx @@ -19,6 +19,7 @@ import { IStateResponse, IUserLite, } from "types"; +import { Command } from "cmdk"; type Props = { displayProperties: IIssueDisplayProperties; @@ -80,64 +81,68 @@ export const SpreadsheetView: React.FC = observer((props) => { }, []); return ( - <> -
-
-
- {issues ? ( - <> -
-
-
- {displayProperties.key && ( - ID - )} - Issue + + +
+
+
+ {issues ? ( + <> +
+
+
+ {displayProperties.key && ( + ID + )} + Issue +
+ + {issues.map((issue: IIssue, index) => ( + + ))}
- - {issues.map((issue: IIssue, index) => ( - - ))}
+ + + + ) : ( +
+
+ )} +
- - - ) : ( -
- -
- )} -
- -
-
- {/* +
+ {/* setIsInlineCreateIssueFormOpen(false)} prePopulatedData={{ @@ -145,44 +150,45 @@ export const SpreadsheetView: React.FC = observer((props) => { ...(moduleId && { module: moduleId.toString() }), }} /> */} -
+
- {!disableUserActions && - !isInlineCreateIssueFormOpen && - (type === "issue" ? ( - - ) : ( - - - New Issue - - } - optionsClassName="left-5 !w-36" - noBorder - > - setIsInlineCreateIssueFormOpen(true)}> - Create new - - {openIssuesListModal && ( - Add an existing issue - )} - - ))} + {!disableUserActions && + !isInlineCreateIssueFormOpen && + (type === "issue" ? ( + + ) : ( + + + New Issue + + } + optionsClassName="left-5 !w-36" + noBorder + > + setIsInlineCreateIssueFormOpen(true)}> + Create new + + {openIssuesListModal && ( + Add an existing issue + )} + + ))} +
-
- + + ); }); diff --git a/web/components/issues/issue-layouts/spreadsheet/start-date-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/start-date-column/index.ts deleted file mode 100644 index 94f229498..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/start-date-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-start-date-column"; -export * from "./start-date-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/start-date-column/start-date-column.tsx b/web/components/issues/issue-layouts/spreadsheet/start-date-column/start-date-column.tsx deleted file mode 100644 index cdb33f909..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/start-date-column/start-date-column.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -// components -import { ViewStartDateSelect } from "components/issues"; -// types -import { IIssue } from "types"; - -type Props = { - issue: IIssue; - onChange: (data: string | null) => void; - disabled: boolean; -}; - -export const StartDateColumn: React.FC = (props) => { - const { issue, onChange, disabled } = props; - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/state-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/state-column/index.ts deleted file mode 100644 index f3cbef871..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/state-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-state-column"; -export * from "./state-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/state-column/state-column.tsx b/web/components/issues/issue-layouts/spreadsheet/state-column/state-column.tsx deleted file mode 100644 index 3e290448b..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/state-column/state-column.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from "react"; -// components -import { StateSelect } from "components/states"; -// types -import { IIssue, IState, IStateResponse } from "types"; - -type Props = { - issue: IIssue; - onChange: (formData: IState) => void; - states: IStateResponse | undefined; - disabled: boolean; -}; - -export const StateColumn: React.FC = (props) => { - const { issue, onChange, states, disabled } = props; - - return ( -
- - - -
- ); -}; diff --git a/web/components/issues/issue-layouts/spreadsheet/updated-on-column/index.ts b/web/components/issues/issue-layouts/spreadsheet/updated-on-column/index.ts deleted file mode 100644 index af1337a7f..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/updated-on-column/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./spreadsheet-updated-on-column"; -export * from "./updated-on-column"; diff --git a/web/components/issues/issue-layouts/spreadsheet/updated-on-column/updated-on-column.tsx b/web/components/issues/issue-layouts/spreadsheet/updated-on-column/updated-on-column.tsx deleted file mode 100644 index ed4c0294f..000000000 --- a/web/components/issues/issue-layouts/spreadsheet/updated-on-column/updated-on-column.tsx +++ /dev/null @@ -1,22 +0,0 @@ -// helpers -import { renderLongDetailDateFormat } from "helpers/date-time.helper"; -// types -import { IIssue } from "types"; - -type Props = { - issue: IIssue; -}; - -export const UpdatedOnColumn: React.FC = (props) => { - const { issue } = props; - - return ( -
- -
- {renderLongDetailDateFormat(issue.updated_at)} -
-
-
- ); -}; diff --git a/web/components/issues/view-select/start-date.tsx b/web/components/issues/view-select/start-date.tsx index 7fd61cb44..d70c0de46 100644 --- a/web/components/issues/view-select/start-date.tsx +++ b/web/components/issues/view-select/start-date.tsx @@ -39,7 +39,7 @@ export const ViewStartDateSelect: React.FC = ({ placeholder="Start date" value={issue?.start_date} onChange={onChange} - className={`bg-transparent ${issue?.start_date ? "w-[6.5rem]" : "w-[5rem] text-center"}`} + className={`bg-inherit ${issue?.start_date ? "w-[6.5rem]" : "w-[5rem] text-center"}`} maxDate={maxDate ?? undefined} noBorder={noBorder} handleOnOpen={handleOnOpen} diff --git a/web/styles/command-pallette.css b/web/styles/command-pallette.css index 12cfe18eb..83466e7b1 100644 --- a/web/styles/command-pallette.css +++ b/web/styles/command-pallette.css @@ -9,13 +9,13 @@ } [cmdk-item] { - display: flex; + /* display: flex; align-items: center; justify-content: space-between; border-radius: 0.375rem; padding: 0.5rem; font-size: 0.825rem; - line-height: 1.25rem; + line-height: 1.25rem; */ cursor: pointer; }