From 1baf5d439ca2841372064a77acf0e8342f8364ed Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Mon, 9 Sep 2024 13:05:35 +0200 Subject: [PATCH] make No Project white in chart fixes ST-360 --- .../Common/Reporting/ReportingPieChart.vue | 51 ++++++++----------- resources/js/utils/useReporting.ts | 17 ++++--- 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/resources/js/Components/Common/Reporting/ReportingPieChart.vue b/resources/js/Components/Common/Reporting/ReportingPieChart.vue index d2e58235..51d17754 100644 --- a/resources/js/Components/Common/Reporting/ReportingPieChart.vue +++ b/resources/js/Components/Common/Reporting/ReportingPieChart.vue @@ -1,7 +1,6 @@ - + diff --git a/resources/js/utils/useReporting.ts b/resources/js/utils/useReporting.ts index 8fdfc653..65d071f8 100644 --- a/resources/js/utils/useReporting.ts +++ b/resources/js/utils/useReporting.ts @@ -79,6 +79,14 @@ export const useReportingStore = defineStore('reporting', () => { return reportingTableResponse.value?.data as AggregatedTimeEntries; }); + const emptyPlaceholder = { + user: 'No User', + project: 'No Project', + task: 'No Task', + billable: 'Non-Billable', + client: 'No Client', + } as Record; + function getNameForReportingRowEntry( key: string | null, type: string | null @@ -87,14 +95,6 @@ export const useReportingStore = defineStore('reporting', () => { return null; } if (key === null) { - const emptyPlaceholder = { - user: 'No User', - project: 'No Project', - task: 'No Task', - billable: 'Non-Billable', - client: 'No Client', - }; - return emptyPlaceholder[type as keyof typeof emptyPlaceholder]; } @@ -167,5 +167,6 @@ export const useReportingStore = defineStore('reporting', () => { aggregatedTableTimeEntries, getNameForReportingRowEntry, groupByOptions, + emptyPlaceholder, }; });