From be1dad03bd0de8cd1e5c8e0cab90ed19570f2fdb Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 5 Sep 2023 10:03:28 +0200 Subject: [PATCH] fix: do not show system wide git on cloud --- app/Http/Livewire/Source/Github/Create.php | 9 ++- .../livewire/source/github/change.blade.php | 65 ++++++++++--------- .../livewire/source/github/create.blade.php | 6 +- resources/views/source/new.blade.php | 10 +-- 4 files changed, 48 insertions(+), 42 deletions(-) diff --git a/app/Http/Livewire/Source/Github/Create.php b/app/Http/Livewire/Source/Github/Create.php index b5487bcc8..c607af451 100644 --- a/app/Http/Livewire/Source/Github/Create.php +++ b/app/Http/Livewire/Source/Github/Create.php @@ -32,16 +32,19 @@ public function createGitHubApp() "custom_port" => 'required|int', "is_system_wide" => 'required|bool', ]); - $github_app = GithubApp::create([ + $payload = [ 'name' => $this->name, 'organization' => $this->organization, 'api_url' => $this->api_url, 'html_url' => $this->html_url, 'custom_user' => $this->custom_user, 'custom_port' => $this->custom_port, - 'is_system_wide' => $this->is_system_wide, 'team_id' => currentTeam()->id, - ]); + ]; + if (isCloud()) { + $payload['is_system_wide'] = $this->is_system_wide; + } + $github_app = GithubApp::create($payload); if (session('from')) { session(['from' => session('from') + ['source_id' => $github_app->id]]); } diff --git a/resources/views/livewire/source/github/change.blade.php b/resources/views/livewire/source/github/change.blade.php index 5b971c5f4..ea3b1e82f 100644 --- a/resources/views/livewire/source/github/change.blade.php +++ b/resources/views/livewire/source/github/change.blade.php @@ -43,40 +43,41 @@ Install Repositories on GitHub @else -
- -
-
- - -
-
- - -
-
- @if ($github_app->html_url === 'https://github.com') - - - @else - - + @if (!isCloud()) +
+ +
@endif -
-
- - -
-
- - - -
+
+ + +
+
+ + +
+
+ @if ($github_app->html_url === 'https://github.com') + + + @else + + + @endif +
+
+ + +
+
+ + + +
@endif - @else
- - + @if (!isCloud()) + + @endif + Save New Source diff --git a/resources/views/source/new.blade.php b/resources/views/source/new.blade.php index 508c0e71c..d91b3a9de 100644 --- a/resources/views/source/new.blade.php +++ b/resources/views/source/new.blade.php @@ -1,8 +1,8 @@

New Source

Add source providers for your applications.
-