mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
c7deb00f2a
* fix: calendar mutation fix, chore: calendar type added * feat: calendar view display property added * feat: calendar header, single date and single issue component added, chore: code refactor * chore: partialupdateissue function updated * fix: dropdown overflow fix, style: issue card styling * fix: calendar weekly view row height fix * feat: calendar issue card ellipsis added, fix: edit and delete mutation fix * style: plus icon , add issue button padding and onhover effect fix * style: calendar issue card * style: weekly view height
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
import { useRouter } from "next/router";
|
|
|
|
// ui
|
|
import { CustomDatePicker, Tooltip } from "components/ui";
|
|
// helpers
|
|
import { findHowManyDaysLeft } from "helpers/date-time.helper";
|
|
// services
|
|
import trackEventServices from "services/track-event.service";
|
|
// types
|
|
import { IIssue } from "types";
|
|
|
|
type Props = {
|
|
issue: IIssue;
|
|
partialUpdateIssue: (formData: Partial<IIssue>, issueId: string) => void;
|
|
isNotAllowed: boolean;
|
|
};
|
|
|
|
export const ViewDueDateSelect: React.FC<Props> = ({ issue, partialUpdateIssue, isNotAllowed }) => {
|
|
const router = useRouter();
|
|
const { workspaceSlug } = router.query;
|
|
|
|
return (
|
|
<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="Due date"
|
|
value={issue?.target_date}
|
|
onChange={(val) => {
|
|
partialUpdateIssue(
|
|
{
|
|
target_date: val,
|
|
priority: issue.priority,
|
|
state: issue.state,
|
|
},
|
|
issue.id
|
|
);
|
|
trackEventServices.trackIssuePartialPropertyUpdateEvent(
|
|
{
|
|
workspaceSlug,
|
|
workspaceId: issue.workspace,
|
|
projectId: issue.project_detail.id,
|
|
projectIdentifier: issue.project_detail.identifier,
|
|
projectName: issue.project_detail.name,
|
|
issueId: issue.id,
|
|
},
|
|
"ISSUE_PROPERTY_UPDATE_DUE_DATE"
|
|
);
|
|
}}
|
|
className={issue?.target_date ? "w-[6.5rem]" : "w-[5rem] text-center"}
|
|
disabled={isNotAllowed}
|
|
/>
|
|
</div>
|
|
</Tooltip>
|
|
);
|
|
};
|