Merge branch 'main' into feature/vue3-modals-with-router-4

This commit is contained in:
kolaente 2022-01-18 22:27:32 +01:00
commit 8555ffcd17
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
4 changed files with 44 additions and 12 deletions

View file

@ -38,7 +38,9 @@ const props = defineProps({
}, },
subscription: { subscription: {
required: true, required: true,
type: Object as PropType<SubscriptionModel>, validator(value) {
return value instanceof SubscriptionModel || value === null
}
}, },
entityId: { entityId: {
required: true, required: true,

View file

@ -25,13 +25,13 @@
<template #searchResult="props"> <template #searchResult="props">
<span <span
v-if="typeof props.option === 'string'" v-if="typeof props.option === 'string'"
class="tag"> class="tag search-result">
<span>{{ props.option }}</span> <span>{{ props.option }}</span>
</span> </span>
<span <span
v-else v-else
:style="{'background': props.option.hexColor, 'color': props.option.textColor}" :style="{'background': props.option.hexColor, 'color': props.option.textColor}"
class="tag"> class="tag search-result">
<span>{{ props.option.title }}</span> <span>{{ props.option.title }}</span>
</span> </span>
</template> </template>
@ -146,6 +146,18 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.tag { .tag {
margin: .5rem 0 0 .5rem; margin: .25rem !important;
}
.tag.search-result {
margin: 0 !important;
}
:deep(.input-wrapper) {
padding: .25rem !important;
}
:deep(input.input) {
padding: 0 .5rem;
} }
</style> </style>

View file

@ -179,9 +179,18 @@ export default {
console.debug('Could not add label to task in kanban, task not found', t) console.debug('Could not add label to task in kanban, task not found', t)
return r return r
} }
// FIXME: direct store manipulation (task)
t.task.labels.push(label) const labels = [...t.task.labels]
ctx.commit('kanban/setTaskInBucketByIndex', t, { root: true }) labels.push(label)
ctx.commit('kanban/setTaskInBucketByIndex', {
task: {
labels,
...t.task,
},
...t,
}, { root: true })
return r return r
}, },
@ -200,15 +209,21 @@ export default {
} }
// Remove the label from the list // Remove the label from the list
for (const l in t.task.labels) { const labels = [...t.task.labels]
if (t.task.labels[l].id === label.id) { for (const l in labels) {
// FIXME: direct store manipulation (task) if (labels[l].id === label.id) {
t.task.labels.splice(l, 1) labels.splice(l, 1)
break break
} }
} }
ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true}) ctx.commit('kanban/setTaskInBucketByIndex', {
task: {
labels,
...t.task,
},
...t,
}, {root: true})
return response return response
}, },

View file

@ -601,6 +601,9 @@ export default {
} }
}, },
scrollToHeading() { scrollToHeading() {
if(!this.$refs?.heading?.$el) {
return
}
this.$refs.heading.$el.scrollIntoView({block: 'center'}) this.$refs.heading.$el.scrollIntoView({block: 'center'})
}, },
setActiveFields() { setActiveFields() {