mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
Align "option" wording and show user-friendly option index in trace timeline (#10059)
This commit is contained in:
parent
c0f3215340
commit
0adc4b33ef
@ -82,7 +82,7 @@ export class HaTracePathDetails extends LitElement {
|
|||||||
] as ChooseActionTraceStep[];
|
] as ChooseActionTraceStep[];
|
||||||
|
|
||||||
if (parentTraceInfo && parentTraceInfo[0]?.result?.choice === "default") {
|
if (parentTraceInfo && parentTraceInfo[0]?.result?.choice === "default") {
|
||||||
return "The default node was executed because no choices matched.";
|
return "The default action was executed because no options matched.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,13 +325,15 @@ class ActionRenderer {
|
|||||||
if (defaultExecuted) {
|
if (defaultExecuted) {
|
||||||
this._renderEntry(choosePath, `${name}: Default action executed`);
|
this._renderEntry(choosePath, `${name}: Default action executed`);
|
||||||
} else if (chooseTrace.result) {
|
} else if (chooseTrace.result) {
|
||||||
|
const choiceNumeric =
|
||||||
|
chooseTrace.result.choice !== "default"
|
||||||
|
? chooseTrace.result.choice + 1
|
||||||
|
: undefined;
|
||||||
const choiceConfig = this._getDataFromPath(
|
const choiceConfig = this._getDataFromPath(
|
||||||
`${this.keys[index]}/choose/${chooseTrace.result.choice}`
|
`${this.keys[index]}/choose/${chooseTrace.result.choice}`
|
||||||
) as ChooseActionChoice | undefined;
|
) as ChooseActionChoice | undefined;
|
||||||
const choiceName = choiceConfig
|
const choiceName = choiceConfig
|
||||||
? `${
|
? `${choiceConfig.alias || `Option ${choiceNumeric}`} executed`
|
||||||
choiceConfig.alias || `Choice ${chooseTrace.result.choice}`
|
|
||||||
} executed`
|
|
||||||
: `Error: ${chooseTrace.error}`;
|
: `Error: ${chooseTrace.error}`;
|
||||||
this._renderEntry(choosePath, `${name}: ${choiceName}`);
|
this._renderEntry(choosePath, `${name}: ${choiceName}`);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user