From 75491098a0bd3ba07d198c89d014af75e5b20899 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:05:24 +0100 Subject: [PATCH] new notification links --- app/Notifications/Application/DeploymentFailed.php | 5 ++++- app/Notifications/Application/DeploymentSuccess.php | 5 ++++- app/Notifications/Application/StatusChanged.php | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Notifications/Application/DeploymentFailed.php b/app/Notifications/Application/DeploymentFailed.php index fae8951fd..191f7bd2e 100644 --- a/app/Notifications/Application/DeploymentFailed.php +++ b/app/Notifications/Application/DeploymentFailed.php @@ -26,6 +26,8 @@ class DeploymentFailed extends Notification implements ShouldQueue public string $project_uuid; + public string $environment_uuid; + public string $environment_name; public ?string $deployment_url = null; @@ -40,12 +42,13 @@ class DeploymentFailed extends Notification implements ShouldQueue $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 diff --git a/app/Notifications/Application/DeploymentSuccess.php b/app/Notifications/Application/DeploymentSuccess.php index bfdef9f25..05e3048c5 100644 --- a/app/Notifications/Application/DeploymentSuccess.php +++ b/app/Notifications/Application/DeploymentSuccess.php @@ -26,6 +26,8 @@ class DeploymentSuccess extends Notification implements ShouldQueue public string $project_uuid; + public string $environment_uuid; + public string $environment_name; public ?string $deployment_url = null; @@ -40,12 +42,13 @@ class DeploymentSuccess extends Notification implements ShouldQueue $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 diff --git a/app/Notifications/Application/StatusChanged.php b/app/Notifications/Application/StatusChanged.php index 3b062effb..be18b800b 100644 --- a/app/Notifications/Application/StatusChanged.php +++ b/app/Notifications/Application/StatusChanged.php @@ -19,6 +19,8 @@ class StatusChanged extends Notification implements ShouldQueue public string $project_uuid; + public string $environment_uuid; + public string $environment_name; public ?string $resource_url = null; @@ -30,12 +32,12 @@ class StatusChanged extends Notification implements ShouldQueue $this->onQueue('high'); $this->resource_name = data_get($resource, 'name'); $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); 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