diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php index 995428e1a..9fd00d84b 100644 --- a/app/Http/Livewire/Source/Github/Change.php +++ b/app/Http/Livewire/Source/Github/Change.php @@ -14,7 +14,6 @@ class Change extends Component public string|null $fqdn; public $parameters; public GithubApp $github_app; - public string $installation_url; public string $name; public bool $is_system_wide; diff --git a/bootstrap/helpers/github.php b/bootstrap/helpers/github.php index 7ba4ac076..f282ee6f1 100644 --- a/bootstrap/helpers/github.php +++ b/bootstrap/helpers/github.php @@ -2,7 +2,7 @@ use App\Models\GithubApp; use App\Models\GitlabApp; -use Illuminate\Support\Collection; +use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Lcobucci\JWT\Encoding\ChainedFormatter; use Lcobucci\JWT\Encoding\JoseEncoder; @@ -71,3 +71,10 @@ function git_api(GithubApp|GitlabApp $source, string $endpoint, string $method = 'data' => collect($json) ]; } +function get_installation_path(GithubApp $source) +{ + $github = GithubApp::where('uuid', $source->uuid)->first(); + $name = Str::of(Str::kebab($github->name)); + $installation_path = $github->html_url === 'https://github.com' ? 'apps' : 'github-apps'; + return "$github->html_url/$installation_path/$name/installations/new"; +} diff --git a/resources/views/livewire/project/application/source.blade.php b/resources/views/livewire/project/application/source.blade.php index 0b2dd384f..24fc44e08 100644 --- a/resources/views/livewire/project/application/source.blade.php +++ b/resources/views/livewire/project/application/source.blade.php @@ -5,15 +5,23 @@ Save - Open Repository on Git + Open Repository + @if (!$application->source->is_public) + + + Open Git App + + + + @endif
Code source of your application.
-