mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
ability to hide tabs (#3811)
* ability to hide tabs * address review comments * address review comments * address review comments * review comments
This commit is contained in:
parent
88c480759f
commit
495f4aa19c
@ -18,6 +18,11 @@ export interface LovelaceViewConfig {
|
|||||||
theme?: string;
|
theme?: string;
|
||||||
panel?: boolean;
|
panel?: boolean;
|
||||||
background?: string;
|
background?: string;
|
||||||
|
visible?: boolean | ShowViewConfig[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ShowViewConfig {
|
||||||
|
user?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LovelaceCardConfig {
|
export interface LovelaceCardConfig {
|
||||||
|
@ -236,7 +236,20 @@ class HUIRoot extends LitElement {
|
|||||||
>
|
>
|
||||||
${this.lovelace!.config.views.map(
|
${this.lovelace!.config.views.map(
|
||||||
(view) => html`
|
(view) => html`
|
||||||
<paper-tab aria-label="${view.title}">
|
<paper-tab
|
||||||
|
aria-label="${view.title}"
|
||||||
|
class="${classMap({
|
||||||
|
"hide-tab": Boolean(
|
||||||
|
!this._editMode &&
|
||||||
|
view.visible !== undefined &&
|
||||||
|
((Array.isArray(view.visible) &&
|
||||||
|
!view.visible.some(
|
||||||
|
(e) => e.user === this.hass!.user!.id
|
||||||
|
)) ||
|
||||||
|
view.visible === false)
|
||||||
|
),
|
||||||
|
})}"
|
||||||
|
>
|
||||||
${this._editMode
|
${this._editMode
|
||||||
? html`
|
? html`
|
||||||
<ha-paper-icon-button-arrow-prev
|
<ha-paper-icon-button-arrow-prev
|
||||||
@ -392,6 +405,9 @@ class HUIRoot extends LitElement {
|
|||||||
paper-item {
|
paper-item {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.hide-tab {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user