From 76599190f6cd2a59890b2dfed94de22c332f22cb Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 02:44:46 +0800 Subject: [PATCH 1/3] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../vue/components/bookings/elements/BillingComponent.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index ba1ce85c..c1700e32 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -126,7 +126,9 @@ export default { successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } } }, From e83db6a57f09bdec909fd92c050e748632c9e99b Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:09:12 +0800 Subject: [PATCH 2/3] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../accounting/elements/HistoryImportedInvoices.vue | 4 +++- .../vue/components/bookings/elements/BillingComponent.vue | 1 - .../bookings/elements/UploadDebtorExcelComponent.vue | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue index d0dd1e93..23a8e1b4 100644 --- a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue +++ b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue @@ -41,7 +41,9 @@ successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/bookings/elements/BillingComponent.vue b/resources/assets/vue/components/bookings/elements/BillingComponent.vue index c1700e32..3f8df642 100644 --- a/resources/assets/vue/components/bookings/elements/BillingComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BillingComponent.vue @@ -127,7 +127,6 @@ export default { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { // window.location.href = response.src; - console.log('download'); window.open(response.src, '_blank'); } } diff --git a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue index 85db0263..2aa32607 100644 --- a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue +++ b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue @@ -81,7 +81,9 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } }); } From 18f071af50eefcea78fbe53447388f58b6bb80dd Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:19:06 +0800 Subject: [PATCH 3/3] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../elements/CustomerTransactionHistorySectionComponent.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue index 0a0b06bf..b0643368 100644 --- a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue +++ b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue @@ -130,7 +130,9 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + console.log('download'); + window.open(response.src, '_blank'); } }); }