Put button menu above toolbar in automation editor (#16716)

This commit is contained in:
Paul Bottein 2023-06-01 13:35:23 +02:00 committed by GitHub
parent 9b2e77e781
commit efa02c309b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 39 deletions

View File

@ -191,6 +191,7 @@ export default class HaAutomationActionRow extends LitElement {
slot="icons" slot="icons"
@action=${this._handleAction} @action=${this._handleAction}
@click=${preventDefault} @click=${preventDefault}
fixed
> >
<ha-icon-button <ha-icon-button
slot="trigger" slot="trigger"

View File

@ -147,7 +147,11 @@ export default class HaAutomationAction extends LitElement {
` `
)} )}
</div> </div>
<ha-button-menu @action=${this._addAction} .disabled=${this.disabled}> <ha-button-menu
@action=${this._addAction}
.disabled=${this.disabled}
fixed
>
<ha-button <ha-button
slot="trigger" slot="trigger"
outlined outlined

View File

@ -130,6 +130,7 @@ export default class HaAutomationConditionRow extends LitElement {
slot="icons" slot="icons"
@action=${this._handleAction} @action=${this._handleAction}
@click=${preventDefault} @click=${preventDefault}
fixed
> >
<ha-icon-button <ha-icon-button
slot="trigger" slot="trigger"

View File

@ -191,7 +191,11 @@ export default class HaAutomationCondition extends LitElement {
` `
)} )}
</div> </div>
<ha-button-menu @action=${this._addCondition} .disabled=${this.disabled}> <ha-button-menu
@action=${this._addCondition}
.disabled=${this.disabled}
fixed
>
<ha-button <ha-button
slot="trigger" slot="trigger"
outlined outlined

View File

@ -153,6 +153,7 @@ export default class HaAutomationTriggerRow extends LitElement {
slot="icons" slot="icons"
@action=${this._handleAction} @action=${this._handleAction}
@click=${preventDefault} @click=${preventDefault}
fixed
> >
<ha-icon-button <ha-icon-button
slot="trigger" slot="trigger"

View File

@ -75,8 +75,7 @@ export default class HaAutomationTrigger extends LitElement {
protected render() { protected render() {
return html` return html`
${ ${this.reOrderMode && !this.nested
this.reOrderMode && !this.nested
? html` ? html`
<ha-alert <ha-alert
alert-type="info" alert-type="info"
@ -94,8 +93,7 @@ export default class HaAutomationTrigger extends LitElement {
</mwc-button> </mwc-button>
</ha-alert> </ha-alert>
` `
: null : null}
}
<div class="triggers"> <div class="triggers">
${repeat( ${repeat(
this.triggers, this.triggers,
@ -141,8 +139,11 @@ export default class HaAutomationTrigger extends LitElement {
</ha-automation-trigger-row> </ha-automation-trigger-row>
` `
)} )}
</div> <ha-button-menu
<ha-button-menu @action=${this._addTrigger} .disabled=${this.disabled}> @action=${this._addTrigger}
.disabled=${this.disabled}
fixed
>
<ha-button <ha-button
slot="trigger" slot="trigger"
outlined outlined
@ -153,8 +154,7 @@ export default class HaAutomationTrigger extends LitElement {
> >
<ha-svg-icon .path=${mdiPlus} slot="icon"></ha-svg-icon> <ha-svg-icon .path=${mdiPlus} slot="icon"></ha-svg-icon>
</ha-button> </ha-button>
${ ${this.clipboard?.trigger
this.clipboard?.trigger
? html` <mwc-list-item .value=${PASTE_VALUE} graphic="icon"> ? html` <mwc-list-item .value=${PASTE_VALUE} graphic="icon">
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.automation.editor.triggers.paste" "ui.panel.config.automation.editor.triggers.paste"
@ -167,8 +167,7 @@ export default class HaAutomationTrigger extends LitElement {
.path=${mdiContentPaste} .path=${mdiContentPaste}
></ha-svg-icon ></ha-svg-icon
></mwc-list-item>` ></mwc-list-item>`
: nothing : nothing}
}
${this._processedTypes(this.hass.localize).map( ${this._processedTypes(this.hass.localize).map(
([opt, label, icon]) => html` ([opt, label, icon]) => html`
<mwc-list-item .value=${opt} graphic="icon"> <mwc-list-item .value=${opt} graphic="icon">