mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 20:56:36 +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;
|
||||
panel?: boolean;
|
||||
background?: string;
|
||||
visible?: boolean | ShowViewConfig[];
|
||||
}
|
||||
|
||||
export interface ShowViewConfig {
|
||||
user?: string;
|
||||
}
|
||||
|
||||
export interface LovelaceCardConfig {
|
||||
|
@ -236,7 +236,20 @@ class HUIRoot extends LitElement {
|
||||
>
|
||||
${this.lovelace!.config.views.map(
|
||||
(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
|
||||
? html`
|
||||
<ha-paper-icon-button-arrow-prev
|
||||
@ -392,6 +405,9 @@ class HUIRoot extends LitElement {
|
||||
paper-item {
|
||||
cursor: pointer;
|
||||
}
|
||||
.hide-tab {
|
||||
display: none;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user