From 3a3c9448a4e1e731c966c4c75c61681588ce3247 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 14 Nov 2023 14:07:42 +0100 Subject: [PATCH] Add gitWebhook method to Application model and fix Dockerfile input display --- app/Models/Application.php | 12 ++++++++++++ .../livewire/project/application/general.blade.php | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Models/Application.php b/app/Models/Application.php index 0e72f94ce..27f34df34 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -85,6 +85,18 @@ class Application extends BaseModel ); } + public function gitWebhook(): Attribute + { + return Attribute::make( + get: function () { + if (!is_null($this->source?->html_url) && !is_null($this->git_repository) && !is_null($this->git_branch)) { + return "{$this->source->html_url}/{$this->git_repository}/settings/hooks"; + } + return $this->git_repository; + } + ); + } + public function gitCommits(): Attribute { return Attribute::make( diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 173aa52e8..2753b4bf7 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -69,10 +69,12 @@
- @if ($application->build_pack === 'dockerfile') + @if ($application->build_pack === 'dockerfile' && !$application->dockerfile) + @endif + @if ($application->build_pack === 'dockerfile') @endif