diff --git a/src/components/misc/subscription.vue b/src/components/misc/subscription.vue index 288d89c2e..85da59418 100644 --- a/src/components/misc/subscription.vue +++ b/src/components/misc/subscription.vue @@ -38,7 +38,9 @@ const props = defineProps({ }, subscription: { required: true, - type: Object as PropType, + validator(value) { + return value instanceof SubscriptionModel || value === null + } }, entityId: { required: true, diff --git a/src/components/tasks/partials/editLabels.vue b/src/components/tasks/partials/editLabels.vue index 63ff0cb13..f2d01934b 100644 --- a/src/components/tasks/partials/editLabels.vue +++ b/src/components/tasks/partials/editLabels.vue @@ -25,13 +25,13 @@ @@ -146,6 +146,18 @@ export default { diff --git a/src/store/modules/tasks.js b/src/store/modules/tasks.js index 8d29cc890..504554c9b 100644 --- a/src/store/modules/tasks.js +++ b/src/store/modules/tasks.js @@ -179,9 +179,18 @@ export default { console.debug('Could not add label to task in kanban, task not found', t) return r } - // FIXME: direct store manipulation (task) - t.task.labels.push(label) - ctx.commit('kanban/setTaskInBucketByIndex', t, { root: true }) + + const labels = [...t.task.labels] + labels.push(label) + + ctx.commit('kanban/setTaskInBucketByIndex', { + task: { + labels, + ...t.task, + }, + ...t, + }, { root: true }) + return r }, @@ -200,15 +209,21 @@ export default { } // Remove the label from the list - for (const l in t.task.labels) { - if (t.task.labels[l].id === label.id) { - // FIXME: direct store manipulation (task) - t.task.labels.splice(l, 1) + const labels = [...t.task.labels] + for (const l in labels) { + if (labels[l].id === label.id) { + labels.splice(l, 1) break } } - ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true}) + ctx.commit('kanban/setTaskInBucketByIndex', { + task: { + labels, + ...t.task, + }, + ...t, + }, {root: true}) return response }, diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index a1e905a60..104632e6e 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -601,6 +601,9 @@ export default { } }, scrollToHeading() { + if(!this.$refs?.heading?.$el) { + return + } this.$refs.heading.$el.scrollIntoView({block: 'center'}) }, setActiveFields() {