From faa1120e14d0889f26fea758a9d7305a21b8558a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 16 Apr 2024 12:41:33 +0200 Subject: [PATCH] Refactor Show.php and docker.php to improve code readability and maintainability --- app/Livewire/Project/Shared/EnvironmentVariable/Show.php | 6 +++--- bootstrap/helpers/docker.php | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php index 65e91e60a..9beb7cfab 100644 --- a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php +++ b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php @@ -50,9 +50,9 @@ public function mount() public function checkEnvs() { $this->isDisabled = false; - if (str($this->env->key)->startsWith('SERVICE_FQDN') || str($this->env->key)->startsWith('SERVICE_URL')) { - $this->isDisabled = true; - } + // if (str($this->env->key)->startsWith('SERVICE_FQDN') || str($this->env->key)->startsWith('SERVICE_URL')) { + // $this->isDisabled = true; + // } if ($this->env->is_shown_once) { $this->isLocked = true; } diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 14ea491ee..847a66c33 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -182,6 +182,9 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource, $environment_variables = $resource->environment_variables; $type = $resource->serviceType(); } + if (is_null($server) || is_null($type)) { + return collect([]); + } $variables = collect($environment_variables); $payload = collect([]); switch ($type) {