mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix integration card rename dialog logic (#9467)
This commit is contained in:
parent
43503ba085
commit
4665db4f27
@ -303,7 +303,7 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
>
|
>
|
||||||
<ha-svg-icon .path=${mdiDotsVertical}></ha-svg-icon>
|
<ha-svg-icon .path=${mdiDotsVertical}></ha-svg-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
<mwc-list-item @request-selected="${this._editEntryName}">
|
<mwc-list-item @request-selected="${this._handleRename}">
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.config.integrations.config_entry.rename"
|
"ui.panel.config.integrations.config_entry.rename"
|
||||||
)}
|
)}
|
||||||
@ -420,6 +420,15 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
showOptionsFlowDialog(this, ev.target.closest("ha-card").configEntry);
|
showOptionsFlowDialog(this, ev.target.closest("ha-card").configEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _handleRename(ev: CustomEvent<RequestSelectedDetail>): void {
|
||||||
|
if (!shouldHandleRequestSelectedEvent(ev)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._editEntryName(
|
||||||
|
((ev.target as HTMLElement).closest("ha-card") as any).configEntry
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private _handleReload(ev: CustomEvent<RequestSelectedDetail>): void {
|
private _handleReload(ev: CustomEvent<RequestSelectedDetail>): void {
|
||||||
if (!shouldHandleRequestSelectedEvent(ev)) {
|
if (!shouldHandleRequestSelectedEvent(ev)) {
|
||||||
return;
|
return;
|
||||||
@ -578,8 +587,7 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _editEntryName(ev) {
|
private async _editEntryName(configEntry: ConfigEntry) {
|
||||||
const configEntry = ev.target.closest("ha-card").configEntry;
|
|
||||||
const newName = await showPromptDialog(this, {
|
const newName = await showPromptDialog(this, {
|
||||||
title: this.hass.localize("ui.panel.config.integrations.rename_dialog"),
|
title: this.hass.localize("ui.panel.config.integrations.rename_dialog"),
|
||||||
defaultValue: configEntry.title,
|
defaultValue: configEntry.title,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user