From 1818ed364899d1b1d46a6235804f4c580ac03eba Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 18 Jan 2022 22:00:13 +0100 Subject: [PATCH 1/4] fix: scrolling to heading if it wasn't available --- src/views/tasks/TaskDetailView.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 0a7edf965..40de50dea 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -595,6 +595,9 @@ export default { } }, scrollToHeading() { + if(!this.$refs?.heading?.$el) { + return + } this.$refs.heading.$el.scrollIntoView({block: 'center'}) }, setActiveFields() { From ff9e1b3fcad02fad290c1b663d33e640f85a8a8c Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 18 Jan 2022 22:12:08 +0100 Subject: [PATCH 2/4] fix: vuex store manipulation warning when modifying task labels --- src/store/modules/tasks.js | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) 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 }, From 6a6203f553972127dc136adbf2480087a8667780 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 18 Jan 2022 22:22:32 +0100 Subject: [PATCH 3/4] fix: label edit spacing --- src/components/tasks/partials/editLabels.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/tasks/partials/editLabels.vue b/src/components/tasks/partials/editLabels.vue index ddc10dc3b..4047192d9 100644 --- a/src/components/tasks/partials/editLabels.vue +++ b/src/components/tasks/partials/editLabels.vue @@ -25,13 +25,13 @@ @@ -152,6 +152,18 @@ export default { From ca938b8615af27c44e20e5172e4b3f346c540666 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 18 Jan 2022 22:26:27 +0100 Subject: [PATCH 4/4] fix: subscription prop validation --- src/components/misc/subscription.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,