From 1d97d8dca907f61d623a7654ec24907d93904c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 1 Dec 2021 08:30:38 +0100 Subject: [PATCH] Handle 0 updates and show back on supervisor panels (#10744) --- hassio/src/backups/hassio-backups.ts | 3 ++- hassio/src/dashboard/hassio-dashboard.ts | 3 ++- hassio/src/system/hassio-system.ts | 4 +++- src/panels/config/dashboard/ha-config-dashboard.ts | 4 ++-- src/panels/config/dashboard/ha-config-updates.ts | 2 +- src/panels/config/ha-panel-config.ts | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hassio/src/backups/hassio-backups.ts b/hassio/src/backups/hassio-backups.ts index 31b136ed04..2901549ae8 100644 --- a/hassio/src/backups/hassio-backups.ts +++ b/hassio/src/backups/hassio-backups.ts @@ -173,7 +173,8 @@ export class HassioBackups extends LitElement { clickable selectable hasFab - main-page + .mainPage=${!atLeastVersion(this.hass.config.version, 2021, 12)} + back-path="/config" supervisor > diff --git a/hassio/src/system/hassio-system.ts b/hassio/src/system/hassio-system.ts index 60b9b4e218..bbf3d72758 100644 --- a/hassio/src/system/hassio-system.ts +++ b/hassio/src/system/hassio-system.ts @@ -1,5 +1,6 @@ import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; +import { atLeastVersion } from "../../../src/common/config/version"; import { Supervisor } from "../../../src/data/supervisor/supervisor"; import "../../../src/layouts/hass-tabs-subpage"; import { haStyle } from "../../../src/resources/styles"; @@ -29,7 +30,8 @@ class HassioSystem extends LitElement { .narrow=${this.narrow} .route=${this.route} .tabs=${supervisorTabs(this.hass)} - main-page + .mainPage=${!atLeastVersion(this.hass.config.version, 2021, 12)} + back-path="/config" supervisor > ${this.supervisor.localize("panel.system")} diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 69763fd558..86b38815de 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -76,7 +76,7 @@ class HaConfigDashboard extends LitElement { ${isComponentLoaded(this.hass, "hassio") && this.supervisorUpdates === undefined ? html`` - : html`${this.supervisorUpdates !== null + : html`${this.supervisorUpdates?.length ? html` ` : ""} - ${this.narrow && this.supervisorUpdates !== null + ${this.narrow && this.supervisorUpdates?.length ? html`
${this.hass.localize("panel.config")}
` diff --git a/src/panels/config/dashboard/ha-config-updates.ts b/src/panels/config/dashboard/ha-config-updates.ts index e1c35f3418..264bd253c6 100644 --- a/src/panels/config/dashboard/ha-config-updates.ts +++ b/src/panels/config/dashboard/ha-config-updates.ts @@ -29,7 +29,7 @@ class HaConfigUpdates extends LitElement { @state() private _showAll = false; protected render(): TemplateResult { - if (!this.supervisorUpdates) { + if (!this.supervisorUpdates?.length) { return html``; } diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index f3dbc1e2a9..902b2a495d 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -64,7 +64,7 @@ export const configSections: { [name: string]: PageNavigation[] } = { }, { path: "/config/helpers", - name: "Helpers", + name: "Automation Helpers", description: "Elements that help build automations", iconPath: mdiTools, iconColor: "#4D2EA4",