mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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}.
|
* 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. */
|
/** Domains with separate more info dialog. */
|
||||||
export const DOMAINS_WITH_MORE_INFO = [
|
export const DOMAINS_WITH_MORE_INFO = [
|
||||||
|
@ -19,7 +19,7 @@ import "../../state-summary/state-card-content";
|
|||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
import {
|
import {
|
||||||
EDITABLE_DOMAINS_WITH_ID,
|
EDITABLE_DOMAINS_WITH_ID,
|
||||||
EDITABLE_DOMAINS,
|
EDITABLE_DOMAINS_WITH_UNIQUE_ID,
|
||||||
DOMAINS_WITH_MORE_INFO,
|
DOMAINS_WITH_MORE_INFO,
|
||||||
computeShowHistoryComponent,
|
computeShowHistoryComponent,
|
||||||
computeShowLogBookComponent,
|
computeShowLogBookComponent,
|
||||||
@ -72,7 +72,7 @@ export class MoreInfoDialog extends LitElement {
|
|||||||
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) && stateObj.attributes.id) {
|
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) && stateObj.attributes.id) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (EDITABLE_DOMAINS.includes(domain)) {
|
if (EDITABLE_DOMAINS_WITH_UNIQUE_ID.includes(domain)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (domain === "person" && stateObj.attributes.editable !== "false") {
|
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") {
|
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) || domain === "person") {
|
||||||
idToPassThroughUrl = stateObj.attributes.id;
|
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}`);
|
navigate(`/config/${domain}/edit/${idToPassThroughUrl}`);
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user