new notification links

This commit is contained in:
peaklabs-dev
2024-11-22 16:05:24 +01:00
parent 277fd78769
commit 75491098a0
3 changed files with 12 additions and 4 deletions

View File

@@ -26,6 +26,8 @@ class DeploymentFailed extends Notification implements ShouldQueue
public string $project_uuid; public string $project_uuid;
public string $environment_uuid;
public string $environment_name; public string $environment_name;
public ?string $deployment_url = null; public ?string $deployment_url = null;
@@ -40,12 +42,13 @@ class DeploymentFailed extends Notification implements ShouldQueue
$this->preview = $preview; $this->preview = $preview;
$this->application_name = data_get($application, 'name'); $this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid'); $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->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn'); $this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) { if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first(); $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 public function via(object $notifiable): array

View File

@@ -26,6 +26,8 @@ class DeploymentSuccess extends Notification implements ShouldQueue
public string $project_uuid; public string $project_uuid;
public string $environment_uuid;
public string $environment_name; public string $environment_name;
public ?string $deployment_url = null; public ?string $deployment_url = null;
@@ -40,12 +42,13 @@ class DeploymentSuccess extends Notification implements ShouldQueue
$this->preview = $preview; $this->preview = $preview;
$this->application_name = data_get($application, 'name'); $this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid'); $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->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn'); $this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) { if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first(); $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 public function via(object $notifiable): array

View File

@@ -19,6 +19,8 @@ class StatusChanged extends Notification implements ShouldQueue
public string $project_uuid; public string $project_uuid;
public string $environment_uuid;
public string $environment_name; public string $environment_name;
public ?string $resource_url = null; public ?string $resource_url = null;
@@ -30,12 +32,12 @@ class StatusChanged extends Notification implements ShouldQueue
$this->onQueue('high'); $this->onQueue('high');
$this->resource_name = data_get($resource, 'name'); $this->resource_name = data_get($resource, 'name');
$this->project_uuid = data_get($resource, 'environment.project.uuid'); $this->project_uuid = data_get($resource, 'environment.project.uuid');
$this->environment_name = data_get($resource, 'environment.name'); $this->environment_uuid = data_get($resource, 'environment.uuid');
$this->fqdn = data_get($resource, 'fqdn', null); $this->fqdn = data_get($resource, 'fqdn', null);
if (str($this->fqdn)->explode(',')->count() > 1) { if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first(); $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 public function via(object $notifiable): array