Add information in overflow menu (#13570)

This commit is contained in:
Paul Bottein 2022-09-02 19:02:01 +02:00 committed by GitHub
parent ec257710ff
commit efa4f65686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import {
mdiContentSave,
mdiDelete,
mdiDotsVertical,
mdiInformationOutline,
mdiPencil,
mdiPlay,
mdiPlayCircleOutline,
@ -25,6 +26,7 @@ import {
} from "lit";
import { property, state, query } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import { fireEvent } from "../../../common/dom/fire_event";
import { navigate } from "../../../common/navigate";
import { copyToClipboard } from "../../../common/util/copy-clipboard";
import "../../../components/ha-button-menu";
@ -125,6 +127,14 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
.path=${mdiDotsVertical}
></ha-icon-button>
<mwc-list-item graphic="icon" @click=${this._showInfo}>
${this.hass.localize("ui.panel.config.automation.editor.show_info")}
<ha-svg-icon
slot="graphic"
.path=${mdiInformationOutline}
></ha-svg-icon>
</mwc-list-item>
<mwc-list-item
graphic="icon"
.disabled=${!stateObj}
@ -433,6 +443,13 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
this._errors = undefined;
}
private _showInfo() {
if (!this.hass || !this._entityId) {
return;
}
fireEvent(this, "hass-more-info", { entityId: this._entityId });
}
private _runActions() {
if (!this.hass || !this._entityId) {
return;