Show list if the search result for a task belongs to a different list

This commit is contained in:
kolaente 2021-01-23 19:05:26 +01:00
parent 0d64506d73
commit 850e4ecc15
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 21 additions and 6 deletions

View file

@ -35,7 +35,22 @@
:creatable="true" :creatable="true"
create-placeholder="Add this as new related task" create-placeholder="Add this as new related task"
@create="createAndRelateTask" @create="createAndRelateTask"
/> >
<template v-slot:searchResult="props">
<span v-if="typeof props.option !== 'string'" class="search-result">
<span
class="different-list"
v-if="props.option.listId !== listId"
v-tooltip="'This task belongs to a different list.'">
{{ $store.getters['lists/getListById'](props.option.listId) === null ? '' : $store.getters['lists/getListById'](props.option.listId).title }} >
</span>
{{ props.option.title }}
</span>
<span class="search-result" v-else>
{{ props.option }}
</span>
</template>
</multiselect>
</div> </div>
<div class="field has-addons mb-4" key="field-kind"> <div class="field has-addons mb-4" key="field-kind">
<div class="control is-expanded"> <div class="control is-expanded">

View file

@ -9,6 +9,11 @@ $remove-icon-width: 24px;
} }
} }
.different-list {
color: $grey-500;
width: auto;
}
.related-tasks { .related-tasks {
.title { .title {
font-size: 1rem; font-size: 1rem;
@ -20,11 +25,6 @@ $remove-icon-width: 24px;
a:not(.remove) { a:not(.remove) {
width: calc(100% - #{$remove-icon-width}); width: calc(100% - #{$remove-icon-width});
.different-list {
color: $grey-500;
width: auto;
}
} }
.task .tasktext { .task .tasktext {