mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
feat: attachment and link display properties (#796)
* feat: attachment and link count added * fix: build fix
This commit is contained in:
parent
032ef831b2
commit
f2e8add29d
@ -26,7 +26,7 @@ import {
|
|||||||
ViewStateSelect,
|
ViewStateSelect,
|
||||||
} from "components/issues";
|
} from "components/issues";
|
||||||
// ui
|
// ui
|
||||||
import { ContextMenu, CustomMenu } from "components/ui";
|
import { ContextMenu, CustomMenu, Tooltip } from "components/ui";
|
||||||
// icons
|
// icons
|
||||||
import {
|
import {
|
||||||
ClipboardDocumentCheckIcon,
|
ClipboardDocumentCheckIcon,
|
||||||
@ -35,6 +35,7 @@ import {
|
|||||||
TrashIcon,
|
TrashIcon,
|
||||||
XMarkIcon,
|
XMarkIcon,
|
||||||
ArrowTopRightOnSquareIcon,
|
ArrowTopRightOnSquareIcon,
|
||||||
|
PaperClipIcon,
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
// helpers
|
// helpers
|
||||||
import { handleIssuesMutation } from "constants/issue";
|
import { handleIssuesMutation } from "constants/issue";
|
||||||
@ -354,6 +355,26 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
selfPositioned
|
selfPositioned
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{properties.link && (
|
||||||
|
<div className="flex items-center rounded-md shadow-sm px-2.5 py-1 cursor-default text-xs border border-gray-200">
|
||||||
|
<Tooltip tooltipHeading="Link" tooltipContent={`${issue.link_count}`}>
|
||||||
|
<div className="flex items-center gap-1 text-gray-500">
|
||||||
|
<LinkIcon className="h-3.5 w-3.5 text-gray-500" />
|
||||||
|
{issue.link_count}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{properties.attachment_count && (
|
||||||
|
<div className="flex items-center rounded-md shadow-sm px-2.5 py-1 cursor-default text-xs border border-gray-200">
|
||||||
|
<Tooltip tooltipHeading="Attachment" tooltipContent={`${issue.attachment_count}`}>
|
||||||
|
<div className="flex items-center gap-1 text-gray-500">
|
||||||
|
<PaperClipIcon className="h-3.5 w-3.5 text-gray-500 -rotate-45" />
|
||||||
|
{issue.attachment_count}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,6 +29,7 @@ import {
|
|||||||
TrashIcon,
|
TrashIcon,
|
||||||
XMarkIcon,
|
XMarkIcon,
|
||||||
ArrowTopRightOnSquareIcon,
|
ArrowTopRightOnSquareIcon,
|
||||||
|
PaperClipIcon
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
// helpers
|
// helpers
|
||||||
import { copyTextToClipboard, truncateText } from "helpers/string.helper";
|
import { copyTextToClipboard, truncateText } from "helpers/string.helper";
|
||||||
@ -282,6 +283,26 @@ export const SingleListIssue: React.FC<Props> = ({
|
|||||||
isNotAllowed={isNotAllowed}
|
isNotAllowed={isNotAllowed}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{properties.link && (
|
||||||
|
<div className="flex items-center rounded-md shadow-sm px-2.5 py-1 cursor-default text-xs border border-gray-200">
|
||||||
|
<Tooltip tooltipHeading="Link" tooltipContent={`${issue.link_count}`}>
|
||||||
|
<div className="flex items-center gap-1 text-gray-500">
|
||||||
|
<LinkIcon className="h-3.5 w-3.5 text-gray-500" />
|
||||||
|
{issue.link_count}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{properties.attachment_count && (
|
||||||
|
<div className="flex items-center rounded-md shadow-sm px-2.5 py-1 cursor-default text-xs border border-gray-200">
|
||||||
|
<Tooltip tooltipHeading="Attachment" tooltipContent={`${issue.attachment_count}`}>
|
||||||
|
<div className="flex items-center gap-1 text-gray-500">
|
||||||
|
<PaperClipIcon className="h-3.5 w-3.5 text-gray-500 -rotate-45" />
|
||||||
|
{issue.attachment_count}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{type && !isNotAllowed && (
|
{type && !isNotAllowed && (
|
||||||
<CustomMenu width="auto" ellipsis>
|
<CustomMenu width="auto" ellipsis>
|
||||||
<CustomMenu.MenuItem onClick={editIssue}>
|
<CustomMenu.MenuItem onClick={editIssue}>
|
||||||
|
@ -15,6 +15,8 @@ const initialValues: Properties = {
|
|||||||
priority: false,
|
priority: false,
|
||||||
state: true,
|
state: true,
|
||||||
sub_issue_count: false,
|
sub_issue_count: false,
|
||||||
|
attachment_count: false,
|
||||||
|
link: false,
|
||||||
estimate: false,
|
estimate: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -91,6 +93,8 @@ const useIssuesProperties = (workspaceSlug?: string, projectId?: string) => {
|
|||||||
priority: properties.priority,
|
priority: properties.priority,
|
||||||
state: properties.state,
|
state: properties.state,
|
||||||
sub_issue_count: properties.sub_issue_count,
|
sub_issue_count: properties.sub_issue_count,
|
||||||
|
attachment_count: properties.attachment_count,
|
||||||
|
link: properties.link,
|
||||||
estimate: properties.estimate,
|
estimate: properties.estimate,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ const initialValues: Properties = {
|
|||||||
priority: false,
|
priority: false,
|
||||||
state: true,
|
state: true,
|
||||||
sub_issue_count: false,
|
sub_issue_count: false,
|
||||||
|
attachment_count: false,
|
||||||
|
link: false,
|
||||||
estimate: false,
|
estimate: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
4
apps/app/types/issues.d.ts
vendored
4
apps/app/types/issues.d.ts
vendored
@ -67,6 +67,7 @@ export interface IIssue {
|
|||||||
assignees: string[];
|
assignees: string[];
|
||||||
assignee_details: IUser[];
|
assignee_details: IUser[];
|
||||||
assignees_list: string[];
|
assignees_list: string[];
|
||||||
|
attachment_count: number;
|
||||||
attachments: any[];
|
attachments: any[];
|
||||||
blocked_by_issue_details: any[];
|
blocked_by_issue_details: any[];
|
||||||
blocked_issue_details: any[];
|
blocked_issue_details: any[];
|
||||||
@ -101,6 +102,7 @@ export interface IIssue {
|
|||||||
issue_module: IIssueModule | null;
|
issue_module: IIssueModule | null;
|
||||||
label_details: any[];
|
label_details: any[];
|
||||||
links_list: IIssueLink[];
|
links_list: IIssueLink[];
|
||||||
|
link_count: number;
|
||||||
module: string | null;
|
module: string | null;
|
||||||
module_id: string | null;
|
module_id: string | null;
|
||||||
name: string;
|
name: string;
|
||||||
@ -186,6 +188,8 @@ export type Properties = {
|
|||||||
priority: boolean;
|
priority: boolean;
|
||||||
state: boolean;
|
state: boolean;
|
||||||
sub_issue_count: boolean;
|
sub_issue_count: boolean;
|
||||||
|
link: boolean;
|
||||||
|
attachment_count: boolean;
|
||||||
estimate: boolean;
|
estimate: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user