rename stopped to status_changes

This commit is contained in:
Andras Bacsai 2023-07-26 15:32:46 +02:00
parent 8d8dcb1a3e
commit e7d019028a
5 changed files with 8 additions and 6 deletions

View File

@ -14,7 +14,7 @@ class DiscordSettings extends Component
'model.discord.webhook_url' => 'required|url',
'model.discord_notifications.test' => 'nullable|boolean',
'model.discord_notifications.deployments' => 'nullable|boolean',
'model.discord_notifications.stopped' => 'nullable|boolean',
'model.discord_notifications.status_changes' => 'nullable|boolean',
];
protected $validationAttributes = [
'model.discord.webhook_url' => 'Discord Webhook',

View File

@ -25,7 +25,7 @@ class EmailSettings extends Component
'model.smtp.test_recipients' => 'nullable',
'model.smtp_notifications.test' => 'nullable|boolean',
'model.smtp_notifications.deployments' => 'nullable|boolean',
'model.smtp_notifications.stopped' => 'nullable|boolean',
'model.smtp_notifications.status_changes' => 'nullable|boolean',
];
protected $validationAttributes = [
'model.smtp.from_address' => 'From Address',

View File

@ -40,8 +40,8 @@ public function via(object $notifiable): array
$channels = [];
$isEmailEnabled = data_get($notifiable, 'smtp.enabled');
$isDiscordEnabled = data_get($notifiable, 'discord.enabled');
$isSubscribedToEmailEvent = data_get($notifiable, 'smtp_notifications.stopped');
$isSubscribedToDiscordEvent = data_get($notifiable, 'discord_notifications.stopped');
$isSubscribedToEmailEvent = data_get($notifiable, 'smtp_notifications.status_changes');
$isSubscribedToDiscordEvent = data_get($notifiable, 'discord_notifications.status_changes');
if ($isEmailEnabled && $isSubscribedToEmailEvent) {
$channels[] = EmailChannel::class;

View File

@ -29,7 +29,8 @@
<h5 class="mt-4">Applications</h5>
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications.deployments"
label="New Deployment" />
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications.stopped" label="Stopped" />
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications.status_changes"
label="Status Changes" />
</div>
@endif
</div>

View File

@ -56,7 +56,8 @@
<h5 class="mt-4">Applications</h5>
<x-forms.checkbox instantSave="saveModel" id="model.smtp_notifications.deployments"
label="New Deployment" />
<x-forms.checkbox instantSave="saveModel" id="model.smtp_notifications.stopped" label="Stopped" />
<x-forms.checkbox instantSave="saveModel" id="model.smtp_notifications.status_changes"
label="Status Changes" />
</div>
@endif
</div>