add aggregation/grouping of time entries with same attributes in time view

This commit is contained in:
Gregor Vostrak
2024-05-16 13:08:10 +02:00
parent 4edf282083
commit e2c6026b47
15 changed files with 355 additions and 66 deletions

View File

@@ -20,6 +20,7 @@ const { currentTimeEntry } = storeToRefs(currentTimeEntryStore);
const props = defineProps<{
timeEntry: TimeEntry;
indent?: boolean;
}>();
const { updateTimeEntry, createTimeEntry, fetchTimeEntries } =
@@ -69,6 +70,10 @@ function updateTimeEntryTags(tags: string[]) {
updateTimeEntry({ ...props.timeEntry, tags });
}
function updateTimeEntryBillable(billable: boolean) {
updateTimeEntry({ ...props.timeEntry, billable });
}
function updateProjectAndTask(projectId: string, taskId: string) {
updateTimeEntry({
...props.timeEntry,
@@ -88,13 +93,13 @@ function updateProjectAndTask(projectId: string, taskId: string) {
<input
type="checkbox"
class="h-4 w-4 rounded bg-card-background border-input-border text-accent-500/80 focus:ring-accent-500/80" />
<div class="w-7 h-7" v-if="indent === true"></div>
<TimeEntryDescriptionInput
@changed="updateTimeEntryDescription"
class="flex-1"
:modelValue="
timeEntry.description
"></TimeEntryDescriptionInput>
<TimeTrackerProjectTaskDropdown
:showBadgeBorder="false"
@changed="updateProjectAndTask"
@@ -111,10 +116,7 @@ function updateProjectAndTask(projectId: string, taskId: string) {
:modelValue="timeEntry.billable"
size="small"
@changed="
updateTimeEntry({
...timeEntry,
billable: $event,
})
updateTimeEntryBillable
"></BillableToggleButton>
<div class="flex-1">
<TimeEntryRangeSelector