mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix more info dialog edit button for script (#14180)
This commit is contained in:
parent
a76f456ebc
commit
68302d0896
@ -12,7 +12,7 @@ export const EDITABLE_DOMAINS_WITH_ID = ["scene", "automation"];
|
||||
/**
|
||||
* Entity Domains that should always be editable; {@see shouldShowEditIcon}.
|
||||
* */
|
||||
export const EDITABLE_DOMAINS = ["script"];
|
||||
export const EDITABLE_DOMAINS_WITH_UNIQUE_ID = ["script"];
|
||||
|
||||
/** Domains with separate more info dialog. */
|
||||
export const DOMAINS_WITH_MORE_INFO = [
|
||||
|
@ -19,7 +19,7 @@ import "../../state-summary/state-card-content";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import {
|
||||
EDITABLE_DOMAINS_WITH_ID,
|
||||
EDITABLE_DOMAINS,
|
||||
EDITABLE_DOMAINS_WITH_UNIQUE_ID,
|
||||
DOMAINS_WITH_MORE_INFO,
|
||||
computeShowHistoryComponent,
|
||||
computeShowLogBookComponent,
|
||||
@ -72,7 +72,7 @@ export class MoreInfoDialog extends LitElement {
|
||||
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) && stateObj.attributes.id) {
|
||||
return true;
|
||||
}
|
||||
if (EDITABLE_DOMAINS.includes(domain)) {
|
||||
if (EDITABLE_DOMAINS_WITH_UNIQUE_ID.includes(domain)) {
|
||||
return true;
|
||||
}
|
||||
if (domain === "person" && stateObj.attributes.editable !== "false") {
|
||||
@ -246,6 +246,9 @@ export class MoreInfoDialog extends LitElement {
|
||||
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) || domain === "person") {
|
||||
idToPassThroughUrl = stateObj.attributes.id;
|
||||
}
|
||||
if (EDITABLE_DOMAINS_WITH_UNIQUE_ID.includes(domain)) {
|
||||
idToPassThroughUrl = this.hass.entities[this._entityId!].unique_id;
|
||||
}
|
||||
|
||||
navigate(`/config/${domain}/edit/${idToPassThroughUrl}`);
|
||||
this.closeDialog();
|
||||
|
Loading…
x
Reference in New Issue
Block a user