refactor: spreadsheet layout (#2478)

* refactor: spreadsheet column components

* refactor: spreadsheet layout components

* fix: unique key for each cell
This commit is contained in:
Aaryan Khandelwal 2023-10-18 19:18:01 +05:30 committed by GitHub
parent c270c8689f
commit b3b79c51bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 190 additions and 433 deletions

View File

@ -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> = (props) => {
const { issue, onChange, members, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<MembersSelect
value={issue.assignees}
onChange={onChange}
members={members ?? []}
buttonClassName="!p-0 !rounded-none !shadow-none !border-0"
hideDropdownArrow
disabled={disabled}
multiple
/>
</span>
</div>
);
};

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-assignee-column";
export * from "./assignee-column";

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
// components // components
import { AssigneeColumn } from "components/issues"; import { MembersSelect } from "components/project";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -21,12 +21,15 @@ export const SpreadsheetAssigneeColumn: React.FC<Props> = ({ issue, members, onC
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<AssigneeColumn <MembersSelect
issue={issue} value={issue.assignees}
members={members}
onChange={(data) => onChange({ assignees_list: data })} onChange={(data) => onChange({ assignees_list: data })}
members={members ?? []}
buttonClassName="!p-0 !rounded-none !shadow-none !border-0"
hideDropdownArrow
disabled={disabled} disabled={disabled}
multiple
/> />
{isExpanded && {isExpanded &&
@ -43,6 +46,6 @@ export const SpreadsheetAssigneeColumn: React.FC<Props> = ({ issue, members, onC
disabled={disabled} disabled={disabled}
/> />
))} ))}
</div> </>
); );
}; };

View File

@ -1,9 +1,9 @@
import React from "react"; import React from "react";
// components
import { CreatedOnColumn } from "components/issues";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// helpers
import { renderLongDetailDateFormat } from "helpers/date-time.helper";
// types // types
import { IIssue } from "types"; import { IIssue } from "types";
@ -18,8 +18,8 @@ export const SpreadsheetCreatedOnColumn: React.FC<Props> = ({ issue, expandedIss
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<CreatedOnColumn issue={issue} /> {renderLongDetailDateFormat(issue.created_at)}
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&
@ -28,6 +28,6 @@ export const SpreadsheetCreatedOnColumn: React.FC<Props> = ({ issue, expandedIss
subIssues.map((subIssue: IIssue) => ( subIssues.map((subIssue: IIssue) => (
<SpreadsheetCreatedOnColumn key={subIssue.id} issue={subIssue} expandedIssues={expandedIssues} /> <SpreadsheetCreatedOnColumn key={subIssue.id} issue={subIssue} expandedIssues={expandedIssues} />
))} ))}
</div> </>
); );
}; };

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
// components // components
import { DueDateColumn } from "components/issues"; import { ViewDueDateSelect } from "components/issues";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -20,8 +20,13 @@ export const SpreadsheetDueDateColumn: React.FC<Props> = ({ issue, onChange, exp
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<DueDateColumn issue={issue} onChange={(val) => onChange({ target_date: val })} disabled={disabled} /> <ViewDueDateSelect
issue={issue}
onChange={(val) => onChange({ target_date: val })}
noBorder
disabled={disabled}
/>
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&
@ -36,6 +41,6 @@ export const SpreadsheetDueDateColumn: React.FC<Props> = ({ issue, onChange, exp
disabled={disabled} disabled={disabled}
/> />
))} ))}
</div> </>
); );
}; };

View File

@ -1,5 +1,5 @@
// components // components
import { EstimateColumn } from "components/issues"; import { ViewEstimateSelect } from "components/issues";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -20,8 +20,8 @@ export const SpreadsheetEstimateColumn: React.FC<Props> = (props) => {
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<EstimateColumn issue={issue} onChange={(data) => onChange({ estimate_point: data })} disabled={disabled} /> <ViewEstimateSelect issue={issue} onChange={(data) => onChange({ estimate_point: data })} disabled={disabled} />
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&
@ -36,6 +36,6 @@ export const SpreadsheetEstimateColumn: React.FC<Props> = (props) => {
disabled={disabled} disabled={disabled}
/> />
))} ))}
</div> </>
); );
}; };

View File

@ -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";

View File

