From 51c806c12b90aa124384497856590f5010b9ff49 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 7 Sep 2022 17:57:44 +0200 Subject: [PATCH 1/5] feat: color the task color button when the task has a color set --- src/views/tasks/TaskDetailView.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index a584aeb6..2c5b573b 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -379,6 +379,8 @@ variant="secondary" icon="fill-drip" v-shortcut="'c'" + :class="{'has-light-text': color !== TASK_DEFAULT_COLOR && !colorIsDark(color)}" + :style="{'background-color': color !== TASK_DEFAULT_COLOR ? color : false}" > {{ $t('task.detail.actions.color') }} @@ -429,7 +431,7 @@ import {defineComponent} from 'vue' import cloneDeep from 'lodash.clonedeep' import TaskService from '../../services/task' -import TaskModel from '@/models/task' +import TaskModel, {TASK_DEFAULT_COLOR} from '@/models/task' import type {ITask} from '@/modelTypes/ITask' import { PRIORITIES as priorites } from '@/constants/priorities' @@ -461,6 +463,7 @@ import { setTitle } from '@/helpers/setTitle' import {getNamespaceTitle} from '@/helpers/getNamespaceTitle' import {getListTitle} from '@/helpers/getListTitle' import type { IList } from '@/modelTypes/IList' +import {colorIsDark} from '@/helpers/color/colorIsDark' function scrollIntoView(el) { if (!el) { @@ -527,6 +530,8 @@ export default defineComponent({ showDeleteModal: false, // Used to avoid flashing of empty elements if the task content is not yet loaded. visible: false, + + TASK_DEFAULT_COLOR, activeFields: { assignees: false, @@ -594,6 +599,11 @@ export default defineComponent({ shouldShowClosePopup() { return this.$route.name.includes('kanban') }, + color() { + return this.task.getHexColor + ? this.task.getHexColor() + : TASK_DEFAULT_COLOR + }, }, methods: { getNamespaceTitle, @@ -745,6 +755,8 @@ export default defineComponent({ this.task = await this.taskService.update(this.task) this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist') }, + + colorIsDark, }, }) @@ -932,7 +944,11 @@ $flash-background-duration: 750ms; .button { width: 100%; margin-bottom: .5rem; - justify-content: left; + justify-content: left; + + &.has-light-text { + color: var(--white); + } } } From bdf992c9bfe9de176a22f7b5a6fdae1bc5e5010f Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 14 Sep 2022 18:56:51 +0200 Subject: [PATCH 2/5] feat: color the color button icon instead of the button itself --- src/components/input/button.vue | 15 +++++++++++++-- src/views/tasks/TaskDetailView.vue | 11 +++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/input/button.vue b/src/components/input/button.vue index 0131c287..ae34391d 100644 --- a/src/components/input/button.vue +++ b/src/components/input/button.vue @@ -9,9 +9,16 @@ } ]" > - + - + @@ -42,6 +49,10 @@ const props = defineProps({ type: [String, Array], default: '', }, + iconColor: { + type: String, + default: '', + }, loading: { type: Boolean, default: false, diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 2c5b573b..b75e7325 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -378,9 +378,8 @@ @click="setFieldActive('color')" variant="secondary" icon="fill-drip" + :icon-color="color" v-shortcut="'c'" - :class="{'has-light-text': color !== TASK_DEFAULT_COLOR && !colorIsDark(color)}" - :style="{'background-color': color !== TASK_DEFAULT_COLOR ? color : false}" > {{ $t('task.detail.actions.color') }} @@ -600,9 +599,13 @@ export default defineComponent({ return this.$route.name.includes('kanban') }, color() { - return this.task.getHexColor + const color = this.task.getHexColor ? this.task.getHexColor() - : TASK_DEFAULT_COLOR + : false + + return color === TASK_DEFAULT_COLOR + ? '' + : color }, }, methods: { From 2683fec0a67f6afd16579bb44a6ceadc0edd565f Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 15 Sep 2022 13:56:14 +0200 Subject: [PATCH 3/5] feat: show the task color bubble everywhere --- src/components/home/navigation.vue | 17 ++++++------ src/components/misc/colorBubble.vue | 26 +++++++++++++++++++ src/components/tasks/partials/heading.vue | 21 +++++++++++---- .../tasks/partials/singleTaskInList.vue | 24 +++++++++-------- 4 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 src/components/misc/colorBubble.vue diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index dc09c5d7..07be48e0 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -56,10 +56,10 @@ class="menu-label" v-tooltip="namespaceTitles[nk]" > - {{ namespaceTitles[nk] }}
- - + {{ getListTitle(l) }} + + + + + + \ No newline at end of file diff --git a/src/components/tasks/partials/heading.vue b/src/components/tasks/partials/heading.vue index 9b57c2ad..b8bc51cf 100644 --- a/src/components/tasks/partials/heading.vue +++ b/src/components/tasks/partials/heading.vue @@ -1,7 +1,12 @@