From 266b99bc253d1c0e160729cb301dbdb81bb69b6e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 20 Oct 2023 12:34:25 +0200 Subject: [PATCH] fix: port exposes change, shoud regenerate label --- app/Http/Livewire/Project/Application/General.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php index b4ebfff5d..c9c0c77ee 100644 --- a/app/Http/Livewire/Project/Application/General.php +++ b/app/Http/Livewire/Project/Application/General.php @@ -19,6 +19,7 @@ class General extends Component public string $git_branch; public ?string $git_commit_sha = null; public string $build_pack; + public ?string $ports_exposes = null; public $customLabels; public bool $labelsChanged = false; @@ -80,6 +81,7 @@ class General extends Component public function mount() { + $this->ports_exposes = $this->application->ports_exposes; if (str($this->application->status)->startsWith('running') && is_null($this->application->config_hash)) { $this->application->isConfigurationChanged(true); } @@ -156,6 +158,7 @@ class General extends Component public function resetDefaultLabels($showToaster = true) { $this->customLabels = str(implode(",", generateLabelsApplication($this->application)))->replace(',', "\n"); + $this->ports_exposes = $this->application->ports_exposes; $this->submit($showToaster); } @@ -168,6 +171,9 @@ class General extends Component { try { $this->validate(); + if ($this->ports_exposes !== $this->application->ports_exposes) { + $this->resetDefaultLabels(false); + } if (data_get($this->application, 'build_pack') === 'dockerimage') { $this->validate([ 'application.docker_registry_image_name' => 'required',