Merge pull request #307 from shariquerik/assignment-modal
fix: cannot unassign user
This commit is contained in:
commit
d6435c36e4
@ -9,7 +9,7 @@
|
|||||||
label: __('Cancel'),
|
label: __('Cancel'),
|
||||||
variant: 'subtle',
|
variant: 'subtle',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
assignees = oldAssignees
|
assignees = [...oldAssignees]
|
||||||
show = false
|
show = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -20,6 +20,11 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
}"
|
}"
|
||||||
|
@close="
|
||||||
|
() => {
|
||||||
|
assignees = [...oldAssignees]
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<template #body-content>
|
<template #body-content>
|
||||||
<Link
|
<Link
|
||||||
@ -76,8 +81,7 @@ import UserAvatar from '@/components/UserAvatar.vue'
|
|||||||
import Link from '@/components/Controls/Link.vue'
|
import Link from '@/components/Controls/Link.vue'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { Tooltip, call } from 'frappe-ui'
|
import { Tooltip, call } from 'frappe-ui'
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import { watchOnce } from '@vueuse/core'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
doc: {
|
doc: {
|
||||||
@ -106,7 +110,7 @@ const { getUser } = usersStore()
|
|||||||
|
|
||||||
const removeValue = (value) => {
|
const removeValue = (value) => {
|
||||||
assignees.value = assignees.value.filter(
|
assignees.value = assignees.value.filter(
|
||||||
(assignee) => assignee.name !== value
|
(assignee) => assignee.name !== value,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,13 +139,13 @@ function updateAssignees() {
|
|||||||
}
|
}
|
||||||
const removedAssignees = oldAssignees.value
|
const removedAssignees = oldAssignees.value
|
||||||
.filter(
|
.filter(
|
||||||
(assignee) => !assignees.value.find((a) => a.name === assignee.name)
|
(assignee) => !assignees.value.find((a) => a.name === assignee.name),
|
||||||
)
|
)
|
||||||
.map((assignee) => assignee.name)
|
.map((assignee) => assignee.name)
|
||||||
|
|
||||||
const addedAssignees = assignees.value
|
const addedAssignees = assignees.value
|
||||||
.filter(
|
.filter(
|
||||||
(assignee) => !oldAssignees.value.find((a) => a.name === assignee.name)
|
(assignee) => !oldAssignees.value.find((a) => a.name === assignee.name),
|
||||||
)
|
)
|
||||||
.map((assignee) => assignee.name)
|
.map((assignee) => assignee.name)
|
||||||
|
|
||||||
@ -177,7 +181,7 @@ function updateAssignees() {
|
|||||||
show.value = false
|
show.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
watchOnce(assignees, (value) => {
|
onMounted(() => {
|
||||||
oldAssignees.value = [...value]
|
oldAssignees.value = [...assignees.value]
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user