From c1caad6d43fb13c4035d6cd816f4f6af8b7d47b7 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 28 Jan 2021 20:16:00 +0100 Subject: [PATCH] hide config links in demo (#8267) --- src/dialogs/more-info/ha-more-info-dialog.ts | 3 ++ src/panels/lovelace/hui-root.ts | 53 +++++++++++--------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 5e58c4e013..0e57bc9112 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -78,6 +78,9 @@ export class MoreInfoDialog extends LitElement { } protected shouldShowEditIcon(domain, stateObj): boolean { + if (__DEMO__) { + return false; + } if (EDITABLE_DOMAINS_WITH_ID.includes(domain) && stateObj.attributes.id) { return true; } diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 4e166c0dd5..30aac3d42f 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -189,30 +189,6 @@ class HUIRoot extends LitElement { )} `} - - - ${this.hass!.localize( - "ui.panel.lovelace.editor.menu.manage_dashboards" - )} - - - - ${this.hass!.localize( - "ui.panel.lovelace.editor.menu.manage_resources" - )} - + ${__DEMO__ /* No config available in the demo */ + ? "" + : html` + + ${this.hass!.localize( + "ui.panel.lovelace.editor.menu.manage_dashboards" + )} + + ${this.hass.userData?.showAdvanced + ? html` + + ${this.hass!.localize( + "ui.panel.lovelace.editor.menu.manage_resources" + )} + ` + : ""} `} `