mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
copy filters functionality
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
|||||||
Clock as PixelClock,
|
Clock as PixelClock,
|
||||||
Close as PixelClose,
|
Close as PixelClose,
|
||||||
MessagePlus as PixelCommentSend,
|
MessagePlus as PixelCommentSend,
|
||||||
|
Copy as PixelCopy,
|
||||||
CreditCard as PixelCreditCard,
|
CreditCard as PixelCreditCard,
|
||||||
CreditCardDelete as PixelCreditCardDelete,
|
CreditCardDelete as PixelCreditCardDelete,
|
||||||
Dashboard as PixelDashboard,
|
Dashboard as PixelDashboard,
|
||||||
@@ -53,6 +54,7 @@ import {
|
|||||||
CaretUpIcon as PhosphorChevronUp,
|
CaretUpIcon as PhosphorChevronUp,
|
||||||
CircleIcon as PhosphorCircle,
|
CircleIcon as PhosphorCircle,
|
||||||
ChatTextIcon as PhosphorComment,
|
ChatTextIcon as PhosphorComment,
|
||||||
|
CopyIcon as PhosphorCopy,
|
||||||
CreditCardIcon as PhosphorCreditCard,
|
CreditCardIcon as PhosphorCreditCard,
|
||||||
CubeIcon as PhosphorCube,
|
CubeIcon as PhosphorCube,
|
||||||
DotsSixVerticalIcon as PhosphorDotsSixVertical,
|
DotsSixVerticalIcon as PhosphorDotsSixVertical,
|
||||||
@@ -102,6 +104,7 @@ import {
|
|||||||
CircleCheckIcon,
|
CircleCheckIcon,
|
||||||
CircleIcon,
|
CircleIcon,
|
||||||
CircleQuestionMark,
|
CircleQuestionMark,
|
||||||
|
Copy,
|
||||||
CreditCard,
|
CreditCard,
|
||||||
Edit,
|
Edit,
|
||||||
EllipsisVertical,
|
EllipsisVertical,
|
||||||
@@ -161,6 +164,7 @@ const icons = {
|
|||||||
circleIcon: { lucide: CircleIcon, pixel: PixelCircle, phosphor: PhosphorCircle },
|
circleIcon: { lucide: CircleIcon, pixel: PixelCircle, phosphor: PhosphorCircle },
|
||||||
circleQuestionMark: { lucide: CircleQuestionMark, pixel: PixelNoteDelete, phosphor: PhosphorQuestion },
|
circleQuestionMark: { lucide: CircleQuestionMark, pixel: PixelNoteDelete, phosphor: PhosphorQuestion },
|
||||||
comment: { lucide: MessageSquarePlus, pixel: PixelCommentSend, phosphor: PhosphorComment },
|
comment: { lucide: MessageSquarePlus, pixel: PixelCommentSend, phosphor: PhosphorComment },
|
||||||
|
copy: { lucide: Copy, pixel: PixelCopy, phosphor: PhosphorCopy },
|
||||||
creditCard: { lucide: CreditCard, pixel: PixelCreditCard, phosphor: PhosphorCreditCard },
|
creditCard: { lucide: CreditCard, pixel: PixelCreditCard, phosphor: PhosphorCreditCard },
|
||||||
creditCardDelete: { lucide: CreditCard, pixel: PixelCreditCardDelete, phosphor: PhosphorCreditCard },
|
creditCardDelete: { lucide: CreditCard, pixel: PixelCreditCardDelete, phosphor: PhosphorCreditCard },
|
||||||
edit: { lucide: Edit, pixel: PixelEdit, phosphor: PhosphorEdit },
|
edit: { lucide: Edit, pixel: PixelEdit, phosphor: PhosphorEdit },
|
||||||
|
|||||||
@@ -555,6 +555,64 @@ export default function Issues() {
|
|||||||
>
|
>
|
||||||
<Icon icon="undo" />
|
<Icon icon="undo" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
variant="outline"
|
||||||
|
className="w-9 h-9"
|
||||||
|
aria-label="Copy filters URL"
|
||||||
|
title="Copy filters URL"
|
||||||
|
disabled={
|
||||||
|
!issueFilters.query &&
|
||||||
|
issueFilters.statuses.length === 0 &&
|
||||||
|
issueFilters.types.length === 0 &&
|
||||||
|
issueFilters.assignees.length === 0 &&
|
||||||
|
issueFilters.sprintId === defaultIssuesTableFilters.sprintId &&
|
||||||
|
issueFilters.sort === defaultIssuesTableFilters.sort
|
||||||
|
}
|
||||||
|
onClick={() => {
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
if (issueFilters.query) {
|
||||||
|
params.set("q", issueFilters.query);
|
||||||
|
} else {
|
||||||
|
params.delete("q");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issueFilters.statuses.length > 0) {
|
||||||
|
params.set("status", issueFilters.statuses.join(","));
|
||||||
|
} else {
|
||||||
|
params.delete("status");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issueFilters.types.length > 0) {
|
||||||
|
params.set("type", issueFilters.types.join(","));
|
||||||
|
} else {
|
||||||
|
params.delete("type");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issueFilters.assignees.length > 0) {
|
||||||
|
params.set("assignee", issueFilters.assignees.join(","));
|
||||||
|
} else {
|
||||||
|
params.delete("assignee");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issueFilters.sprintId !== defaultIssuesTableFilters.sprintId) {
|
||||||
|
params.set("sprint", String(issueFilters.sprintId));
|
||||||
|
} else {
|
||||||
|
params.delete("sprint");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issueFilters.sort !== defaultIssuesTableFilters.sort) {
|
||||||
|
params.set("sort", issueFilters.sort);
|
||||||
|
} else {
|
||||||
|
params.delete("sort");
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = `${window.location.origin}${window.location.pathname}?${params.toString()}`;
|
||||||
|
navigator.clipboard.writeText(url);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon="copy" />
|
||||||
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user