mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
928ebdf632
* refactor: issues filter logic * fix: removed fetch logic from hooks * feat: filter by assignee and label * chore: remove filter buttons * feat: filter options * fix: mutation for issue update on both kanban & list --------- Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
// ui
|
|
import { CustomDatePicker, Tooltip } from "components/ui";
|
|
// helpers
|
|
import { findHowManyDaysLeft } from "helpers/date-time.helper";
|
|
// types
|
|
import { IIssue } from "types";
|
|
|
|
type Props = {
|
|
issue: IIssue;
|
|
partialUpdateIssue: (formData: Partial<IIssue>) => void;
|
|
isNotAllowed: boolean;
|
|
};
|
|
|
|
export const ViewDueDateSelect: React.FC<Props> = ({ issue, partialUpdateIssue, isNotAllowed }) => (
|
|
<Tooltip tooltipHeading="Due Date" tooltipContent={issue.target_date ?? "N/A"}>
|
|
<div
|
|
className={`group relative ${
|
|
issue.target_date === null
|
|
? ""
|
|
: issue.target_date < new Date().toISOString()
|
|
? "text-red-600"
|
|
: findHowManyDaysLeft(issue.target_date) <= 3 && "text-orange-400"
|
|
}`}
|
|
>
|
|
<CustomDatePicker
|
|
placeholder="N/A"
|
|
value={issue?.target_date}
|
|
onChange={(val) =>
|
|
partialUpdateIssue({
|
|
target_date: val,
|
|
priority: issue.priority,
|
|
state: issue.state,
|
|
})
|
|
}
|
|
className={issue?.target_date ? "w-[6.5rem]" : "w-[3rem] text-center"}
|
|
disabled={isNotAllowed}
|
|
/>
|
|
</div>
|
|
</Tooltip>
|
|
);
|