From bc2da6c08f7c76ecb290379a561602171a7504bd Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 9 Sep 2024 18:08:22 -0400 Subject: [PATCH 1/2] Add meta data to check if server is-prod --- resources/views/layouts/ai-qr-mobile.blade.php | 1 + resources/views/layouts/layout.blade.php | 1 + resources/views/layouts/minimal.blade.php | 1 + resources/views/layouts/preview.blade.php | 1 + resources/views/layouts/process-map.blade.php | 1 + resources/views/tasks/preview.blade.php | 1 + 6 files changed, 6 insertions(+) diff --git a/resources/views/layouts/ai-qr-mobile.blade.php b/resources/views/layouts/ai-qr-mobile.blade.php index 2ba43445b4..67a876a93a 100644 --- a/resources/views/layouts/ai-qr-mobile.blade.php +++ b/resources/views/layouts/ai-qr-mobile.blade.php @@ -7,6 +7,7 @@ + diff --git a/resources/views/layouts/layout.blade.php b/resources/views/layouts/layout.blade.php index dc70dd2c22..2fd4356d4c 100644 --- a/resources/views/layouts/layout.blade.php +++ b/resources/views/layouts/layout.blade.php @@ -9,6 +9,7 @@ worker-src 'self' blob:;"> + diff --git a/resources/views/layouts/minimal.blade.php b/resources/views/layouts/minimal.blade.php index 6197f89405..290d841c6c 100644 --- a/resources/views/layouts/minimal.blade.php +++ b/resources/views/layouts/minimal.blade.php @@ -6,6 +6,7 @@ + @yield('title',__('Welcome')) - {{ __('ProcessMaker') }} diff --git a/resources/views/layouts/preview.blade.php b/resources/views/layouts/preview.blade.php index 2cdd65a823..d68fa60397 100644 --- a/resources/views/layouts/preview.blade.php +++ b/resources/views/layouts/preview.blade.php @@ -9,6 +9,7 @@ worker-src 'self' blob:;"> + diff --git a/resources/views/layouts/process-map.blade.php b/resources/views/layouts/process-map.blade.php index 4696b44052..901c130728 100644 --- a/resources/views/layouts/process-map.blade.php +++ b/resources/views/layouts/process-map.blade.php @@ -7,6 +7,7 @@ + @if (Auth::user()) diff --git a/resources/views/tasks/preview.blade.php b/resources/views/tasks/preview.blade.php index 73228e45b1..ddddf8d5a7 100644 --- a/resources/views/tasks/preview.blade.php +++ b/resources/views/tasks/preview.blade.php @@ -8,6 +8,7 @@ worker-src 'self' blob:;"> + From e8fbe937a8124f9befa7392c06d8f3a8097db6ae Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 9 Sep 2024 18:08:46 -0400 Subject: [PATCH 2/2] Do not show Missing Translation logs in prod --- resources/js/bootstrap.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 57f13bb5ca..2e93d56bb0 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -179,7 +179,9 @@ window.ProcessMaker = { missingTranslation(value) { if (this.missingTranslations.has(value)) { return; } this.missingTranslations.add(value); - console.warn("Missing Translation:", value); + if (!isProd) { + console.warn("Missing Translation:", value); + } }, RequestChannel, @@ -231,6 +233,7 @@ window.ProcessMaker.apiClient.defaults.headers.common["X-Requested-With"] = "XML */ const token = document.head.querySelector("meta[name=\"csrf-token\"]"); +const isProd = document.head.querySelector("meta[name=\"is-prod\"]")?.content === "true"; if (token) { window.ProcessMaker.apiClient.defaults.headers.common["X-CSRF-TOKEN"] = token.content;