refactor
This commit is contained in:
@@ -4,7 +4,7 @@ namespace App\Http\Livewire\Application;
|
||||
|
||||
use App\Jobs\ApplicationContainerStatusJob;
|
||||
use App\Models\Application;
|
||||
use App\Notifications\Notifications\Application\ApplicationStoppedNotification;
|
||||
use App\Notifications\Application\StatusChanged;
|
||||
use Livewire\Component;
|
||||
use Visus\Cuid2\Cuid2;
|
||||
|
||||
@@ -55,11 +55,11 @@ class Heading extends Component
|
||||
);
|
||||
$this->application->status = 'stopped';
|
||||
$this->application->save();
|
||||
$this->application->environment->project->team->notify(new ApplicationStoppedNotification($this->application));
|
||||
$this->application->environment->project->team->notify(new StatusChanged($this->application));
|
||||
}
|
||||
protected function setDeploymentUuid()
|
||||
{
|
||||
$this->deploymentUuid = new Cuid2(7);
|
||||
$this->parameters['deployment_uuid'] = $this->deploymentUuid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Livewire\Notifications;
|
||||
|
||||
use App\Models\Team;
|
||||
use App\Notifications\Notifications\TestNotification;
|
||||
use App\Notifications\Test;
|
||||
use Livewire\Component;
|
||||
|
||||
class DiscordSettings extends Component
|
||||
@@ -46,7 +46,7 @@ class DiscordSettings extends Component
|
||||
}
|
||||
public function sendTestNotification()
|
||||
{
|
||||
$this->model->notify(new TestNotification('discord'));
|
||||
$this->model->notify(new Test);
|
||||
$this->emit('success', 'Test notification sent.');
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,13 @@ namespace App\Http\Livewire\Notifications;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\Team;
|
||||
use App\Notifications\Notifications\TestNotification;
|
||||
use App\Notifications\Test;
|
||||
use Livewire\Component;
|
||||
|
||||
class EmailSettings extends Component
|
||||
{
|
||||
public Team $model;
|
||||
public string $emails;
|
||||
|
||||
protected $rules = [
|
||||
'model.smtp_enabled' => 'nullable|boolean',
|
||||
@@ -48,6 +49,7 @@ class EmailSettings extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->decrypt();
|
||||
$this->emails = auth()->user()->email;
|
||||
}
|
||||
public function copyFromInstanceSettings()
|
||||
{
|
||||
@@ -93,8 +95,8 @@ class EmailSettings extends Component
|
||||
}
|
||||
public function sendTestNotification()
|
||||
{
|
||||
$this->model->notify(new TestNotification('smtp'));
|
||||
$this->emit('success', 'Test notification sent.');
|
||||
$this->model->notify(new Test($this->emails));
|
||||
$this->emit('success', 'Test Email sent successfully.');
|
||||
}
|
||||
public function instantSave()
|
||||
{
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Http\Livewire\Settings;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Notifications\TransactionalEmails\TestEmail;
|
||||
use App\Notifications\TransactionalEmails\Test;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Component;
|
||||
|
||||
class Email extends Component
|
||||
{
|
||||
public InstanceSettings $settings;
|
||||
|
||||
public string $emails;
|
||||
protected $rules = [
|
||||
'settings.smtp_enabled' => 'nullable|boolean',
|
||||
'settings.smtp_host' => 'required',
|
||||
@@ -35,6 +35,7 @@ class Email extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->decrypt();
|
||||
$this->emails = auth()->user()->email;
|
||||
}
|
||||
public function instantSave()
|
||||
{
|
||||
@@ -46,9 +47,9 @@ class Email extends Component
|
||||
$this->validate();
|
||||
}
|
||||
}
|
||||
public function testNotification()
|
||||
public function sendTestNotification()
|
||||
{
|
||||
$this->settings->notify(new TestEmail);
|
||||
$this->settings->notify(new Test($this->emails));
|
||||
$this->emit('success', 'Test email sent.');
|
||||
}
|
||||
private function decrypt()
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Http\Livewire\Team;
|
||||
|
||||
use App\Models\TeamInvitation;
|
||||
use App\Models\User;
|
||||
use App\Notifications\TransactionalEmails\InvitationLinkEmail;
|
||||
use App\Notifications\TransactionalEmails\InvitationLink;
|
||||
use Livewire\Component;
|
||||
use Visus\Cuid2\Cuid2;
|
||||
|
||||
@@ -58,7 +58,7 @@ class InviteLink extends Component
|
||||
'via' => $isEmail ? 'email' : 'link',
|
||||
]);
|
||||
if ($isEmail) {
|
||||
$user->first()->notify(new InvitationLinkEmail());
|
||||
$user->first()->notify(new InvitationLink);
|
||||
$this->emit('success', 'Invitation sent via email successfully.');
|
||||
} else {
|
||||
$this->emit('success', 'Invitation link generated.');
|
||||
@@ -76,4 +76,4 @@ class InviteLink extends Component
|
||||
{
|
||||
$this->generate_invite_link();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user