From 440f236ae71e812ef6000556a1a14d624551d1e6 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 3 Dec 2024 15:03:28 +0100 Subject: [PATCH] add missing data to public shared reports, add premium restrictions, add pdf download --- .../Report/DetailedWithDataReportResource.php | 2 + .../Common/Report/ReportCreateModal.vue | 11 +- .../Common/Report/ReportSaveButton.vue | 41 +++ .../Reporting/ReportingExportButton.vue | 25 +- .../Common/Reporting/ReportingPieChart.vue | 39 +-- .../Common/Reporting/ReportingRow.vue | 14 +- .../js/Components/Common/UpgradeBadge.vue | 5 +- .../js/Components/Common/UpgradeModal.vue | 10 +- resources/js/Pages/Reporting.vue | 93 +++++-- resources/js/Pages/ReportingDetailed.vue | 11 +- resources/js/Pages/ReportingShared.vue | 41 +++ resources/js/Pages/SharedReport.vue | 118 +++++++-- .../packages/api/src/openapi.json.client.ts | 248 +++++++++++++++--- .../TimeTrackerProjectTaskDropdown.vue | 1 + .../time-entry-aggregate/pdf.blade.php | 1 + 15 files changed, 518 insertions(+), 142 deletions(-) create mode 100644 resources/js/Components/Common/Report/ReportSaveButton.vue diff --git a/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php b/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php index 100ff7e3..1b6449f3 100644 --- a/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php +++ b/app/Http/Resources/V1/Report/DetailedWithDataReportResource.php @@ -90,12 +90,14 @@ public function toArray(Request $request): array * grouped_data: null|array(); -const report = ref({ +const report = ref({ name: '', description: '', is_public: false, public_until: null, - properties: {}, }); const { handleApiRequestNotifications } = useNotificationsStore(); async function submit() { - report.value.properties = { ...props.properties }; await handleApiRequestNotifications( - () => createReportMutation.mutateAsync(report.value), + () => + createReportMutation.mutateAsync({ + ...report.value, + properties: { ...props.properties }, + }), 'Success', 'Error', () => { @@ -59,7 +61,6 @@ async function submit() { description: '', is_public: false, public_until: null, - properties: {}, }; show.value = false; } diff --git a/resources/js/Components/Common/Report/ReportSaveButton.vue b/resources/js/Components/Common/Report/ReportSaveButton.vue new file mode 100644 index 00000000..7f4ab828 --- /dev/null +++ b/resources/js/Components/Common/Report/ReportSaveButton.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/resources/js/Components/Common/Reporting/ReportingExportButton.vue b/resources/js/Components/Common/Reporting/ReportingExportButton.vue index 73a2be8e..464cbcd0 100644 --- a/resources/js/Components/Common/Reporting/ReportingExportButton.vue +++ b/resources/js/Components/Common/Reporting/ReportingExportButton.vue @@ -1,15 +1,22 @@ @@ -48,7 +41,7 @@ const expanded = ref(false); {{ entry.grouped_data?.length }} - {{ getNameForKey(entry.key) }} + {{ entry.description }}
@@ -65,8 +58,7 @@ const expanded = ref(false);
diff --git a/resources/js/Components/Common/UpgradeBadge.vue b/resources/js/Components/Common/UpgradeBadge.vue index d5f18454..106ed215 100644 --- a/resources/js/Components/Common/UpgradeBadge.vue +++ b/resources/js/Components/Common/UpgradeBadge.vue @@ -6,7 +6,10 @@ const showUpgradeModal = ref(false);