1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Fix setup issue with opening new PDFs

This commit is contained in:
Benjamin Beganović 2020-10-27 14:02:36 +01:00
parent a222222c31
commit 8270762311
4 changed files with 15 additions and 7 deletions

View File

@ -192,7 +192,7 @@ class SetupController extends Controller
return $this->testPhantom();
}
Browsershot::html('PDF GENERATION WORKS! Thank you for using Invoice Ninja!')
Browsershot::html('GENERATING PDFs WORKS! Thank you for using Invoice Ninja!')
->setNodeBinary(config('ninja.system.node_path'))
->setNpmBinary(config('ninja.system.npm_path'))
->noSandbox()

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,6 @@
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=1c5d76fb5f98bd49f6c8",
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=bf87649ca30c9a3fba59",
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=df93e290245c26694fdb",
"/js/setup/setup.js": "/js/setup/setup.js?id=9561e6b4d2cc26f85d17",
"/js/setup/setup.js": "/js/setup/setup.js?id=e8de60f3af6b10afe483",
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
}

View File

@ -59,12 +59,20 @@ class Setup {
handleTestPdfCheck() {
Axios.post('/setup/check_pdf', {})
.then((response) => {
let win = window.open(response.data.url, '_blank');
win.focus();
try {
let win = window.open(response.data.url, '_blank');
win.focus();
return this.handleSuccess(this.checkPdfAlert);
return this.handleSuccess(this.checkPdfAlert);
} catch (error) {
this.handleSuccess(this.checkPdfAlert);
this.checkPdfAlert.textContent = `Success! You can preview test PDF here: ${response.data.url}`;
}
})
.catch((error) => this.handleFailure(this.checkPdfAlert));
.catch((error) => {
console.log(error);
this.handleFailure(this.checkPdfAlert)
});
}
handleSuccess(element) {