From 18f071af50eefcea78fbe53447388f58b6bb80dd Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:19:06 +0800 Subject: [PATCH 1/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'); } }); } From be7387a16fdff45f2039252c9786873f7c4b012d Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:24:31 +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/HistoryImportedReceipts.vue | 3 ++- .../accounting/sections/ImportedInvoiceMappedComponent.vue | 3 ++- .../accounting/sections/ImportedReceiptMappedComponent.vue | 3 ++- .../accounting/sections/TransactionsMappingComponent.vue | 6 ++++-- .../bookings/elements/DownloadBillingWithDatesComponent.vue | 3 ++- .../elements/DownloadSupplierWhiteFormComponent.vue | 3 ++- .../forms/ExportBookingTransactionFormComponent.vue | 3 ++- .../companies/elements/BulkDownloadInvoiceComponent.vue | 3 ++- .../elements/CustomerTransactionSectionComponent.vue | 3 ++- .../wallets/elements/CustomerWalletTransactionComponent.vue | 3 ++- 10 files changed, 22 insertions(+), 11 deletions(-) diff --git a/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue b/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue index 385e37b9..1b37b8ef 100644 --- a/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue +++ b/resources/assets/vue/components/accounting/elements/HistoryImportedReceipts.vue @@ -41,7 +41,8 @@ successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue b/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue index 01194163..9047cc76 100644 --- a/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue +++ b/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue @@ -135,7 +135,8 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue b/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue index c81532c8..2e595ede 100644 --- a/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue +++ b/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue @@ -139,7 +139,8 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue b/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue index b94148ad..0217ed9b 100644 --- a/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue +++ b/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue @@ -281,7 +281,8 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } @@ -309,7 +310,8 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue index 195fc7dd..867ee932 100644 --- a/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue +++ b/resources/assets/vue/components/bookings/elements/DownloadBillingWithDatesComponent.vue @@ -109,7 +109,8 @@ export default { successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue index b12e98ba..732770e5 100644 --- a/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue +++ b/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue @@ -93,7 +93,8 @@ export default { this.returnData = null; if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } } diff --git a/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue b/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue index eeb6bf62..d53dce7e 100644 --- a/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/ExportBookingTransactionFormComponent.vue @@ -99,7 +99,8 @@ export default { successHandler(response) { if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } }, diff --git a/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue b/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue index 88cd0d9c..fa49c53e 100644 --- a/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue +++ b/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue @@ -95,7 +95,8 @@ this.returnData = null; if(window.LARAVEL_VAPOR_ENABLED){ if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } } } diff --git a/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue b/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue index 41bd4175..3f1b0b37 100644 --- a/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue +++ b/resources/assets/vue/components/wallets/elements/CustomerTransactionSectionComponent.vue @@ -133,7 +133,8 @@ export default { response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } diff --git a/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue b/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue index f9f8498e..ad5ccb07 100644 --- a/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue +++ b/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue @@ -39,7 +39,8 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + // window.location.href = response.src; + window.open(response.src, '_blank'); } }); } From efed8b639d2d4feff3000a683bdf9857fa3a7ddf Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 24 Oct 2024 03:38:53 +0800 Subject: [PATCH 3/3] Laravel Vapor - Fix inconsistency of download triggers which suppose to open in a new tab instead of current --- .../components/accounting/elements/HistoryImportedInvoices.vue | 1 - .../elements/CustomerTransactionHistorySectionComponent.vue | 1 - .../components/bookings/elements/UploadDebtorExcelComponent.vue | 1 - .../bookings/forms/SupplierPlaceOrderFormComponent.vue | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue index 23a8e1b4..b10721ee 100644 --- a/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue +++ b/resources/assets/vue/components/accounting/elements/HistoryImportedInvoices.vue @@ -42,7 +42,6 @@ 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/CustomerTransactionHistorySectionComponent.vue b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue index b0643368..76d9d509 100644 --- a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue +++ b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue @@ -131,7 +131,6 @@ export default { if(!success){return;} 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 2aa32607..c999b81a 100644 --- a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue +++ b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue @@ -82,7 +82,6 @@ if(!success){return;} if (response.src) { // window.location.href = response.src; - console.log('download'); window.open(response.src, '_blank'); } }); diff --git a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue index 8fdd1ce4..2607388b 100644 --- a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue @@ -159,7 +159,7 @@ response.json().then(response => { if(!success){return;} if (response.src) { - window.location.href = response.src; + window.open(response.src, '_blank'); } }); }