@ -63,7 +63,7 @@ export const IssueColumn: React.FC<Props> = ({
const paddingLeft = `${nestingLevel * 54}px`; const paddingLeft = `${nestingLevel * 54}px`;
return ( return (
<div className="group flex items-center w-[28rem] text-sm h-11 sticky top-0 bg-custom-background-100 truncate border-b border-r border-custom-border-100"> <div className="group flex items-center w-[28rem] text-sm h-11 sticky top-0 bg-custom-background-100 truncate border-b border-custom-border-100">
{properties.key && ( {properties.key && (
<div <div
className="flex gap-1.5 px-4 pr-0 py-2.5 items-center min-w-[96px]" className="flex gap-1.5 px-4 pr-0 py-2.5 items-center min-w-[96px]"

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
// components // components
import { LabelColumn } from "components/issues"; import { LabelSelect } from "components/project";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -23,11 +23,13 @@ export const SpreadsheetLabelColumn: React.FC<Props> = (props) => {
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<LabelColumn <LabelSelect
issue={issue} value={issue.labels}
onChange={(data) => onChange({ labels_list: data })} onChange={(data) => onChange({ labels_list: data })}
labels={labels} labels={labels ?? []}
hideDropdownArrow
maxRender={1}
disabled={disabled} disabled={disabled}
/> />
@ -45,6 +47,6 @@ export const SpreadsheetLabelColumn: React.FC<Props> = (props) => {
disabled={disabled} disabled={disabled}
/> />
))} ))}
</div> </>
); );
}; };

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
// components // components
import { PriorityColumn } from "components/issues"; import { PrioritySelect } from "components/project";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -21,7 +21,13 @@ export const SpreadsheetPriorityColumn: React.FC<Props> = ({ issue, onChange, ex
return ( return (
<div> <div>
<PriorityColumn issue={issue} onChange={(data) => onChange({ priority: data })} disabled={disabled} /> <PrioritySelect
value={issue.priority}
onChange={(data) => onChange({ priority: data })}
buttonClassName="!p-0 !rounded-none !shadow-none !border-0"
hideDropdownArrow
disabled={disabled}
/>
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
// components // components
import { StartDateColumn } from "components/issues"; import { ViewStartDateSelect } from "components/issues";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -20,8 +20,13 @@ export const SpreadsheetStartDateColumn: React.FC<Props> = ({ issue, onChange, e
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<StartDateColumn issue={issue} onChange={(val) => onChange({ start_date: val })} disabled={disabled} /> <ViewStartDateSelect
issue={issue}
onChange={(val) => onChange({ start_date: val })}
noBorder
disabled={disabled}
/>
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&
@ -36,6 +41,6 @@ export const SpreadsheetStartDateColumn: React.FC<Props> = ({ issue, onChange, e
disabled={disabled} disabled={disabled}
/> />
))} ))}
</div> </>
); );
}; };

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
// components // components
import { StateColumn } from "components/issues"; import { StateSelect } from "components/states";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// types // types
@ -23,11 +23,13 @@ export const SpreadsheetStateColumn: React.FC<Props> = (props) => {
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<StateColumn <StateSelect
issue={issue} value={issue.state_detail}
onChange={(data) => onChange({ state: data.id, state_detail: data })} onChange={(data) => onChange({ state: data.id, state_detail: data })}
states={states} stateGroups={states}
buttonClassName="!shadow-none !border-0"
hideDropdownArrow
disabled={disabled} disabled={disabled}
/> />
@ -45,6 +47,6 @@ export const SpreadsheetStateColumn: React.FC<Props> = (props) => {
disabled={disabled} disabled={disabled}
/> />
))} ))}
</div> </>
); );
}; };

View File

@ -1,9 +1,9 @@
import React from "react"; import React from "react";
// components
import { UpdatedOnColumn } from "components/issues";
// hooks // hooks
import useSubIssue from "hooks/use-sub-issue"; import useSubIssue from "hooks/use-sub-issue";
// helpers
import { renderLongDetailDateFormat } from "helpers/date-time.helper";
// types // types
import { IIssue } from "types"; import { IIssue } from "types";
@ -20,8 +20,8 @@ export const SpreadsheetUpdatedOnColumn: React.FC<Props> = (props) => {
const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded); const { subIssues, isLoading } = useSubIssue(issue.project_detail.id, issue.id, isExpanded);
return ( return (
<div> <>
<UpdatedOnColumn issue={issue} /> {renderLongDetailDateFormat(issue.updated_at)}
{isExpanded && {isExpanded &&
!isLoading && !isLoading &&
@ -30,6 +30,6 @@ export const SpreadsheetUpdatedOnColumn: React.FC<Props> = (props) => {
subIssues.map((subIssue: IIssue) => ( subIssues.map((subIssue: IIssue) => (
<SpreadsheetUpdatedOnColumn key={subIssue.id} issue={subIssue} expandedIssues={expandedIssues} /> <SpreadsheetUpdatedOnColumn key={subIssue.id} issue={subIssue} expandedIssues={expandedIssues} />
))} ))}
</div> </>
); );
}; };

