From 69e8b504de8c987682fcaf77ed5cad772a55cbfe Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 23 Feb 2023 18:12:43 +0530 Subject: [PATCH] fix: ui fix (#331) * fix: project card id removed * feat: my issue page copy issue option --- .../components/issues/my-issues-list-item.tsx | 20 ++++++++++++++++++- apps/app/components/project/card.tsx | 3 +-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/app/components/issues/my-issues-list-item.tsx b/apps/app/components/issues/my-issues-list-item.tsx index 8e81c40ea..63a8ad5e8 100644 --- a/apps/app/components/issues/my-issues-list-item.tsx +++ b/apps/app/components/issues/my-issues-list-item.tsx @@ -20,6 +20,8 @@ import { CustomMenu, Tooltip } from "components/ui"; import { IIssue, Properties } from "types"; // fetch-keys import { USER_ISSUE } from "constants/fetch-keys"; +import { copyTextToClipboard } from "helpers/string.helper"; +import useToast from "hooks/use-toast"; type Props = { issue: IIssue; @@ -36,6 +38,7 @@ export const MyIssuesListItem: React.FC = ({ }) => { const router = useRouter(); const { workspaceSlug } = router.query; + const { setToastAlert } = useToast(); const partialUpdateIssue = useCallback( (formData: Partial) => { @@ -64,6 +67,20 @@ export const MyIssuesListItem: React.FC = ({ [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; return ( @@ -160,7 +177,8 @@ export const MyIssuesListItem: React.FC = ({ )} - Delete permanently + Delete issue + Copy issue link diff --git a/apps/app/components/project/card.tsx b/apps/app/components/project/card.tsx index 656f1d10b..8100379d4 100644 --- a/apps/app/components/project/card.tsx +++ b/apps/app/components/project/card.tsx @@ -53,10 +53,9 @@ export const ProjectCard: React.FC = (props) => { {project.icon && ( {String.fromCodePoint(parseInt(project.icon))} )} - + {project.name} - {project.identifier}