1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 12:49:19 +00:00

Add add to button in more info topbar for non admin users (#28365)

This commit is contained in:
Timothy
2025-12-05 15:05:50 +01:00
committed by GitHub
parent ef82bc2abb
commit e573a726aa

View File

@@ -302,7 +302,9 @@ export class MoreInfoDialog extends LitElement {
} }
private _goToAddEntityTo(ev) { private _goToAddEntityTo(ev) {
if (!shouldHandleRequestSelectedEvent(ev)) return; // Only check for request-selected events (from menu items), not regular clicks (from icon button)
if (ev.type === "request-selected" && !shouldHandleRequestSelectedEvent(ev))
return;
this._setView("add_to"); this._setView("add_to");
} }
@@ -550,7 +552,18 @@ export class MoreInfoDialog extends LitElement {
: nothing} : nothing}
</ha-button-menu> </ha-button-menu>
` `
: nothing} : !__DEMO__ && this._shouldShowAddEntityTo()
? html`
<ha-icon-button
slot="actionItems"
.label=${this.hass.localize(
"ui.dialogs.more_info_control.add_entity_to"
)}
.path=${mdiPlusBoxMultipleOutline}
@click=${this._goToAddEntityTo}
></ha-icon-button>
`
: nothing}
` `
: isSpecificInitialView : isSpecificInitialView
? html` ? html`