View File

@ -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<Props> = ({ issue }) => (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<div className="flex items-center text-xs cursor-default text-custom-text-200 text-center p-2 group-hover:bg-custom-background-80 border-custom-border-200">
{renderLongDetailDateFormat(issue.created_at)}
</div>
</span>
</div>
);

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-created-on-column";
export * from "./created-on-column";

View File

@ -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> = (props) => {
const { issue, onChange, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<ViewDueDateSelect issue={issue} onChange={onChange} noBorder disabled={disabled} />
</span>
</div>
);
};

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-due-date-column";
export * from "./due-date-column";

View File

@ -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> = (props) => {
const { issue, onChange, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<ViewEstimateSelect issue={issue} onChange={onChange} disabled={disabled} />
</span>
</div>
);
};

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-estimate-column";
export * from "./estimate-column";

View File

@ -1,15 +1,4 @@
export * from "./assignee-column"; export * from "./columns";
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 "./roots"; 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-column";
export * from "./spreadsheet-columns-list";
export * from "./spreadsheet-view"; export * from "./spreadsheet-view";

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-label-column";
export * from "./label-column";

View File

@ -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> = (props) => {
const { issue, onChange, labels, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<LabelSelect
value={issue.labels}
onChange={onChange}
labels={labels ?? []}
hideDropdownArrow
maxRender={1}
disabled={disabled}
/>
</span>
</div>
);
};

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-priority-column";
export * from "./priority-column";

View File

@ -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> = (props) => {
const { issue, onChange, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<PrioritySelect
value={issue.priority}
onChange={onChange}
buttonClassName="!p-0 !rounded-none !shadow-none !border-0"
hideDropdownArrow
disabled={disabled}
/>
</span>
</div>
);
};

View File

@ -165,22 +165,22 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
)} )}
</CustomMenu> </CustomMenu>
</div> </div>
<div className="h-full min-w-[8rem] w-full"> <div className="h-full min-w-[8rem] w-full">
{issues?.map((issue) => { {issues?.map((issue) => (
if (property === "state") <div
return (
<SpreadsheetStateColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
className="h-11 flex items-center px-4 py-2.5 border-b-[0.5px] border-custom-border-200"
>
{property === "state" ? (
<SpreadsheetStateColumn
disabled={disableUserActions} disabled={disableUserActions}
expandedIssues={expandedIssues} expandedIssues={expandedIssues}
issue={issue} issue={issue}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
states={states} states={states}
/> />
); ) : property === "priority" ? (
if (property === "priority")
return (
<SpreadsheetPriorityColumn <SpreadsheetPriorityColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
disabled={disableUserActions} disabled={disableUserActions}
@ -188,10 +188,7 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
issue={issue} issue={issue}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
/> />
); ) : property === "estimate" ? (
if (property === "estimate")
return (
<SpreadsheetEstimateColumn <SpreadsheetEstimateColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
disabled={disableUserActions} disabled={disableUserActions}
@ -199,9 +196,7 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
issue={issue} issue={issue}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
/> />
); ) : property === "assignee" ? (
if (property === "assignee")
return (
<SpreadsheetAssigneeColumn <SpreadsheetAssigneeColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
disabled={disableUserActions} disabled={disableUserActions}
@ -210,9 +205,7 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
members={members} members={members}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
/> />
); ) : property === "labels" ? (
if (property === "labels")
return (
<SpreadsheetLabelColumn <SpreadsheetLabelColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
disabled={disableUserActions} disabled={disableUserActions}
@ -221,9 +214,7 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
labels={labels} labels={labels}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
/> />
); ) : property === "start_date" ? (
if (property === "start_date")
return (
<SpreadsheetStartDateColumn <SpreadsheetStartDateColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
disabled={disableUserActions} disabled={disableUserActions}
@ -231,9 +222,7 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
issue={issue} issue={issue}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
/> />
); ) : property === "due_date" ? (
if (property === "due_date")
return (
<SpreadsheetDueDateColumn <SpreadsheetDueDateColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
disabled={disableUserActions} disabled={disableUserActions}
@ -241,26 +230,21 @@ export const SpreadsheetColumn: React.FC<Props> = (props) => {
issue={issue} issue={issue}
onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)} onChange={(data: Partial<IIssue>) => handleUpdateIssue(issue, data)}
/> />
); ) : property === "created_on" ? (
if (property === "created_on")
return (
<SpreadsheetCreatedOnColumn <SpreadsheetCreatedOnColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
expandedIssues={expandedIssues} expandedIssues={expandedIssues}
issue={issue} issue={issue}
/> />
); ) : property === "updated_on" ? (
if (property === "updated_on")
return (
<SpreadsheetUpdatedOnColumn <SpreadsheetUpdatedOnColumn
key={`${property}-${issue.id}`} key={`${property}-${issue.id}`}
expandedIssues={expandedIssues} expandedIssues={expandedIssues}
issue={issue} issue={issue}
/> />
); ) : null}
</div>
return null; ))}
})}
</div> </div>
</div> </div>
); );

