forked from github/plane
fix: ui fix (#331)
* fix: project card id removed * feat: my issue page copy issue option
This commit is contained in:
parent
36a733cd06
commit
69e8b504de
@ -20,6 +20,8 @@ import { CustomMenu, Tooltip } from "components/ui";
|
|||||||
import { IIssue, Properties } from "types";
|
import { IIssue, Properties } from "types";
|
||||||
// fetch-keys
|
// fetch-keys
|
||||||
import { USER_ISSUE } from "constants/fetch-keys";
|
import { USER_ISSUE } from "constants/fetch-keys";
|
||||||
|
import { copyTextToClipboard } from "helpers/string.helper";
|
||||||
|
import useToast from "hooks/use-toast";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: IIssue;
|
issue: IIssue;
|
||||||
@ -36,6 +38,7 @@ export const MyIssuesListItem: React.FC<Props> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
const partialUpdateIssue = useCallback(
|
const partialUpdateIssue = useCallback(
|
||||||
(formData: Partial<IIssue>) => {
|
(formData: Partial<IIssue>) => {
|
||||||
@ -64,6 +67,20 @@ export const MyIssuesListItem: React.FC<Props> = ({
|
|||||||
[workspaceSlug, projectId, issue]
|
[workspaceSlug, projectId, issue]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleCopyText = () => {
|
||||||
|
const originURL =
|
||||||
|
typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
|
||||||
|
copyTextToClipboard(
|
||||||
|
`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`
|
||||||
|
).then(() => {
|
||||||
|
setToastAlert({
|
||||||
|
type: "success",
|
||||||
|
title: "Link Copied!",
|
||||||
|
message: "Issue link copied to clipboard.",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const isNotAllowed = false;
|
const isNotAllowed = false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -160,7 +177,8 @@ export const MyIssuesListItem: React.FC<Props> = ({
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
<CustomMenu width="auto" ellipsis>
|
<CustomMenu width="auto" ellipsis>
|
||||||
<CustomMenu.MenuItem onClick={handleDeleteIssue}>Delete permanently</CustomMenu.MenuItem>
|
<CustomMenu.MenuItem onClick={handleDeleteIssue}>Delete issue</CustomMenu.MenuItem>
|
||||||
|
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
</CustomMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,10 +53,9 @@ export const ProjectCard: React.FC<ProjectCardProps> = (props) => {
|
|||||||
{project.icon && (
|
{project.icon && (
|
||||||
<span className="text-base">{String.fromCodePoint(parseInt(project.icon))}</span>
|
<span className="text-base">{String.fromCodePoint(parseInt(project.icon))}</span>
|
||||||
)}
|
)}
|
||||||
<span className=" max-w-[225px] w-[125px] xl:max-w-[225px] text-ellipsis overflow-hidden">
|
<span className=" w-auto max-w-[220px] text-ellipsis whitespace-nowrap overflow-hidden">
|
||||||
{project.name}
|
{project.name}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-500 ">{project.identifier}</span>
|
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user