feat: pass done prop down directly to avoid coupeling
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
kolaente 2021-10-04 22:39:51 +02:00
parent 123d78cf88
commit 68e5a5fd8a
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
5 changed files with 23 additions and 18 deletions

View File

@ -103,7 +103,7 @@
>
{{ t.title }}
</span>
<priority-label :task="t"/>
<priority-label :priority="t.priority" :done="t.done"/>
<!-- using the key here forces vue to use the updated version model and not the response returned by the api -->
<a @click="editTask(theTasks[k])" class="edit-toggle">
<icon icon="pen"/>

View File

@ -41,7 +41,7 @@
</progress>
<div class="footer">
<labels :labels="task.labels"/>
<priority-label :task="task"/>
<priority-label :priority="task.priority" :done="task.done"/>
<div class="assignees" v-if="task.assignees.length > 0">
<user
:avatar-size="24"

View File

@ -1,20 +1,20 @@
<template>
<span
:class="{'not-so-high': task.priority === priorities.HIGH, 'high-task.priority': task.priority >= priorities.HIGH}"
class="task.priority-label"
v-if="!task.done && (showAll || task.priority >= priorities.HIGH)">
<span class="icon" v-if="task.priority >= priorities.HIGH">
:class="{'not-so-high': priority === priorities.HIGH, 'high-priority': priority >= priorities.HIGH}"
class="priority-label"
v-if="!done && (showAll || priority >= priorities.HIGH)">
<span class="icon" v-if="priority >= priorities.HIGH">
<icon icon="exclamation"/>
</span>
<span>
<template v-if="task.priority === priorities.UNSET">{{ $t('task.task.priority.unset') }}</template>
<template v-if="task.priority === priorities.LOW">{{ $t('task.task.priority.low') }}</template>
<template v-if="task.priority === priorities.MEDIUM">{{ $t('task.task.priority.medium') }}</template>
<template v-if="task.priority === priorities.HIGH">{{ $t('task.task.priority.high') }}</template>
<template v-if="task.priority === priorities.URGENT">{{ $t('task.task.priority.urgent') }}</template>
<template v-if="task.priority === priorities.DO_NOW">{{ $t('task.task.priority.doNow') }}</template>
<template v-if="priority === priorities.UNSET">{{ $t('task.priority.unset') }}</template>
<template v-if="priority === priorities.LOW">{{ $t('task.priority.low') }}</template>
<template v-if="priority === priorities.MEDIUM">{{ $t('task.priority.medium') }}</template>
<template v-if="priority === priorities.HIGH">{{ $t('task.priority.high') }}</template>
<template v-if="priority === priorities.URGENT">{{ $t('task.priority.urgent') }}</template>
<template v-if="priority === priorities.DO_NOW">{{ $t('task.priority.doNow') }}</template>
</span>
<span class="icon" v-if="task.priority === priorities.DO_NOW">
<span class="icon" v-if="priority === priorities.DO_NOW">
<icon icon="exclamation"/>
</span>
</span>
@ -24,19 +24,24 @@
import priorites from '../../../models/constants/priorities'
export default {
name: 'task.priorityLabel',
name: 'priorityLabel',
data() {
return {
priorities: priorites,
}
},
props: {
priority: {
default: 0,
type: Number,
},
showAll: {
type: Boolean,
default: false,
},
task: {
required: true,
done: {
type: Boolean,
default: false,
},
},
}

View File

@ -50,7 +50,7 @@
<transition name="fade">
<defer-task v-if="+new Date(task.dueDate) > 0 && showDefer" v-model="task" ref="deferDueDate"/>
</transition>
<priority-label :task="task"/>
<priority-label :priority="task.priority" :done="task.done"/>
<span>
<span class="list-task-icon" v-if="task.attachments.length > 0">
<icon icon="paperclip"/>

View File

@ -140,7 +140,7 @@
<router-link :to="{name: 'task.detail', params: { id: t.id }}">{{ t.title }}</router-link>
</td>
<td v-if="activeColumns.priority">
<priority-label :task="t" :show-all="true"/>
<priority-label :priority="t.priority" :done="t.done" :show-all="true"/>
</td>
<td v-if="activeColumns.labels">
<labels :labels="t.labels"/>