From fda8e9139646769f0188be911b4d4072d0b396f4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 21 Jul 2026 20:59:09 +0200 Subject: [PATCH] fix(ui): simplify GitLab source setup view Use the red incomplete-setup alert like GitHub, keep name + OAuth credentials front-and-center, and tuck GitLab URL / API / SSH / system wide options into an Advanced accordion for self-hosted users. --- app/Livewire/Source/Gitlab/Change.php | 15 ++ .../livewire/source/gitlab/change.blade.php | 129 +++++++++++++----- tests/Feature/GitlabSourceChangeViewTest.php | 59 ++++++++ 3 files changed, 166 insertions(+), 37 deletions(-) create mode 100644 tests/Feature/GitlabSourceChangeViewTest.php diff --git a/app/Livewire/Source/Gitlab/Change.php b/app/Livewire/Source/Gitlab/Change.php index 0cb36a5f8..2e36a1e1f 100644 --- a/app/Livewire/Source/Gitlab/Change.php +++ b/app/Livewire/Source/Gitlab/Change.php @@ -59,6 +59,8 @@ class Change extends Component public ?string $oauthState = null; + private bool $shouldDeriveApiUrlAfterHtmlUrlUpdate = false; + protected function rules(): array { return [ @@ -76,6 +78,19 @@ class Change extends Component ]; } + public function updatingHtmlUrl(): void + { + $this->shouldDeriveApiUrlAfterHtmlUrlUpdate = blank($this->apiUrl) + || $this->apiUrl === rtrim($this->htmlUrl, '/').'/api/v4'; + } + + public function updatedHtmlUrl(): void + { + if ($this->shouldDeriveApiUrlAfterHtmlUrlUpdate) { + $this->apiUrl = rtrim($this->htmlUrl, '/').'/api/v4'; + } + } + public function mount() { try { diff --git a/resources/views/livewire/source/gitlab/change.blade.php b/resources/views/livewire/source/gitlab/change.blade.php index 3072f457d..830a9a0a7 100644 --- a/resources/views/livewire/source/gitlab/change.blade.php +++ b/resources/views/livewire/source/gitlab/change.blade.php @@ -29,28 +29,67 @@