From c1d43bcc679fca39db8a6426d2c216b7d7ab2d5b Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Wed, 7 May 2025 19:39:23 +0200 Subject: [PATCH] add support for interval / duration format in frontend views --- .../Report/DetailedWithDataReportResource.php | 10 + .../Common/Project/ProjectTableRow.vue | 20 +- .../Common/Reporting/ReportingChart.vue | 13 +- .../Common/Reporting/ReportingOverview.vue | 503 ++++++++++++++++++ .../Common/Reporting/ReportingPieChart.vue | 13 +- .../Common/Reporting/ReportingRow.vue | 15 +- .../Components/Common/Task/TaskTableRow.vue | 13 +- .../js/Components/CurrentSidebarTimer.vue | 12 +- .../Dashboard/ActivityGraphCard.vue | 209 ++++---- .../Dashboard/DayOverviewCardEntry.vue | 20 +- .../Dashboard/ProjectsChartCard.vue | 7 +- .../Components/Dashboard/ThisWeekOverview.vue | 224 ++++---- resources/js/Layouts/AppLayout.vue | 58 +- resources/js/Pages/Reporting.vue | 485 +---------------- resources/js/Pages/SharedReport.vue | 29 +- .../Partials/OrganizationFormatSettings.vue | 140 +++-- .../packages/api/src/openapi.json.client.ts | 5 + .../ui/src/Input/DurationHumanInput.vue | 13 +- .../src/TimeEntry/TimeEntryAggregateRow.vue | 37 +- .../TimeEntry/TimeEntryRowDurationInput.vue | 34 +- .../ui/src/TimeEntry/TimeEntryRowHeading.vue | 13 +- .../TimeTracker/TimeTrackerRangeSelector.vue | 62 +-- resources/js/packages/ui/src/utils/number.ts | 41 ++ resources/js/packages/ui/src/utils/time.ts | 86 ++- 24 files changed, 1219 insertions(+), 843 deletions(-) create mode 100644 resources/js/Components/Common/Reporting/ReportingOverview.vue create mode 100644 resources/js/packages/ui/src/utils/number.ts diff --git a/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php b/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php index a33434b4..ee80d37f 100644 --- a/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php +++ b/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php @@ -73,6 +73,16 @@ class DetailedWithDataReportResource extends BaseResource 'public_until' => $this->formatDateTime($this->resource->public_until), /** @var string $currency Currency code (ISO 4217) */ 'currency' => $this->resource->organization->currency, + /** @var string $number_format Number format */ + 'number_format' => $this->resource->organization->number_format, + /** @var string $currency_format Currency format */ + 'currency_format' => $this->resource->organization->currency_format, + /** @var string $date_format Date format */ + 'date_format' => $this->resource->organization->date_format, + /** @var string $interval_format Interval format */ + 'interval_format' => $this->resource->organization->interval_format, + /** @var string $time_format Time format */ + 'time_format' => $this->resource->organization->time_format, 'properties' => [ /** @var string $group Type of first grouping */ 'group' => $this->resource->properties->group->value, diff --git a/resources/js/Components/Common/Project/ProjectTableRow.vue b/resources/js/Components/Common/Project/ProjectTableRow.vue index eb8e85de..cfdad446 100644 --- a/resources/js/Components/Common/Project/ProjectTableRow.vue +++ b/resources/js/Components/Common/Project/ProjectTableRow.vue @@ -1,7 +1,7 @@