From db8bc9d34a4d35582dd5cff38638e07a20a2b1bd Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 22 Sep 2022 15:22:20 +0200 Subject: [PATCH] Update delete automation dialog (#13765) --- src/panels/config/automation/ha-automation-editor.ts | 7 ++++++- src/panels/config/automation/ha-automation-picker.ts | 7 ++++++- src/translations/en.json | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 627a052450..e7c7236fd3 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -575,10 +575,15 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { private async _deleteConfirm() { showConfirmationDialog(this, { + title: this.hass.localize( + "ui.panel.config.automation.picker.delete_confirm_title" + ), text: this.hass.localize( - "ui.panel.config.automation.picker.delete_confirm" + "ui.panel.config.automation.picker.delete_confirm_text", + { name: this._config?.alias } ), confirmText: this.hass!.localize("ui.common.delete"), + destructive: true, dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(), }); diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index dc395aefaf..3fe409f34b 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -341,12 +341,17 @@ class HaAutomationPicker extends LitElement { private async _deleteConfirm(automation) { showConfirmationDialog(this, { + title: this.hass.localize( + "ui.panel.config.automation.picker.delete_confirm_title" + ), text: this.hass.localize( - "ui.panel.config.automation.picker.delete_confirm" + "ui.panel.config.automation.picker.delete_confirm_text", + { name: automation.name } ), confirmText: this.hass!.localize("ui.common.delete"), dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(automation), + destructive: true, }); } diff --git a/src/translations/en.json b/src/translations/en.json index 45cbcfcaba..2629fdf097 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1796,7 +1796,8 @@ "dev_automation": "Debug automation", "show_info_automation": "Show info about automation", "delete": "[%key:ui::common::delete%]", - "delete_confirm": "Are you sure you want to delete this automation?", + "delete_confirm_title": "Delete automation?", + "delete_confirm_text": "{name} will be permanently deleted.", "duplicate": "[%key:ui::common::duplicate%]", "disabled": "Disabled", "headers": {