mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 13:57:21 +00:00
Colorize trace paths for choose without explicit default case
This commit is contained in:
parent
6701c4c371
commit
c1f462b8f8
@ -143,11 +143,12 @@ class HatScriptGraph extends LitElement {
|
|||||||
graphStart = false
|
graphStart = false
|
||||||
) {
|
) {
|
||||||
const trace = this.trace.trace[path] as ChooseActionTraceStep[] | undefined;
|
const trace = this.trace.trace[path] as ChooseActionTraceStep[] | undefined;
|
||||||
const trace_path = trace?.[0].result
|
const trace_path =
|
||||||
? trace[0].result.choice === "default"
|
trace !== undefined
|
||||||
? [Array.isArray(config.choose) ? config.choose.length : 0]
|
? trace[0].result?.choice === "default" || trace[0].result === undefined
|
||||||
: [trace[0].result.choice]
|
? [Array.isArray(config.choose) ? config.choose.length : 0]
|
||||||
: [];
|
: [trace[0].result.choice]
|
||||||
|
: [];
|
||||||
return html`
|
return html`
|
||||||
<hat-graph
|
<hat-graph
|
||||||
tabindex=${trace === undefined ? "-1" : "0"}
|
tabindex=${trace === undefined ? "-1" : "0"}
|
||||||
@ -204,7 +205,9 @@ class HatScriptGraph extends LitElement {
|
|||||||
<hat-graph-spacer
|
<hat-graph-spacer
|
||||||
class=${classMap({
|
class=${classMap({
|
||||||
track:
|
track:
|
||||||
trace !== undefined && trace[0].result?.choice === "default",
|
trace !== undefined &&
|
||||||
|
(trace[0].result?.choice === "default" ||
|
||||||
|
trace[0].result === undefined),
|
||||||
})}
|
})}
|
||||||
></hat-graph-spacer>
|
></hat-graph-spacer>
|
||||||
${ensureArray(config.default)?.map((action, i) =>
|
${ensureArray(config.default)?.map((action, i) =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user