From a7ef8aba680957eea536ac59c2ff9f3b0c56cb05 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Mon, 19 Oct 2020 22:08:35 +0200 Subject: [PATCH] Add dialog-box warning support (#7356) --- src/dialogs/generic/dialog-box.ts | 4 ++++ src/dialogs/generic/show-dialog-box.ts | 1 + src/panels/config/devices/ha-config-device-page.ts | 3 +++ src/translations/en.json | 6 +++--- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index 5df7cb4f1e..e905f0c3ff 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -70,6 +70,7 @@ class DialogBox extends LitElement {

${this._params.text} @@ -180,6 +181,9 @@ class DialogBox extends LitElement { /* Place above other dialogs */ --dialog-z-index: 104; } + .warning { + color: var(--warning-color); + } `, ]; } diff --git a/src/dialogs/generic/show-dialog-box.ts b/src/dialogs/generic/show-dialog-box.ts index 86c5cfee8b..5e965bab2f 100644 --- a/src/dialogs/generic/show-dialog-box.ts +++ b/src/dialogs/generic/show-dialog-box.ts @@ -5,6 +5,7 @@ interface BaseDialogParams { confirmText?: string; text?: string | TemplateResult; title?: string; + warning?: boolean; } export interface AlertDialogParams extends BaseDialogParams { diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 927012efe0..c1072e6b29 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -574,6 +574,9 @@ export class HaConfigDevicePage extends LitElement { text: this.hass.localize( "ui.panel.config.devices.confirm_rename_entity_ids_warning" ), + confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.no"), + warning: true, })); const updateProms = entities.map((entity) => { diff --git a/src/translations/en.json b/src/translations/en.json index 3851273f9b..417342ade0 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1648,8 +1648,8 @@ }, "scripts": "Scripts", "scenes": "Scenes", - "confirm_rename_entity_ids": "Do you also want to rename the entity id's of your entities?", - "confirm_rename_entity_ids_warning": "This will not change any configuration (like automations, scripts, scenes, Lovelace) that is currently using these entities, you will have to update them yourself.", + "confirm_rename_entity_ids": "Do you also want to rename the entity IDs of your entities?", + "confirm_rename_entity_ids_warning": "This will not change any configuration (like automations, scripts, scenes, dashboards) that is currently using these entities! You will have to update them yourself to use the new entity IDs!", "data_table": { "device": "Device", "manufacturer": "Manufacturer", @@ -2378,7 +2378,7 @@ "migrate": { "header": "Configuration Incompatible", "para_no_id": "This element doesn't have an ID. Please add an ID to this element in 'ui-lovelace.yaml'.", - "para_migrate": "Home Assistant can add ID's to all your cards and views automatically for you by pressing the 'Migrate configuration' button.", + "para_migrate": "Home Assistant can add IDs to all your cards and views automatically for you by pressing the 'Migrate configuration' button.", "migrate": "Migrate configuration" }, "action-editor": {