committed by
Julius Härtl
parent
0d447fff01
commit
7c0403bfc9
@@ -67,7 +67,7 @@
|
||||
<template>
|
||||
<div class="filter">
|
||||
<h3>{{ t('deck', 'Filter by tag') }}</h3>
|
||||
<div v-for="label in board.labels" :key="label.id" class="filter--item">
|
||||
<div v-for="label in labelsSorted" :key="label.id" class="filter--item">
|
||||
<input
|
||||
:id="label.id"
|
||||
v-model="filter.tags"
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
<span class="hidden-visually">{{ t('deck', 'Tags') }}</span>
|
||||
</div>
|
||||
<div class="section-details">
|
||||
<Multiselect v-model="allLabels"
|
||||
<Multiselect v-model="assignedLabels"
|
||||
:multiple="true"
|
||||
:disabled="!canEdit"
|
||||
:options="currentBoard.labels"
|
||||
:options="labelsSorted"
|
||||
:placeholder="t('deck', 'Assign a tag to this card…')"
|
||||
:taggable="true"
|
||||
label="title"
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
assignedUsers: null,
|
||||
addedLabelToCard: null,
|
||||
copiedCard: null,
|
||||
allLabels: null,
|
||||
assignedLabels: null,
|
||||
locale: getLocale(),
|
||||
|
||||
saving: false,
|
||||
@@ -369,6 +369,9 @@ export default {
|
||||
renderedDescription() {
|
||||
return markdownIt.render(this.copiedCard.description || '')
|
||||
},
|
||||
labelsSorted() {
|
||||
return [...this.currentBoard.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
currentCard() {
|
||||
@@ -389,7 +392,7 @@ export default {
|
||||
}
|
||||
|
||||
this.copiedCard = JSON.parse(JSON.stringify(this.currentCard))
|
||||
this.allLabels = this.currentCard.labels
|
||||
this.assignedLabels = [...this.currentCard.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
|
||||
|
||||
if (this.currentCard.assignedUsers && this.currentCard.assignedUsers.length > 0) {
|
||||
this.assignedUsers = this.currentCard.assignedUsers.map((item) => ({
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
tag="ul"
|
||||
class="labels"
|
||||
@click="openCard">
|
||||
<li v-for="label in card.labels" :key="label.id" :style="labelStyle(label)">
|
||||
<li v-for="label in labelsSorted" :key="label.id" :style="labelStyle(label)">
|
||||
<span @click="applyLabelFilter(label)">{{ label.title }}</span>
|
||||
</li>
|
||||
</transition-group>
|
||||
@@ -122,7 +122,9 @@ export default {
|
||||
currentCard() {
|
||||
return this.card && this.$route && this.$route.params.cardId === this.card.id
|
||||
},
|
||||
|
||||
labelsSorted() {
|
||||
return [...this.card.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
openCard() {
|
||||
|
||||
Reference in New Issue
Block a user