Fix task icons on kanban if there were multiple different ones

This commit is contained in:
kolaente 2021-01-10 18:27:18 +01:00
parent c44a1af072
commit e87642026b
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
3 changed files with 64 additions and 70 deletions

View file

@ -1,16 +1,19 @@
<template> <template>
<span <span
:class="{'not-so-high': priority === priorities.HIGH, 'high-priority': priority >= priorities.HIGH}" :class="{'not-so-high': priority === priorities.HIGH, 'high-priority': priority >= priorities.HIGH}"
class="priority-label"
v-if="showAll || priority >= priorities.HIGH"> v-if="showAll || priority >= priorities.HIGH">
<span class="icon" v-if="priority >= priorities.HIGH"> <span class="icon" v-if="priority >= priorities.HIGH">
<icon icon="exclamation"/> <icon icon="exclamation"/>
</span> </span>
<span>
<template v-if="priority === priorities.UNSET">Unset</template> <template v-if="priority === priorities.UNSET">Unset</template>
<template v-if="priority === priorities.LOW">Low</template> <template v-if="priority === priorities.LOW">Low</template>
<template v-if="priority === priorities.MEDIUM">Medium</template> <template v-if="priority === priorities.MEDIUM">Medium</template>
<template v-if="priority === priorities.HIGH">High</template> <template v-if="priority === priorities.HIGH">High</template>
<template v-if="priority === priorities.URGENT">Urgent</template> <template v-if="priority === priorities.URGENT">Urgent</template>
<template v-if="priority === priorities.DO_NOW">DO NOW</template> <template v-if="priority === priorities.DO_NOW">DO NOW</template>
</span>
<span class="icon" v-if="priority === priorities.DO_NOW"> <span class="icon" v-if="priority === priorities.DO_NOW">
<icon icon="exclamation"/> <icon icon="exclamation"/>
</span> </span>
@ -40,9 +43,14 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
@import '../../../styles/theme/variables'; @import '../../../styles/theme/variables';
.priority-label {
display: flex;
align-items: center;
}
span.high-priority { span.high-priority {
color: $red; color: $red;
width: auto !important; // To override the width set in tasks width: auto !important; // To override the width set in tasks

View file

@ -85,8 +85,7 @@ $crazy-height-calculation: '100vh - 4.5rem - 1.5rem - 1em - 1.5em - 8px';
align-items: center; align-items: center;
.icon { .icon {
margin-right: 2px; margin-right: .25rem;
margin-left: 5px;
} }
&.overdue { &.overdue {
@ -102,16 +101,12 @@ $crazy-height-calculation: '100vh - 4.5rem - 1.5rem - 1em - 1.5em - 8px';
background: transparent; background: transparent;
padding: 0; padding: 0;
display: flex; display: flex;
justify-content: space-between; flex-wrap: wrap;
margin-top: 8px;
.items {
display: flex;
align-items: center; align-items: center;
> :not(:last-child) { .tag, .assignees, .icon, .priority-label {
margin-right: .5em; margin-top: .25rem;
} margin-right: .25rem;
} }
.assignees { .assignees {
@ -119,36 +114,26 @@ $crazy-height-calculation: '100vh - 4.5rem - 1.5rem - 1em - 1.5em - 8px';
.user { .user {
display: inline; display: inline;
margin: 0 -12px 0 0; margin: 0;
img { img {
margin-right: 0;
}
}
}
.icons-container {
display: flex;
align-items: flex-end;
.icon {
padding: 0px .4rem;
&:not(:first-child) {
margin-left: 4px;
}
svg {
margin: 0; margin: 0;
} }
} }
} }
.icon { .tag {
svg { margin-left: 0;
margin: 4px 0 4px 4px;
fill: $dark;
&:not(.svg-inline--fa) {
width: 16px;
} }
.priority-label {
font-size: .75rem;
height: 2em;
.icon {
height: 1rem;
padding: 0 .25rem;
margin-top: 0;
} }
} }
} }
@ -158,12 +143,11 @@ $crazy-height-calculation: '100vh - 4.5rem - 1.5rem - 1em - 1.5em - 8px';
.priority-label { .priority-label {
background: darken($task-background, 5%); background: darken($task-background, 5%);
border-radius: $radius; border-radius: $radius;
padding-right: 5px; padding: 0 .5rem;
} }
.priority-label { .due-date {
margin: .5em 0; padding: 0 .25rem;
display: inline-block;
} }
.task-id { .task-id {

View file

@ -145,10 +145,15 @@
:value="task.percentDone * 100" max="100"> :value="task.percentDone * 100" max="100">
{{ task.percentDone * 100 }}% {{ task.percentDone * 100 }}%
</progress> </progress>
<labels :labels="task.labels"/>
<div class="footer"> <div class="footer">
<div class="items"> <span
<priority-label :priority="task.priority" class="priority-label"/> :key="label.id"
:style="{'background': label.hexColor, 'color': label.textColor}"
class="tag"
v-for="label in task.labels">
<span>{{ label.title }}</span>
</span>
<priority-label :priority="task.priority"/>
<div class="assignees" v-if="task.assignees.length > 0"> <div class="assignees" v-if="task.assignees.length > 0">
<user <user
:avatar-size="24" :avatar-size="24"
@ -158,8 +163,6 @@
v-for="u in task.assignees" v-for="u in task.assignees"
/> />
</div> </div>
</div>
<div class="icons-container">
<span class="icon" v-if="task.attachments.length > 0"> <span class="icon" v-if="task.attachments.length > 0">
<icon icon="paperclip"/> <icon icon="paperclip"/>
</span> </span>
@ -168,7 +171,6 @@
</span> </span>
</div> </div>
</div> </div>
</div>
</component> </component>
</component> </component>
</div> </div>