mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
disable peek overview for temporary issues until it is confirmed (#3749)
This commit is contained in:
parent
d73cd2ec9d
commit
62607ade6f
@ -5,10 +5,11 @@ export type TControlLink = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
target?: string;
|
target?: string;
|
||||||
|
disabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ControlLink: React.FC<TControlLink> = (props) => {
|
export const ControlLink: React.FC<TControlLink> = (props) => {
|
||||||
const { href, onClick, children, target = "_self", ...rest } = props;
|
const { href, onClick, children, target = "_self", disabled = false, ...rest } = props;
|
||||||
const LEFT_CLICK_EVENT_CODE = 0;
|
const LEFT_CLICK_EVENT_CODE = 0;
|
||||||
|
|
||||||
const _onClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
const _onClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
||||||
@ -19,6 +20,8 @@ export const ControlLink: React.FC<TControlLink> = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (disabled) return <>{children}</>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a href={href} target={target} onClick={_onClick} {...rest}>
|
<a href={href} target={target} onClick={_onClick} {...rest}>
|
||||||
{children}
|
{children}
|
||||||
|
@ -79,6 +79,7 @@ export const CalendarIssueBlocks: React.FC<Props> = observer((props) => {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
onClick={() => handleIssuePeekOverview(issue)}
|
onClick={() => handleIssuePeekOverview(issue)}
|
||||||
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
||||||
|
disabled={!!issue?.tempId}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
{issue?.tempId !== undefined && (
|
{issue?.tempId !== undefined && (
|
||||||
|
@ -29,6 +29,7 @@ export const IssueGanttBlock: React.FC<Props> = observer((props) => {
|
|||||||
const handleIssuePeekOverview = () =>
|
const handleIssuePeekOverview = () =>
|
||||||
workspaceSlug &&
|
workspaceSlug &&
|
||||||
issueDetails &&
|
issueDetails &&
|
||||||
|
!issueDetails.tempId &&
|
||||||
setPeekIssue({ workspaceSlug, projectId: issueDetails.project_id, issueId: issueDetails.id });
|
setPeekIssue({ workspaceSlug, projectId: issueDetails.project_id, issueId: issueDetails.id });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -89,8 +90,9 @@ export const IssueGanttSidebarBlock: React.FC<Props> = observer((props) => {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
onClick={handleIssuePeekOverview}
|
onClick={handleIssuePeekOverview}
|
||||||
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
||||||
|
disabled={!!issueDetails?.tempId}
|
||||||
>
|
>
|
||||||
<div className="relative flex h-full w-full cursor-pointer items-center gap-2" onClick={handleIssuePeekOverview}>
|
<div className="relative flex h-full w-full cursor-pointer items-center gap-2">
|
||||||
{stateDetails && <StateGroupIcon stateGroup={stateDetails?.group} color={stateDetails?.color} />}
|
{stateDetails && <StateGroupIcon stateGroup={stateDetails?.group} color={stateDetails?.color} />}
|
||||||
<div className="flex-shrink-0 text-xs text-custom-text-300">
|
<div className="flex-shrink-0 text-xs text-custom-text-300">
|
||||||
{projectDetails?.identifier} {issueDetails?.sequence_id}
|
{projectDetails?.identifier} {issueDetails?.sequence_id}
|
||||||
|
@ -82,6 +82,7 @@ const KanbanIssueDetailsBlock: React.FC<IssueDetailsBlockProps> = observer((prop
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
onClick={() => handleIssuePeekOverview(issue)}
|
onClick={() => handleIssuePeekOverview(issue)}
|
||||||
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
||||||
|
disabled={!!issue?.tempId}
|
||||||
>
|
>
|
||||||
<Tooltip tooltipHeading="Title" tooltipContent={issue.name}>
|
<Tooltip tooltipHeading="Title" tooltipContent={issue.name}>
|
||||||
<span>{issue.name}</span>
|
<span>{issue.name}</span>
|
||||||
|
@ -76,6 +76,7 @@ export const IssueBlock: React.FC<IssueBlockProps> = observer((props: IssueBlock
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
onClick={() => handleIssuePeekOverview(issue)}
|
onClick={() => handleIssuePeekOverview(issue)}
|
||||||
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
||||||
|
disabled={!!issue?.tempId}
|
||||||
>
|
>
|
||||||
<Tooltip tooltipHeading="Title" tooltipContent={issue.name}>
|
<Tooltip tooltipHeading="Title" tooltipContent={issue.name}>
|
||||||
<span>{issue.name}</span>
|
<span>{issue.name}</span>
|
||||||
|
@ -239,6 +239,7 @@ const IssueRowDetails = observer((props: IssueRowDetailsProps) => {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
onClick={() => handleIssuePeekOverview(issueDetail)}
|
onClick={() => handleIssuePeekOverview(issueDetail)}
|
||||||
className="clickable w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
className="clickable w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100"
|
||||||
|
disabled={!!issueDetail?.tempId}
|
||||||
>
|
>
|
||||||
<div className="w-full overflow-hidden">
|
<div className="w-full overflow-hidden">
|
||||||
<Tooltip tooltipHeading="Title" tooltipContent={issueDetail.name}>
|
<Tooltip tooltipHeading="Title" tooltipContent={issueDetail.name}>
|
||||||
|
Loading…
Reference in New Issue
Block a user