mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 05:02:14 +01:00
add task information to recently time entries dashboard card
This commit is contained in:
@@ -7,6 +7,8 @@ import { computed } from 'vue';
|
|||||||
import { useCurrentTimeEntryStore } from '@/utils/useCurrentTimeEntry';
|
import { useCurrentTimeEntryStore } from '@/utils/useCurrentTimeEntry';
|
||||||
import { getDayJsInstance } from '@/packages/ui/src/utils/time';
|
import { getDayJsInstance } from '@/packages/ui/src/utils/time';
|
||||||
import type { TimeEntry } from "@/packages/api/src";
|
import type { TimeEntry } from "@/packages/api/src";
|
||||||
|
import { useTasksStore } from "@/utils/useTasks";
|
||||||
|
import { ChevronRightIcon } from "@heroicons/vue/16/solid";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
timeEntry: TimeEntry
|
timeEntry: TimeEntry
|
||||||
@@ -18,6 +20,12 @@ const project = computed(() => {
|
|||||||
return projects.value.find((project) => project.id === props.timeEntry.project_id);
|
return projects.value.find((project) => project.id === props.timeEntry.project_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const {tasks} = storeToRefs(useTasksStore());
|
||||||
|
|
||||||
|
const task = computed(() => {
|
||||||
|
return tasks.value.find((task) => task.id === props.timeEntry.task_id);
|
||||||
|
});
|
||||||
|
|
||||||
const { currentTimeEntry } = storeToRefs(useCurrentTimeEntryStore());
|
const { currentTimeEntry } = storeToRefs(useCurrentTimeEntryStore());
|
||||||
const { setActiveState } = useCurrentTimeEntryStore();
|
const { setActiveState } = useCurrentTimeEntryStore();
|
||||||
|
|
||||||
@@ -46,8 +54,24 @@ async function startTaskTimer() {
|
|||||||
<span v-else class="text-text-tertiary">No description</span>
|
<span v-else class="text-text-tertiary">No description</span>
|
||||||
</p>
|
</p>
|
||||||
<ProjectBadge
|
<ProjectBadge
|
||||||
:name="project?.name ?? 'No Project'"
|
size="base"
|
||||||
:color="project?.color"></ProjectBadge>
|
:color="project?.color">
|
||||||
|
|
||||||
|
<div class="flex items-center lg:space-x-0.5 min-w-0">
|
||||||
|
<span class="whitespace-nowrap ">
|
||||||
|
{{ project?.name ?? 'No Project' }}
|
||||||
|
</span>
|
||||||
|
<ChevronRightIcon
|
||||||
|
v-if="task"
|
||||||
|
class="w-4 text-muted shrink-0"></ChevronRightIcon>
|
||||||
|
<div
|
||||||
|
v-if="task"
|
||||||
|
class="min-w-0 shrink truncate">
|
||||||
|
{{ task.name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ProjectBadge>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<TimeTrackerStartStop
|
<TimeTrackerStartStop
|
||||||
|
|||||||
Reference in New Issue
Block a user