From 495f4aa19c0fe365c55e49c76f5a3eee836900ab Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Fri, 11 Oct 2019 06:14:34 -0500 Subject: [PATCH] ability to hide tabs (#3811) * ability to hide tabs * address review comments * address review comments * address review comments * review comments --- src/data/lovelace.ts | 5 +++++ src/panels/lovelace/hui-root.ts | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/data/lovelace.ts b/src/data/lovelace.ts index 103b1d147f..5f32b70b4b 100644 --- a/src/data/lovelace.ts +++ b/src/data/lovelace.ts @@ -18,6 +18,11 @@ export interface LovelaceViewConfig { theme?: string; panel?: boolean; background?: string; + visible?: boolean | ShowViewConfig[]; +} + +export interface ShowViewConfig { + user?: string; } export interface LovelaceCardConfig { diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index e01f7ddfe1..1f099a1364 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -236,7 +236,20 @@ class HUIRoot extends LitElement { > ${this.lovelace!.config.views.map( (view) => html` - + e.user === this.hass!.user!.id + )) || + view.visible === false) + ), + })}" + > ${this._editMode ? html`