Merge branch 'next' into fix-unreachable-notificiations

This commit is contained in:
Andras Bacsai
2024-12-17 22:35:09 +01:00
126 changed files with 1783 additions and 1484 deletions

View File

@@ -22,6 +22,8 @@ class DeploymentFailed extends CustomEmailNotification
public string $project_uuid;
public string $environment_uuid;
public string $environment_name;
public ?string $deployment_url = null;
@@ -36,12 +38,13 @@ class DeploymentFailed extends CustomEmailNotification
$this->preview = $preview;
$this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid');
$this->environment_uuid = data_get($application, 'environment.uuid');
$this->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
}
$this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
$this->deployment_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
}
public function via(object $notifiable): array

View File

@@ -22,6 +22,8 @@ class DeploymentSuccess extends CustomEmailNotification
public string $project_uuid;
public string $environment_uuid;
public string $environment_name;
public ?string $deployment_url = null;
@@ -36,12 +38,13 @@ class DeploymentSuccess extends CustomEmailNotification
$this->preview = $preview;
$this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid');
$this->environment_uuid = data_get($application, 'environment.uuid');
$this->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
}
$this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
$this->deployment_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
}
public function via(object $notifiable): array
@@ -144,7 +147,7 @@ class DeploymentSuccess extends CustomEmailNotification
{
if ($this->preview) {
$title = "Pull request #{$this->preview->pull_request_id} successfully deployed";
$message = 'New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '';
$message = 'New PR'.$this->preview->pull_request_id.' version successfully deployed of '.$this->application_name.'';
if ($this->preview->fqdn) {
$buttons[] = [
'text' => 'Open Application',
@@ -153,7 +156,7 @@ class DeploymentSuccess extends CustomEmailNotification
}
} else {
$title = 'New version successfully deployed';
$message = 'New version successfully deployed of ' . $this->application_name . '';
$message = 'New version successfully deployed of '.$this->application_name.'';
if ($this->fqdn) {
$buttons[] = [
'text' => 'Open Application',

View File

@@ -15,6 +15,8 @@ class StatusChanged extends CustomEmailNotification
public string $project_uuid;
public string $environment_uuid;
public string $environment_name;
public ?string $resource_url = null;
@@ -26,12 +28,13 @@ class StatusChanged extends CustomEmailNotification
$this->onQueue('high');
$this->resource_name = data_get($resource, 'name');
$this->project_uuid = data_get($resource, 'environment.project.uuid');
$this->environment_uuid = data_get($resource, 'environment.uuid');
$this->environment_name = data_get($resource, 'environment.name');
$this->fqdn = data_get($resource, 'fqdn', null);
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
}
$this->resource_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->resource->uuid}";
$this->resource_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->resource->uuid}";
}
public function via(object $notifiable): array
@@ -80,7 +83,7 @@ class StatusChanged extends CustomEmailNotification
public function toPushover(): PushoverMessage
{
$message = $this->resource_name . ' has been stopped.';
$message = $this->resource_name.' has been stopped.';
return new PushoverMessage(
title: 'Application stopped',