2019-11-24 14:16:24 +01:00
|
|
|
<template>
|
2020-09-05 22:35:52 +02:00
|
|
|
<span
|
|
|
|
:class="{'not-so-high': priority === priorities.HIGH, 'high-priority': priority >= priorities.HIGH}"
|
2021-01-10 18:27:18 +01:00
|
|
|
class="priority-label"
|
2020-09-05 22:35:52 +02:00
|
|
|
v-if="showAll || priority >= priorities.HIGH">
|
2020-04-01 22:13:57 +02:00
|
|
|
<span class="icon" v-if="priority >= priorities.HIGH">
|
2019-11-24 14:16:24 +01:00
|
|
|
<icon icon="exclamation"/>
|
|
|
|
</span>
|
2021-01-10 18:27:18 +01:00
|
|
|
<span>
|
|
|
|
<template v-if="priority === priorities.UNSET">Unset</template>
|
|
|
|
<template v-if="priority === priorities.LOW">Low</template>
|
|
|
|
<template v-if="priority === priorities.MEDIUM">Medium</template>
|
|
|
|
<template v-if="priority === priorities.HIGH">High</template>
|
|
|
|
<template v-if="priority === priorities.URGENT">Urgent</template>
|
|
|
|
<template v-if="priority === priorities.DO_NOW">DO NOW</template>
|
|
|
|
</span>
|
2019-11-24 14:16:24 +01:00
|
|
|
<span class="icon" v-if="priority === priorities.DO_NOW">
|
|
|
|
<icon icon="exclamation"/>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02:00
|
|
|
import priorites from '../../../models/priorities'
|
2019-11-24 14:16:24 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'priorityLabel',
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
priorities: priorites,
|
2019-11-24 14:16:24 +01:00
|
|
|
}
|
2020-09-05 22:35:52 +02:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
priority: {
|
|
|
|
default: 0,
|
|
|
|
type: Number,
|
|
|
|
},
|
|
|
|
showAll: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2019-11-24 14:16:24 +01:00
|
|
|
</script>
|
2019-12-18 22:38:26 +01:00
|
|
|
|
2021-01-10 18:27:18 +01:00
|
|
|
<style lang="scss" scoped>
|
2020-09-05 22:35:52 +02:00
|
|
|
@import '../../../styles/theme/variables';
|
2019-12-18 22:38:26 +01:00
|
|
|
|
2021-01-10 18:27:18 +01:00
|
|
|
.priority-label {
|
2021-01-10 21:46:41 +01:00
|
|
|
display: inline-flex;
|
2021-01-10 18:27:18 +01:00
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
span.high-priority {
|
|
|
|
color: $red;
|
|
|
|
width: auto !important; // To override the width set in tasks
|
2019-12-18 22:38:26 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
.icon {
|
|
|
|
vertical-align: middle;
|
|
|
|
width: auto !important;
|
|
|
|
padding: 0 .5em;
|
|
|
|
}
|
2019-12-18 22:38:26 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
&.not-so-high {
|
|
|
|
color: $orange;
|
2019-12-18 22:38:26 +01:00
|
|
|
}
|
2020-09-05 22:35:52 +02:00
|
|
|
}
|
2019-12-18 22:38:26 +01:00
|
|
|
</style>
|