Add "Date" grouping option to reporting

This commit is contained in:
Andrew Herron
2026-07-30 10:49:45 +00:00
parent de13c07855
commit 2eb9ae699c
7 changed files with 159 additions and 34 deletions

View File

@@ -240,7 +240,8 @@ const groupedPieChartData = computed(() => {
aggregatedTableTimeEntries.value?.grouped_data?.map((entry) => {
const name = getNameForReportingRowEntry(
entry.key,
aggregatedTableTimeEntries.value?.grouped_type ?? null
aggregatedTableTimeEntries.value?.grouped_type ?? null,
organization?.value?.date_format
);
let color = getRandomColorWithSeed(entry.key ?? 'none');
if (
@@ -255,11 +256,7 @@ const groupedPieChartData = computed(() => {
}
return {
value: entry.seconds,
name:
getNameForReportingRowEntry(
entry.key,
aggregatedTableTimeEntries.value?.grouped_type ?? null
) ?? '',
name: name ?? '',
color: color,
};
}) ?? []
@@ -269,18 +266,25 @@ const groupedPieChartData = computed(() => {
const tableData = computed(() => {
return aggregatedTableTimeEntries.value?.grouped_data?.map((entry) => {
return {
key: entry.key,
seconds: entry.seconds,
cost: entry.cost,
description: getNameForReportingRowEntry(
entry.key,
aggregatedTableTimeEntries.value?.grouped_type ?? null
aggregatedTableTimeEntries.value?.grouped_type ?? null,
organization?.value?.date_format
),
grouped_data:
entry.grouped_data?.map((el) => {
return {
key: el.key,
seconds: el.seconds,
cost: el.cost,
description: getNameForReportingRowEntry(el.key, entry.grouped_type),
description: getNameForReportingRowEntry(
el.key,
entry.grouped_type,
organization?.value?.date_format
),
};
}) ?? [],
};
@@ -421,9 +425,8 @@ const tableData = computed(() => {
">
<ReportingRow
v-for="entry in tableData"
:key="entry.description ?? 'none'"
:key="entry.key ?? 'none'"
:currency="getOrganizationCurrencyString()"
:type="aggregatedTableTimeEntries.grouped_type"
:show-cost="showBillableRate"
:entry="entry"></ReportingRow>
<div class="contents [&>*]:transition text-text-tertiary [&>*]:h-[50px]">

View File

@@ -11,6 +11,7 @@ type AggregatedGroupedData = GroupedData & {
};
type GroupedData = {
key: string | null;
seconds: number;
cost: number | null;
description: string | null | undefined;
@@ -72,7 +73,7 @@ const organization = inject<ComputedRef<Organization>>('organization');
:style="`grid-template-columns: 1fr 150px ${showCost ? '150px' : ''}`">
<ReportingRow
v-for="subEntry in entry.grouped_data"
:key="subEntry.description ?? 'none'"
:key="subEntry.key ?? 'none'"
:currency="props.currency"
:show-cost="showCost"
indent

View File

@@ -95,20 +95,24 @@ const tableData = computed(() => {
return (
aggregatedTableTimeEntries.value?.grouped_data?.map((entry) => {
return {
key: entry.key,
seconds: entry.seconds,
cost: entry.cost,
description: getNameForReportingRowEntry(
entry.key,
aggregatedTableTimeEntries.value?.grouped_type ?? null
aggregatedTableTimeEntries.value?.grouped_type ?? null,
organization?.value?.date_format
),
grouped_data:
entry.grouped_data?.map((el) => {
return {
key: el.key,
seconds: el.seconds,
cost: el.cost,
description: getNameForReportingRowEntry(
el.key,
entry.grouped_type ?? null
entry.grouped_type ?? null,
organization?.value?.date_format
),
};
}) ?? [],
@@ -164,7 +168,7 @@ const showBillableRate = computed(() => {
">
<ReportingRow
v-for="entry in tableData"
:key="entry.description ?? 'none'"
:key="entry.key ?? 'none'"
:currency="getOrganizationCurrencyString()"
:show-cost="showBillableRate"
:entry="entry"></ReportingRow>