View File

@ -80,10 +80,12 @@ export const SpreadsheetView: React.FC<Props> = observer((props) => {
}, []); }, []);
return ( return (
<>
<div className="relative flex h-full w-full rounded-lg text-custom-text-200 overflow-x-auto whitespace-nowrap bg-custom-background-200"> <div className="relative flex h-full w-full rounded-lg text-custom-text-200 overflow-x-auto whitespace-nowrap bg-custom-background-200">
<div className="h-full w-full flex flex-col"> <div className="h-full w-full flex flex-col">
<div ref={containerRef} className="flex max-h-full h-full overflow-y-auto"> <div
ref={containerRef}
className="flex max-h-full h-full overflow-y-auto divide-x-[0.5px] divide-custom-border-200"
>
{issues ? ( {issues ? (
<> <>
<div className="sticky left-0 w-[28rem] z-[2]"> <div className="sticky left-0 w-[28rem] z-[2]">
@ -183,6 +185,5 @@ export const SpreadsheetView: React.FC<Props> = observer((props) => {
</div> </div>
</div> </div>
</div> </div>
</>
); );
}); });

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-start-date-column";
export * from "./start-date-column";

View File

@ -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> = (props) => {
const { issue, onChange, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<ViewStartDateSelect issue={issue} onChange={onChange} noBorder disabled={disabled} />
</span>
</div>
);
};

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-state-column";
export * from "./state-column";

View File

@ -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> = (props) => {
const { issue, onChange, states, disabled } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<StateSelect
value={issue.state_detail}
onChange={onChange}
stateGroups={states}
buttonClassName="!shadow-none !border-0"
hideDropdownArrow
disabled={disabled}
/>
</span>
</div>
);
};

View File

@ -1,2 +0,0 @@
export * from "./spreadsheet-updated-on-column";
export * from "./updated-on-column";

View File

@ -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> = (props) => {
const { issue } = props;
return (
<div className="flex items-center text-sm h-11 w-full bg-custom-background-100">
<span className="flex items-center px-4 py-2.5 h-full w-full flex-shrink-0 border-r border-b border-custom-border-100">
<div className="flex items-center text-xs cursor-default text-custom-text-200 text-center p-2 group-hover:bg-custom-background-80 border-custom-border-200">
{renderLongDetailDateFormat(issue.updated_at)}
</div>
</span>
</div>
);
};

View File

@ -39,7 +39,7 @@ export const ViewStartDateSelect: React.FC<Props> = ({
placeholder="Start date" placeholder="Start date"
value={issue?.start_date} value={issue?.start_date}
onChange={onChange} 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} maxDate={maxDate ?? undefined}
noBorder={noBorder} noBorder={noBorder}
handleOnOpen={handleOnOpen} handleOnOpen={handleOnOpen}

View File

@ -9,13 +9,13 @@
} }
[cmdk-item] { [cmdk-item] {
display: flex; /* display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-radius: 0.375rem; border-radius: 0.375rem;
padding: 0.5rem; padding: 0.5rem;
font-size: 0.825rem; font-size: 0.825rem;
line-height: 1.25rem; line-height: 1.25rem; */
cursor: pointer; cursor: pointer;
} }