mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: created by added to sidebar and peek view
This commit is contained in:
parent
15dfcc597e
commit
988f9aec0e
@ -14,6 +14,7 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
Trash2,
|
Trash2,
|
||||||
Triangle,
|
Triangle,
|
||||||
|
UserCircle2,
|
||||||
Users,
|
Users,
|
||||||
XCircle,
|
XCircle,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
@ -38,6 +39,7 @@ import {
|
|||||||
} from "@/components/dropdowns";
|
} from "@/components/dropdowns";
|
||||||
// ui
|
// ui
|
||||||
// helpers
|
// helpers
|
||||||
|
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
|
||||||
import {
|
import {
|
||||||
ArchiveIssueModal,
|
ArchiveIssueModal,
|
||||||
DeleteIssueModal,
|
DeleteIssueModal,
|
||||||
@ -56,7 +58,7 @@ import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper"
|
|||||||
import { shouldHighlightIssueDueDate } from "@/helpers/issue.helper";
|
import { shouldHighlightIssueDueDate } from "@/helpers/issue.helper";
|
||||||
import { copyTextToClipboard } from "@/helpers/string.helper";
|
import { copyTextToClipboard } from "@/helpers/string.helper";
|
||||||
// types
|
// types
|
||||||
import { useProjectEstimates, useIssueDetail, useProject, useProjectState, useUser } from "@/hooks/store";
|
import { useProjectEstimates, useIssueDetail, useProject, useProjectState, useUser, useMember } from "@/hooks/store";
|
||||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||||
// components
|
// components
|
||||||
import type { TIssueOperations } from "./root";
|
import type { TIssueOperations } from "./root";
|
||||||
@ -88,11 +90,14 @@ export const IssueDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
const {
|
const {
|
||||||
issue: { getIssueById },
|
issue: { getIssueById },
|
||||||
} = useIssueDetail();
|
} = useIssueDetail();
|
||||||
|
const { getUserDetails } = useMember();
|
||||||
const { getStateById } = useProjectState();
|
const { getStateById } = useProjectState();
|
||||||
const { isMobile } = usePlatformOS();
|
const { isMobile } = usePlatformOS();
|
||||||
const issue = getIssueById(issueId);
|
const issue = getIssueById(issueId);
|
||||||
if (!issue) return <></>;
|
if (!issue) return <></>;
|
||||||
|
|
||||||
|
const createdByDetails = getUserDetails(issue.created_by);
|
||||||
|
|
||||||
const handleCopyText = () => {
|
const handleCopyText = () => {
|
||||||
const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
||||||
copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`).then(() => {
|
copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`).then(() => {
|
||||||
@ -258,6 +263,21 @@ export const IssueDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{createdByDetails && (
|
||||||
|
<div className="flex h-8 items-center gap-2">
|
||||||
|
<div className="flex w-2/5 flex-shrink-0 items-center gap-1 text-sm text-custom-text-300">
|
||||||
|
<UserCircle2 className="h-4 w-4 flex-shrink-0" />
|
||||||
|
<span>Created by</span>
|
||||||
|
</div>
|
||||||
|
<Tooltip tooltipContent={createdByDetails?.display_name} isMobile={isMobile}>
|
||||||
|
<div className="h-full flex items-center gap-1.5 rounded px-2 py-0.5 text-sm justify-between cursor-default">
|
||||||
|
<ButtonAvatars showTooltip={false} userIds={createdByDetails.id} />
|
||||||
|
<span className="flex-grow truncate text-xs leading-5">{createdByDetails?.display_name}</span>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="flex h-8 items-center gap-2">
|
<div className="flex h-8 items-center gap-2">
|
||||||
<div className="flex w-2/5 flex-shrink-0 items-center gap-1 text-sm text-custom-text-300">
|
<div className="flex w-2/5 flex-shrink-0 items-center gap-1 text-sm text-custom-text-300">
|
||||||
<CalendarClock className="h-4 w-4 flex-shrink-0" />
|
<CalendarClock className="h-4 w-4 flex-shrink-0" />
|
||||||
|
@ -13,10 +13,11 @@ import {
|
|||||||
CalendarClock,
|
CalendarClock,
|
||||||
CalendarCheck2,
|
CalendarCheck2,
|
||||||
Users,
|
Users,
|
||||||
|
UserCircle2,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
// ui icons
|
// ui icons
|
||||||
import { DiceIcon, DoubleCircleIcon, ContrastIcon, RelatedIcon } from "@plane/ui";
|
import { DiceIcon, DoubleCircleIcon, ContrastIcon, RelatedIcon, Tooltip } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import {
|
import {
|
||||||
DateDropdown,
|
DateDropdown,
|
||||||
@ -25,6 +26,7 @@ import {
|
|||||||
MemberDropdown,
|
MemberDropdown,
|
||||||
StateDropdown,
|
StateDropdown,
|
||||||
} from "@/components/dropdowns";
|
} from "@/components/dropdowns";
|
||||||
|
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
|
||||||
import {
|
import {
|
||||||
IssueLinkRoot,
|
IssueLinkRoot,
|
||||||
IssueCycleSelect,
|
IssueCycleSelect,
|
||||||
@ -38,7 +40,8 @@ import {
|
|||||||
import { cn } from "@/helpers/common.helper";
|
import { cn } from "@/helpers/common.helper";
|
||||||
import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper";
|
import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper";
|
||||||
import { shouldHighlightIssueDueDate } from "@/helpers/issue.helper";
|
import { shouldHighlightIssueDueDate } from "@/helpers/issue.helper";
|
||||||
import { useIssueDetail, useProject, useProjectState } from "@/hooks/store";
|
import { useIssueDetail, useMember, useProject, useProjectState } from "@/hooks/store";
|
||||||
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||||
|
|
||||||
interface IPeekOverviewProperties {
|
interface IPeekOverviewProperties {
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
@ -56,9 +59,12 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = observer((pro
|
|||||||
issue: { getIssueById },
|
issue: { getIssueById },
|
||||||
} = useIssueDetail();
|
} = useIssueDetail();
|
||||||
const { getStateById } = useProjectState();
|
const { getStateById } = useProjectState();
|
||||||
|
const { getUserDetails } = useMember();
|
||||||
|
const { isMobile } = usePlatformOS();
|
||||||
// derived values
|
// derived values
|
||||||
const issue = getIssueById(issueId);
|
const issue = getIssueById(issueId);
|
||||||
if (!issue) return <></>;
|
if (!issue) return <></>;
|
||||||
|
const createdByDetails = getUserDetails(issue?.created_by);
|
||||||
const projectDetails = getProjectById(issue.project_id);
|
const projectDetails = getProjectById(issue.project_id);
|
||||||
const isEstimateEnabled = projectDetails?.estimate;
|
const isEstimateEnabled = projectDetails?.estimate;
|
||||||
const stateDetails = getStateById(issue.state_id);
|
const stateDetails = getStateById(issue.state_id);
|
||||||
@ -134,6 +140,22 @@ export const PeekOverviewProperties: FC<IPeekOverviewProperties> = observer((pro
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* created by */}
|
||||||
|
{createdByDetails && (
|
||||||
|
<div className="flex w-full items-center gap-3 h-8">
|
||||||
|
<div className="flex items-center gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
|
||||||
|
<UserCircle2 className="h-4 w-4 flex-shrink-0" />
|
||||||
|
<span>Created by</span>
|
||||||
|
</div>
|
||||||
|
<Tooltip tooltipContent={createdByDetails?.display_name} isMobile={isMobile}>
|
||||||
|
<div className="h-full flex items-center gap-1.5 rounded px-2 py-0.5 text-sm justify-between cursor-default">
|
||||||
|
<ButtonAvatars showTooltip={false} userIds={createdByDetails?.id} />
|
||||||
|
<span className="flex-grow truncate text-xs leading-5">{createdByDetails?.display_name}</span>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* start date */}
|
{/* start date */}
|
||||||
<div className="flex w-full items-center gap-3 h-8">
|
<div className="flex w-full items-center gap-3 h-8">
|
||||||
<div className="flex items-center gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
|
<div className="flex items-center gap-1 w-1/4 flex-shrink-0 text-sm text-custom-text-300">
|
||||||
|
Loading…
Reference in New Issue
Block a user