refactor tag components and tagCreate events, change global week_start and timezone settings, fix pie charts

This commit is contained in:
Gregor Vostrak
2024-07-15 17:20:07 +02:00
parent 10d8540e6c
commit 655723db49
25 changed files with 255 additions and 133 deletions

View File

@@ -16,6 +16,8 @@ import { getDayJsInstance, getLocalizedDayJs } from '@/utils/time';
import { storeToRefs } from 'pinia';
import { useTasksStore } from '@/utils/useTasks';
import { useProjectsStore } from '@/utils/useProjects';
import { useTagsStore } from '@/utils/useTags';
import type { Tag } from '@/utils/api';
const projectStore = useProjectsStore();
const { projects } = storeToRefs(projectStore);
const taskStore = useTasksStore();
@@ -72,6 +74,13 @@ async function submit() {
localEnd.value = getLocalizedDayJs(timeEntryDefaultValues.end).format();
show.value = false;
}
const { tags } = storeToRefs(useTagsStore());
async function createTag(tag: string, callback: (tag: Tag) => void) {
const newTag = await useTagsStore().createTag(tag);
if (newTag !== undefined) {
callback(newTag);
}
}
</script>
<template>
@@ -108,6 +117,8 @@ async function submit() {
</div>
<div class="flex items-center space-x-2 px-4">
<TimeTrackerTagDropdown
:tags="tags"
@createTag="createTag"
v-model="timeEntry.tags"></TimeTrackerTagDropdown>
<BillableToggleButton
v-model="timeEntry.billable"></BillableToggleButton>