From c3ef79caa9651cfde89cf3494921ec1bdd490d75 Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Mon, 24 Aug 2020 13:20:32 +0100 Subject: [PATCH] Improve messaging of empty device info cards (#6628) --- .../config/devices/ha-config-device-page.ts | 42 +++++++++++++------ src/translations/en.json | 1 + 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index dbc73f7bf8..e3577eb5dd 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -308,11 +308,15 @@ export class HaConfigDevicePage extends LitElement { : ""; }) : html` - ${this.hass.localize( - "ui.panel.config.devices.automation.no_automations" - )} + + ${this.hass.localize( + "ui.panel.config.devices.add_prompt", + "name", + this.hass.localize( + "ui.panel.config.devices.automation.automations" + ) + )} + `} ` @@ -376,11 +380,15 @@ export class HaConfigDevicePage extends LitElement { : ""; }) : html` - ${this.hass.localize( - "ui.panel.config.devices.scene.no_scenes" - )} + + ${this.hass.localize( + "ui.panel.config.devices.add_prompt", + "name", + this.hass.localize( + "ui.panel.config.devices.scene.scenes" + ) + )} + ` } @@ -429,9 +437,13 @@ export class HaConfigDevicePage extends LitElement { : html` ${this.hass.localize( - "ui.panel.config.devices.script.no_scripts" - )} + "ui.panel.config.devices.add_prompt", + "name", + this.hass.localize( + "ui.panel.config.devices.script.scripts" + ) + )} + `} ` @@ -706,6 +718,10 @@ export class HaConfigDevicePage extends LitElement { color: var(--primary-color); } + ha-card { + padding-bottom: 8px; + } + ha-card a { color: var(--primary-text-color); } diff --git a/src/translations/en.json b/src/translations/en.json index 7b020a8164..0e9d097214 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1376,6 +1376,7 @@ } }, "devices": { + "add_prompt": "No {name} have been added using this device yet. You can add one by clicking the + button above.", "caption": "Devices", "description": "Manage connected devices", "device_info": "Device info",