Skip to content

Commit

Permalink
Merge branch 'main' into refactor/implement-different-implementations…
Browse files Browse the repository at this point in the history
…-for-server-versions

# Conflicts:
#	electron/providers/jira-server-provider/JiraServerProvider.ts
#	electron/providers/jira-server-provider/server-types.ts
  • Loading branch information
maximilianruesch committed Dec 5, 2023
2 parents d1f7efc + 72d9a35 commit 5c385da
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function CreateSprintModal({
message: `The sprint has been created!`,
color: "green",
})
queryClient.invalidateQueries({ queryKey: ["sprints"] })
queryClient.invalidateQueries({ queryKey: ["issues", "sprints"] })
setOpened(false)
form.reset()
Expand Down
20 changes: 16 additions & 4 deletions src/components/BacklogView/Issue/DeleteButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActionIcon, Transition, Popover, Box } from "@mantine/core"
import { IconTrash } from "@tabler/icons"
import { useEffect, useState } from "react"
import { useHover } from "@mantine/hooks";
import { DeleteIssueAlert } from "../../DetailView/Components/DeleteIssue/DeleteIssueAlert"

export function DeleteButton({
Expand All @@ -11,15 +12,16 @@ export function DeleteButton({
issueKey: string
}) {
const [issuePopoverOpened, setIssuePopoverOpened] = useState(false)
const { ref, hovered } = useHover()

useEffect(() => {
if (!mounted) {
if (!mounted && !hovered) {
setIssuePopoverOpened(false)
}
}, [mounted])
}, [mounted, hovered])

return (
<Box sx={{ position: "absolute", bottom: 5, right: 11 }}>
<Box ref={ref} sx={{ position: "absolute", bottom: 5, right: 11 }}>
<Transition
mounted={mounted}
transition="fade"
Expand All @@ -41,7 +43,10 @@ export function DeleteButton({
size="sm"
variant="transparent"
style={styles}
onClick={() => setIssuePopoverOpened(!issuePopoverOpened)}
onClick={(e) => {
e.stopPropagation()
setIssuePopoverOpened(!issuePopoverOpened)
}}
>
<IconTrash />
</ActionIcon>
Expand All @@ -54,6 +59,13 @@ export function DeleteButton({
: theme.white,
})}
>
<div style={{
height: "20px",
position: "absolute",
width: "inherit",
left: "0px",
top: "-10px",
}} />
<DeleteIssueAlert
issueKey={issueKey}
closeModal={() => setIssuePopoverOpened(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export function DeleteIssueAlert({
If you delete this issue, all related subtasks will be deleted as well!
</Alert>
<Button
onClick={() => {
closeModal()
onClick={(e) => {
e.stopPropagation()
deleteIssue.mutate(issueKey)
closeModal()
}}
>
Confirm
Expand Down

0 comments on commit 5c385da

Please sign in to comment.