Add dialog-box warning support (#7356)

This commit is contained in:
Philip Allgaier 2020-10-19 22:08:35 +02:00 committed by GitHub
parent 3ee4c11a99
commit a7ef8aba68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -70,6 +70,7 @@ class DialogBox extends LitElement {
<p
class=${classMap({
"no-bottom-padding": Boolean(this._params.prompt),
warning: Boolean(this._params.warning),
})}
>
${this._params.text}
@ -180,6 +181,9 @@ class DialogBox extends LitElement {
/* Place above other dialogs */
--dialog-z-index: 104;
}
.warning {
color: var(--warning-color);
}
`,
];
}

View File

@ -5,6 +5,7 @@ interface BaseDialogParams {
confirmText?: string;
text?: string | TemplateResult;
title?: string;
warning?: boolean;
}
export interface AlertDialogParams extends BaseDialogParams {

View File

@ -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) => {

View File

@ -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": {