From d3222f8bb0b76d7d888366a1e70369553a565ef9 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:15:01 +0200 Subject: [PATCH] Various fixes in dialogs (#20935) * allow escape and scrim action for repair dialogs * improve delete entity dialogs * reiterate refresh token dialog wordings (kept refresh token for now) * improve device delete dialogs * Improve deletable text and invalidation --- .../config/devices/ha-config-device-page.ts | 3 +++ .../settings/entity-settings-helper-tab.ts | 3 +++ .../config/entities/entity-registry-settings.ts | 3 +++ src/panels/config/entities/ha-config-entities.ts | 16 +++++++--------- .../config/repairs/dialog-integration-startup.ts | 2 -- .../config/repairs/dialog-system-information.ts | 2 -- src/panels/profile/ha-refresh-tokens-card.ts | 2 +- src/translations/en.json | 16 ++++++++-------- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 35590f6ffd2b..7b3849ec665a 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -1028,6 +1028,9 @@ export class HaConfigDevicePage extends LitElement { : this.hass.localize( `ui.panel.config.devices.confirm_delete` ), + confirmText: this.hass.localize("ui.common.delete"), + dismissText: this.hass.localize("ui.common.cancel"), + destructive: true, }); if (!confirmed) { diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index 52a617c2716b..59b425b47d7a 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -164,6 +164,9 @@ export class EntitySettingsHelperTab extends LitElement { text: this.hass.localize( "ui.dialogs.entity_registry.editor.confirm_delete" ), + confirmText: this.hass.localize("ui.common.delete"), + dismissText: this.hass.localize("ui.common.cancel"), + destructive: true, })) ) { return; diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index ebb1f5f1b948..875dbabda93f 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -215,6 +215,9 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { text: this.hass.localize( "ui.dialogs.entity_registry.editor.confirm_delete" ), + confirmText: this.hass.localize("ui.common.delete"), + dismissText: this.hass.localize("ui.common.cancel"), + destructive: true, })) ) { return; diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 07d756fe40f9..0eeeac1a5137 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -839,7 +839,7 @@ ${ >
${this.hass.localize( - "ui.panel.config.entities.picker.remove_selected.button" + "ui.panel.config.entities.picker.delete_selected.button" )}
@@ -1256,25 +1256,23 @@ ${rejected }); showConfirmationDialog(this, { title: this.hass.localize( - `ui.panel.config.entities.picker.remove_selected.confirm_${ - removeableEntities.length !== this._selected.length ? "partly_" : "" - }title`, - { number: removeableEntities.length } + `ui.panel.config.entities.picker.delete_selected.confirm_title` ), text: removeableEntities.length === this._selected.length ? this.hass.localize( - "ui.panel.config.entities.picker.remove_selected.confirm_text" + "ui.panel.config.entities.picker.delete_selected.confirm_text" ) : this.hass.localize( - "ui.panel.config.entities.picker.remove_selected.confirm_partly_text", + "ui.panel.config.entities.picker.delete_selected.confirm_partly_text", { - removable: removeableEntities.length, + deletable: removeableEntities.length, selected: this._selected.length, } ), - confirmText: this.hass.localize("ui.common.remove"), + confirmText: this.hass.localize("ui.common.delete"), dismissText: this.hass.localize("ui.common.cancel"), + destructive: true, confirm: () => { removeableEntities.forEach((entity) => removeEntityRegistryEntry(this.hass, entity) diff --git a/src/panels/config/repairs/dialog-integration-startup.ts b/src/panels/config/repairs/dialog-integration-startup.ts index f9a78d2806fe..a0786f13c778 100644 --- a/src/panels/config/repairs/dialog-integration-startup.ts +++ b/src/panels/config/repairs/dialog-integration-startup.ts @@ -31,8 +31,6 @@ class DialogIntegrationStartup extends LitElement { return html`