diff --git a/cast/src/receiver/layout/hc-main.ts b/cast/src/receiver/layout/hc-main.ts index fa84d8d2ef..cb5773b416 100644 --- a/cast/src/receiver/layout/hc-main.ts +++ b/cast/src/receiver/layout/hc-main.ts @@ -172,6 +172,9 @@ export class HcMain extends HassElement { return; } if (!this._unsubLovelace || this._urlPath !== msg.urlPath) { + if (msg.urlPath === "lovelace") { + msg.urlPath = null; + } this._urlPath = msg.urlPath; if (this._unsubLovelace) { this._unsubLovelace(); diff --git a/setup.py b/setup.py index 49a129fa48..16d97920c3 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200316.1", + version="20200318.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index 7d904c1a5f..06ea54e63a 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -37,12 +37,12 @@ class HassTabsSubpage extends LitElement { @property() public route!: Route; @property() public tabs!: PageNavigation[]; @property({ type: Boolean, reflect: true }) public narrow = false; - @property() private _activeTab: number = -1; + @property() private _activeTab?: PageNavigation; private _getTabs = memoizeOne( ( tabs: PageNavigation[], - activeTab: number, + activeTab: PageNavigation | undefined, showAdvanced: boolean | undefined, _components, _language @@ -56,31 +56,32 @@ class HassTabsSubpage extends LitElement { ); return shownTabs.map( - (page, index) => html` -
- ${this.narrow - ? html` - - ` - : ""} - ${!this.narrow || index === activeTab - ? html` - ${page.translationKey - ? this.hass.localize(page.translationKey) - : name} - ` - : ""} - -
- ` + (page) => + html` +
+ ${this.narrow + ? html` + + ` + : ""} + ${!this.narrow || page === activeTab + ? html` + ${page.translationKey + ? this.hass.localize(page.translationKey) + : name} + ` + : ""} + +
+ ` ); } ); @@ -88,7 +89,7 @@ class HassTabsSubpage extends LitElement { protected updated(changedProperties: PropertyValues) { super.updated(changedProperties); if (changedProperties.has("route")) { - this._activeTab = this.tabs.findIndex((tab) => + this._activeTab = this.tabs.find((tab) => this.route.prefix.includes(tab.path) ); } diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index d090fa0bae..1fd50e288f 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -57,8 +57,10 @@ export class DialogLovelaceDashboardDetail extends LitElement { if (!this._params) { return html``; } - const urlInvalid = !/^[a-zA-Z0-9_-]+-[a-zA-Z0-9_-]+$/.test(this._urlPath); - const titleInvalid = !this._urlPath.trim(); + const urlInvalid = + this._params.urlPath !== "lovelace" && + !/^[a-zA-Z0-9_-]+-[a-zA-Z0-9_-]+$/.test(this._urlPath); + const titleInvalid = !this._title.trim(); return html`