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