diff --git a/app/Http/Livewire/Project/Application/Previews.php b/app/Http/Livewire/Project/Application/Previews.php index cb908ff2a..86024aec7 100644 --- a/app/Http/Livewire/Project/Application/Previews.php +++ b/app/Http/Livewire/Project/Application/Previews.php @@ -39,9 +39,9 @@ class Previews extends Component { ['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = get_from_git_api($this->application->source, "/repos/{$this->application->git_repository}/pulls"); $this->rate_limit_remaining = $rate_limit_remaining; - $this->pull_requests = $data; + $this->pull_requests = $data->sortBy('number')->values(); } - public function deploy(int $pull_request_id) + public function deploy(int $pull_request_id, string|null $pull_request_html_url) { try { $this->set_deployment_uuid(); @@ -50,6 +50,7 @@ class Previews extends Component ApplicationPreview::create([ 'application_id' => $this->application->id, 'pull_request_id' => $pull_request_id, + 'pull_request_html_url' => $pull_request_html_url ]); } queue_application_deployment( @@ -58,6 +59,11 @@ class Previews extends Component force_rebuild: true, pull_request_id: $pull_request_id, ); + return redirect()->route('project.application.deployments', [ + 'project_uuid' => $this->parameters['project_uuid'], + 'application_uuid' => $this->parameters['application_uuid'], + 'environment_name' => $this->parameters['environment_name'], + ]); } catch (\Throwable $th) { return general_error_handler($th, $this); } diff --git a/app/Models/ApplicationPreview.php b/app/Models/ApplicationPreview.php index d7975ec9c..f442fe3cd 100644 --- a/app/Models/ApplicationPreview.php +++ b/app/Models/ApplicationPreview.php @@ -7,6 +7,7 @@ class ApplicationPreview extends BaseModel protected $fillable = [ 'uuid', 'pull_request_id', + 'pull_request_html_url', 'fqdn', 'status', 'application_id', diff --git a/database/migrations/2023_03_27_081718_create_application_previews_table.php b/database/migrations/2023_03_27_081718_create_application_previews_table.php index 73346268c..2900b5791 100644 --- a/database/migrations/2023_03_27_081718_create_application_previews_table.php +++ b/database/migrations/2023_03_27_081718_create_application_previews_table.php @@ -15,6 +15,7 @@ return new class extends Migration $table->id(); $table->string('uuid')->unique(); $table->integer('pull_request_id'); + $table->string('pull_request_html_url'); $table->string('fqdn')->unique()->nullable(); $table->string('status')->default('exited'); diff --git a/resources/css/app.css b/resources/css/app.css index 31f2eb8b4..a404b41bb 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -40,10 +40,10 @@ select { @apply text-warning opacity-100; } button[type="button"] { - @apply btn btn-xs bg-coolgray-200 no-animation normal-case text-white rounded-none; + @apply btn btn-xs mt-1 bg-coolgray-200 no-animation normal-case text-white rounded; } button[type="submit"] { - @apply btn btn-xs no-animation normal-case text-white btn-primary rounded-none; + @apply btn btn-xs mt-1 no-animation normal-case text-white btn-primary rounded; } button[isWarning] { @apply text-error; @@ -74,7 +74,7 @@ a { @apply text-white; } .box { - @apply flex items-center justify-center text-sm rounded-none cursor-pointer h-14 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors; + @apply flex items-center justify-center text-sm rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors; } .main-menu { diff --git a/resources/views/components/applications/navbar.blade.php b/resources/views/components/applications/navbar.blade.php index 60e5e4084..91df84ea1 100644 --- a/resources/views/components/applications/navbar.blade.php +++ b/resources/views/components/applications/navbar.blade.php @@ -1,4 +1,4 @@ -