fix: Add debounce to update due date
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
backportbot-nextcloud[bot]
parent
ee0b6bfea9
commit
ec11bf0468
@@ -37,7 +37,8 @@
|
|||||||
|
|
||||||
<DueDateSelector :card="card"
|
<DueDateSelector :card="card"
|
||||||
:can-edit="canEdit"
|
:can-edit="canEdit"
|
||||||
@change="updateCardDue" />
|
@change="updateCardDue"
|
||||||
|
@input="debouncedUpdateCardDue" />
|
||||||
|
|
||||||
<div v-if="projectsEnabled" class="section-wrapper">
|
<div v-if="projectsEnabled" class="section-wrapper">
|
||||||
<CollectionList v-if="card.id"
|
<CollectionList v-if="card.id"
|
||||||
@@ -68,6 +69,7 @@ import Description from './Description.vue'
|
|||||||
import TagSelector from './TagSelector.vue'
|
import TagSelector from './TagSelector.vue'
|
||||||
import AssignmentSelector from './AssignmentSelector.vue'
|
import AssignmentSelector from './AssignmentSelector.vue'
|
||||||
import DueDateSelector from './DueDateSelector.vue'
|
import DueDateSelector from './DueDateSelector.vue'
|
||||||
|
import { debounce } from 'lodash'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CardSidebarTabDetails',
|
name: 'CardSidebarTabDetails',
|
||||||
@@ -162,6 +164,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
debouncedUpdateCardDue: debounce(function(val) {
|
||||||
|
this.updateCardDue(val)
|
||||||
|
}, 500),
|
||||||
|
|
||||||
addLabelToCard(newLabel) {
|
addLabelToCard(newLabel) {
|
||||||
this.copiedCard.labels.push(newLabel)
|
this.copiedCard.labels.push(newLabel)
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export default defineComponent({
|
|||||||
return this.card?.duedate ? new Date(this.card.duedate) : null
|
return this.card?.duedate ? new Date(this.card.duedate) : null
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.$emit('change', val ? new Date(val) : null)
|
this.$emit('input', val ? new Date(val) : null)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -216,9 +216,12 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
removeDue() {
|
removeDue() {
|
||||||
this.duedate = null
|
this.duedate = null
|
||||||
|
this.$emit('change', null)
|
||||||
|
|
||||||
},
|
},
|
||||||
selectShortcut(shortcut) {
|
selectShortcut(shortcut) {
|
||||||
this.duedate = shortcut.timestamp
|
this.duedate = shortcut.timestamp
|
||||||
|
this.$emit('change', shortcut.timestamp)
|
||||||
},
|
},
|
||||||
getTimestamp(momentObject) {
|
getTimestamp(momentObject) {
|
||||||
return momentObject?.minute(0).second(0).millisecond(0).toDate() || null
|
return momentObject?.minute(0).second(0).millisecond(0).toDate() || null
|
||||||
|
|||||||
@@ -64,7 +64,10 @@
|
|||||||
@select="onSelectUser"
|
@select="onSelectUser"
|
||||||
@remove="onRemoveUser" />
|
@remove="onRemoveUser" />
|
||||||
|
|
||||||
<DueDateSelector :card="card" :can-edit="!loading && !!selectedBoard" @change="updateCardDue" />
|
<DueDateSelector :card="card"
|
||||||
|
:can-edit="!loading && !!selectedBoard"
|
||||||
|
@change="updateCardDue"
|
||||||
|
@input="updateCardDue" />
|
||||||
|
|
||||||
<Description :key="card.id"
|
<Description :key="card.id"
|
||||||
:card="card"
|
:card="card"
|
||||||
|
|||||||
Reference in New Issue
Block a user