updates
This commit is contained in:
@@ -15,16 +15,12 @@ class DiscordSettings extends Component
|
||||
protected $rules = [
|
||||
'model.extra_attributes.discord_active' => 'nullable|boolean',
|
||||
'model.extra_attributes.discord_webhook' => 'required|url',
|
||||
'model.extra_attributes.notifications_test' => 'nullable|boolean',
|
||||
'model.extra_attributes.notifications_deployments' => 'nullable|boolean',
|
||||
'model.extra_attributes.notifications_discord_test' => 'nullable|boolean',
|
||||
'model.extra_attributes.notifications_discord_deployments' => 'nullable|boolean',
|
||||
];
|
||||
protected $validationAttributes = [
|
||||
'model.extra_attributes.discord_webhook' => 'Discord Webhook',
|
||||
];
|
||||
public function instantSaveEvents()
|
||||
{
|
||||
$this->saveModel();
|
||||
}
|
||||
public function instantSave()
|
||||
{
|
||||
try {
|
||||
@@ -34,7 +30,7 @@ class DiscordSettings extends Component
|
||||
$this->validate();
|
||||
}
|
||||
}
|
||||
private function saveModel()
|
||||
public function saveModel()
|
||||
{
|
||||
$this->model->save();
|
||||
if (is_a($this->model, Team::class)) {
|
||||
|
||||
@@ -24,8 +24,8 @@ class EmailSettings extends Component
|
||||
'model.extra_attributes.smtp_password' => 'nullable',
|
||||
'model.extra_attributes.smtp_timeout' => 'nullable',
|
||||
'model.extra_attributes.smtp_test_recipients' => 'nullable',
|
||||
'model.extra_attributes.notifications_deployments' => 'nullable|boolean',
|
||||
'model.extra_attributes.notifications_test' => 'nullable|boolean',
|
||||
'model.extra_attributes.notifications_email_test' => 'nullable|boolean',
|
||||
'model.extra_attributes.notifications_email_deployments' => 'nullable|boolean',
|
||||
];
|
||||
protected $validationAttributes = [
|
||||
'model.extra_attributes.smtp_from_address' => 'From Address',
|
||||
@@ -62,7 +62,7 @@ class EmailSettings extends Component
|
||||
$this->model->extra_attributes->smtp_test_recipients = str_replace(' ', '', $this->model->extra_attributes->smtp_test_recipients);
|
||||
$this->saveModel();
|
||||
}
|
||||
private function saveModel()
|
||||
public function saveModel()
|
||||
{
|
||||
$this->model->save();
|
||||
if (is_a($this->model, Team::class)) {
|
||||
@@ -73,10 +73,7 @@ class EmailSettings extends Component
|
||||
public function sendTestNotification()
|
||||
{
|
||||
Notification::send($this->model, new TestNotification);
|
||||
}
|
||||
public function instantSaveEvents()
|
||||
{
|
||||
$this->saveModel();
|
||||
$this->emit('success', 'Test notification sent.');
|
||||
}
|
||||
public function instantSave()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user