From d94a60d33b2dce57cac404e4fbeaac60508b7173 Mon Sep 17 00:00:00 2001 From: Kamil Niemczycki Date: Tue, 5 Jul 2022 11:13:43 +0200 Subject: [PATCH] - cleaning --- .../Http/Middleware/HandleInertiaRequests.php | 9 +-- config/heroku.php | 12 ++-- resources/js/Shared/DeployInfo.vue | 67 +++++++++++++++++++ resources/js/Shared/Layout/AppLayout.vue | 28 ++------ resources/js/Shared/Layout/GuestLayout.vue | 30 +++------ 5 files changed, 88 insertions(+), 58 deletions(-) create mode 100644 resources/js/Shared/DeployInfo.vue diff --git a/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php b/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php index decaeb4..8213740 100644 --- a/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php +++ b/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php @@ -6,7 +6,6 @@ namespace Toby\Infrastructure\Http\Middleware; use Closure; use Illuminate\Http\Request; -use Illuminate\Support\Carbon; use Inertia\Middleware; use Toby\Domain\VacationRequestStatesRetriever; use Toby\Eloquent\Helpers\YearPeriodRetriever; @@ -74,14 +73,12 @@ class HandleInertiaRequests extends Middleware : null; } - protected function getDeployInformation(): array + protected function getDeployInformation(): Closure { - $releaseDate = config("heroku.release_created_at"); - - return [ + return fn() => [ "release_version" => config("heroku.release_version"), "slug_description" => config("heroku.slug_description"), - "release_created_at" => $releaseDate ? Carbon::parse($releaseDate)->format('Y-m-d H:i:s') : null, + "release_created_at" => config("heroku.release_created_at"), "slug_commit" => config("heroku.slug_commit"), "github_url" => preg_replace("/\/$/i", "", config("heroku.github_url", "")), ]; diff --git a/config/heroku.php b/config/heroku.php index dce537b..aee7fb6 100644 --- a/config/heroku.php +++ b/config/heroku.php @@ -1,11 +1,11 @@ env("HEROKU_RELEASE_VERSION"), "slug_description" => env("HEROKU_SLUG_DESCRIPTION"), "release_created_at" => env("HEROKU_RELEASE_CREATED_AT"), "slug_commit" => env("HEROKU_SLUG_COMMIT"), - "github_url" => env("GITHUB_REPO_URL") -]; + "github_url" => env("GITHUB_REPO_URL"), +]; diff --git a/resources/js/Shared/DeployInfo.vue b/resources/js/Shared/DeployInfo.vue new file mode 100644 index 0000000..5189932 --- /dev/null +++ b/resources/js/Shared/DeployInfo.vue @@ -0,0 +1,67 @@ + + + diff --git a/resources/js/Shared/Layout/AppLayout.vue b/resources/js/Shared/Layout/AppLayout.vue index 51012e4..13ceb4d 100644 --- a/resources/js/Shared/Layout/AppLayout.vue +++ b/resources/js/Shared/Layout/AppLayout.vue @@ -9,30 +9,9 @@
-
-

- Wydanie: - {{ deployInformation.slug_description }} ({{ deployInformation.release_version }}) - - {{ deployInformation.slug_description }} - -

-

- Data wydania: {{ deployInformation.release_created_at }} -

-
+ @@ -41,6 +20,7 @@ import MainMenu from '@/Shared/MainMenu' import { useToast } from 'vue-toastification' import { watch } from 'vue' +import DeployInfo from '@/Shared/DeployInfo' const props = defineProps({ flash: Object, diff --git a/resources/js/Shared/Layout/GuestLayout.vue b/resources/js/Shared/Layout/GuestLayout.vue index 30f9d16..e012bfb 100644 --- a/resources/js/Shared/Layout/GuestLayout.vue +++ b/resources/js/Shared/Layout/GuestLayout.vue @@ -1,31 +1,17 @@ +