This commit is contained in:
Andras Bacsai
2023-05-31 14:42:37 +02:00
parent 5b3a3edcd0
commit 25870dadd8
10 changed files with 31 additions and 15 deletions

View File

@@ -49,9 +49,10 @@ class Deploy extends Component
deployment_uuid: $this->deployment_uuid,
force_rebuild: $force,
);
return redirect()->route('project.application.deployments', [
return redirect()->route('project.application.deployment', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deployment_uuid,
'environment_name' => $this->parameters['environment_name'],
]);
}

View File

@@ -16,6 +16,7 @@ class DeploymentLogs extends Component
public $deployment_uuid;
public function polling()
{
$this->emit('deploymentFinished');
if (is_null($this->activity) && isset($this->deployment_uuid)) {
$this->activity = Activity::query()
->where('properties->type', '=', ActivityTypes::DEPLOYMENT->value)

View File

@@ -12,6 +12,11 @@ class DeploymentNavbar extends Component
public Application $application;
public $activity;
public string $deployment_uuid;
protected $listeners = ['deploymentFinished'];
public function deploymentFinished()
{
$this->activity->refresh();
}
public function cancel()
{
try {

View File

@@ -59,9 +59,10 @@ class Previews extends Component
force_rebuild: true,
pull_request_id: $pull_request_id,
);
return redirect()->route('project.application.deployments', [
return redirect()->route('project.application.deployment', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deployment_uuid,
'environment_name' => $this->parameters['environment_name'],
]);
} catch (\Throwable $th) {

View File

@@ -29,9 +29,10 @@ class Rollback extends Component
force_rebuild: false,
);
return redirect()->route('project.application.deployments', [
return redirect()->route('project.application.deployment', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $deployment_uuid,
'environment_name' => $this->parameters['environment_name'],
]);
}