hide config links in demo (#8267)

This commit is contained in:
Bram Kragten 2021-01-28 20:16:00 +01:00 committed by GitHub
parent a653bf5b0d
commit c1caad6d43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 24 deletions

View File

@ -78,6 +78,9 @@ export class MoreInfoDialog extends LitElement {
}
protected shouldShowEditIcon(domain, stateObj): boolean {
if (__DEMO__) {
return false;
}
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) && stateObj.attributes.id) {
return true;
}

View File

@ -189,30 +189,6 @@ class HUIRoot extends LitElement {
)}
</mwc-list-item>
`}
<mwc-list-item
graphic="icon"
@request-selected="${this._handleManageDashboards}"
>
<ha-svg-icon
slot="graphic"
.path=${mdiViewDashboard}
></ha-svg-icon>
${this.hass!.localize(
"ui.panel.lovelace.editor.menu.manage_dashboards"
)}
</mwc-list-item>
<mwc-list-item
graphic="icon"
@request-selected="${this._handleManageResources}"
>
<ha-svg-icon
slot="graphic"
.path=${mdiFileMultiple}
></ha-svg-icon>
${this.hass!.localize(
"ui.panel.lovelace.editor.menu.manage_resources"
)}
</mwc-list-item>
<mwc-list-item
graphic="icon"
@request-selected="${this._handleRawEditor}"
@ -225,6 +201,35 @@ class HUIRoot extends LitElement {
"ui.panel.lovelace.editor.menu.raw_editor"
)}
</mwc-list-item>
${__DEMO__ /* No config available in the demo */
? ""
: html`<mwc-list-item
graphic="icon"
@request-selected="${this._handleManageDashboards}"
>
<ha-svg-icon
slot="graphic"
.path=${mdiViewDashboard}
></ha-svg-icon>
${this.hass!.localize(
"ui.panel.lovelace.editor.menu.manage_dashboards"
)}
</mwc-list-item>
${this.hass.userData?.showAdvanced
? html`<mwc-list-item
graphic="icon"
@request-selected="${this
._handleManageResources}"
>
<ha-svg-icon
slot="graphic"
.path=${mdiFileMultiple}
></ha-svg-icon>
${this.hass!.localize(
"ui.panel.lovelace.editor.menu.manage_resources"
)}
</mwc-list-item>`
: ""} `}
</ha-button-menu>
</app-toolbar>
`