mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-02 00:27:49 +01:00
Use show in sidebar property instead of checking title (#29815)
This commit is contained in:
@@ -144,6 +144,7 @@ export const computePanels = memoizeOne(
|
||||
if (
|
||||
!isDefaultPanel &&
|
||||
(!panel.title ||
|
||||
panel.show_in_sidebar === false ||
|
||||
hiddenPanels.includes(panel.url_path) ||
|
||||
(panel.default_visible === false &&
|
||||
!panelsOrder.includes(panel.url_path)))
|
||||
|
||||
@@ -344,7 +344,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
||||
const item: DataTableItem = {
|
||||
icon: getPanelIcon(panelInfo),
|
||||
title: getPanelTitle(this.hass, panelInfo) || panelInfo.url_path,
|
||||
show_in_sidebar: panelInfo.title != null,
|
||||
show_in_sidebar: panelInfo.show_in_sidebar || false,
|
||||
mode: "storage",
|
||||
url_path: panelInfo.url_path,
|
||||
filename: "",
|
||||
@@ -487,7 +487,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
||||
title: getPanelTitle(this.hass, panelInfo) || panelInfo.url_path,
|
||||
icon: getPanelIcon(panelInfo),
|
||||
requireAdmin: panelInfo.require_admin || false,
|
||||
showInSidebar: panelInfo.title != null,
|
||||
showInSidebar: panelInfo.show_in_sidebar || false,
|
||||
isDefault: panelInfo.url_path === defaultPanel,
|
||||
updatePanel: async (values) => {
|
||||
await updatePanel(this.hass!, panelInfo.url_path, values);
|
||||
|
||||
@@ -142,6 +142,7 @@ export interface PanelInfo<T = Record<string, any> | null> {
|
||||
config_panel_domain?: string;
|
||||
default_visible?: boolean;
|
||||
require_admin?: boolean;
|
||||
show_in_sidebar?: boolean;
|
||||
}
|
||||
|
||||
export type Panels = Record<string, PanelInfo>;
|
||||
|
||||
Reference in New Issue
Block a user