diff --git a/resources/js/Components/Common/Reporting/ReportingExportModal.vue b/resources/js/Components/Common/Reporting/ReportingExportModal.vue new file mode 100644 index 00000000..68a990c5 --- /dev/null +++ b/resources/js/Components/Common/Reporting/ReportingExportModal.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/resources/js/Pages/Reporting.vue b/resources/js/Pages/Reporting.vue index c9e5797d..95eb2846 100644 --- a/resources/js/Pages/Reporting.vue +++ b/resources/js/Pages/Reporting.vue @@ -198,15 +198,20 @@ async function downloadExport(format: ExportFormat) { 'Export successful', 'Export failed' ); + if (response?.download_url) { - window.open(response.download_url as string, '_blank')?.focus(); + showExportModal.value = true; + exportUrl.value = response.download_url as string; } } } const { getNameForReportingRowEntry, emptyPlaceholder } = useReportingStore(); import { useProjectsStore } from '@/utils/useProjects'; +import ReportingExportModal from '@/Components/Common/Reporting/ReportingExportModal.vue'; const projectsStore = useProjectsStore(); const { projects } = storeToRefs(projectsStore); +const showExportModal = ref(false); +const exportUrl = ref(null); const groupedPieChartData = computed(() => { return ( @@ -274,6 +279,9 @@ const tableData = computed(() => { title="Reporting" data-testid="reporting_view" class="overflow-hidden"> +
diff --git a/resources/js/Pages/ReportingDetailed.vue b/resources/js/Pages/ReportingDetailed.vue index 8f49763c..c644049c 100644 --- a/resources/js/Pages/ReportingDetailed.vue +++ b/resources/js/Pages/ReportingDetailed.vue @@ -67,6 +67,7 @@ import { useNotificationsStore } from '@/utils/notification'; import TimeEntryMassActionRow from '@/packages/ui/src/TimeEntry/TimeEntryMassActionRow.vue'; import { isAllowedToPerformPremiumAction } from '@/utils/billing'; import { canCreateProjects } from '@/utils/permissions'; +import ReportingExportModal from '@/Components/Common/Reporting/ReportingExportModal.vue'; const startDate = useSessionStorage( 'reporting-start-date', @@ -167,6 +168,9 @@ const { clients } = storeToRefs(clientStore); const selectedTimeEntries = ref([]); +const showExportModal = ref(false); +const exportUrl = ref(null); + async function createTag(name: string) { return await useTagsStore().createTag(name); } @@ -234,7 +238,8 @@ async function downloadExport(format: ExportFormat) { 'Export failed' ); if (response?.download_url) { - window.open(response.download_url as string, '_blank')?.focus(); + showExportModal.value = true; + exportUrl.value = response.download_url as string; } } } @@ -245,6 +250,9 @@ async function downloadExport(format: ExportFormat) { title="Reporting" data-testid="reporting_view" class="overflow-hidden"> +
diff --git a/resources/js/packages/ui/src/Buttons/PrimaryButton.vue b/resources/js/packages/ui/src/Buttons/PrimaryButton.vue index 2aefdb7a..d938bf0c 100644 --- a/resources/js/packages/ui/src/Buttons/PrimaryButton.vue +++ b/resources/js/packages/ui/src/Buttons/PrimaryButton.vue @@ -1,10 +1,13 @@