Skip to content

Commit

Permalink
chore: added copy button for intake issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmycutie committed Aug 28, 2024
1 parent 0cce39e commit 11aeb15
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions web/core/components/inbox/content/inbox-issue-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Link,
Trash2,
MoveRight,
Copy
} from "lucide-react";
import { Button, ControlLink, CustomMenu, TOAST_TYPE, setToast } from "@plane/ui";
// components
Expand Down Expand Up @@ -93,6 +94,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
const currentInboxIssueId = inboxIssue?.issue?.id;

const issueLink = `${workspaceSlug}/projects/${issue?.project_id}/issues/${currentInboxIssueId}`;
const intakeIssueLink = `${workspaceSlug}/projects/${issue?.project_id}/inbox/?currentTab=${currentTab}&inboxIssueId=${currentInboxIssueId}`;

const redirectIssue = (): string | undefined => {
let nextOrPreviousIssueId: string | undefined = undefined;
Expand Down Expand Up @@ -166,6 +168,15 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
})
);

const handleCopyIntakeIssueLink = () =>
copyUrlToClipboard(intakeIssueLink).then(() =>
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Link copied",
message: "Issue link copied to clipboard",
})
);

const currentIssueIndex = filteredInboxIssueIds.findIndex((issueId) => issueId === currentInboxIssueId) ?? 0;

const handleInboxIssueNavigation = useCallback(
Expand Down Expand Up @@ -362,6 +373,12 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
</div>
</CustomMenu.MenuItem>
)}
<CustomMenu.MenuItem onClick={handleCopyIntakeIssueLink}>
<div className="flex items-center gap-2">
<Copy size={14} strokeWidth={2} />
Copy
</div>
</CustomMenu.MenuItem>
</CustomMenu>
)}
</>
Expand Down

0 comments on commit 11aeb15

Please sign in to comment.