mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Allow continue_on_error in the UI action editor (#16834)
This commit is contained in:
parent
13b864e261
commit
1cf24ffc8d
@ -33,6 +33,7 @@ export const isMaxMode = arrayLiteralIncludes(MODES_MAX);
|
||||
|
||||
export const baseActionStruct = object({
|
||||
alias: optional(string()),
|
||||
continue_on_error: optional(boolean()),
|
||||
enabled: optional(boolean()),
|
||||
});
|
||||
|
||||
@ -99,6 +100,7 @@ export interface BlueprintScriptConfig extends ManualScriptConfig {
|
||||
|
||||
interface BaseAction {
|
||||
alias?: string;
|
||||
continue_on_error?: boolean;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
@ -230,14 +232,10 @@ interface UnknownAction extends BaseAction {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export type Action =
|
||||
export type NonConditionAction =
|
||||
| EventAction
|
||||
| DeviceAction
|
||||
| ServiceAction
|
||||
| Condition
|
||||
| ShorthandAndCondition
|
||||
| ShorthandOrCondition
|
||||
| ShorthandNotCondition
|
||||
| DelayAction
|
||||
| SceneAction
|
||||
| WaitAction
|
||||
@ -251,6 +249,13 @@ export type Action =
|
||||
| ParallelAction
|
||||
| UnknownAction;
|
||||
|
||||
export type Action =
|
||||
| NonConditionAction
|
||||
| Condition
|
||||
| ShorthandAndCondition
|
||||
| ShorthandOrCondition
|
||||
| ShorthandNotCondition;
|
||||
|
||||
export interface ActionTypes {
|
||||
delay: DelayAction;
|
||||
wait_template: WaitAction;
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import {
|
||||
mdiAlertCircleCheck,
|
||||
mdiCheck,
|
||||
mdiContentDuplicate,
|
||||
mdiContentCopy,
|
||||
@ -14,7 +15,14 @@ import {
|
||||
mdiStopCircleOutline,
|
||||
} from "@mdi/js";
|
||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit";
|
||||
import {
|
||||
css,
|
||||
CSSResultGroup,
|
||||
html,
|
||||
LitElement,
|
||||
nothing,
|
||||
PropertyValues,
|
||||
} from "lit";
|
||||
import { customElement, property, query, state } from "lit/decorators";
|
||||
import { classMap } from "lit/directives/class-map";
|
||||
import { dynamicElement } from "../../../../common/dom/dynamic-element-directive";
|
||||
@ -34,7 +42,11 @@ import {
|
||||
subscribeEntityRegistry,
|
||||
} from "../../../../data/entity_registry";
|
||||
import { Clipboard } from "../../../../data/automation";
|
||||
import { Action, getActionType } from "../../../../data/script";
|
||||
import {
|
||||
Action,
|
||||
NonConditionAction,
|
||||
getActionType,
|
||||
} from "../../../../data/script";
|
||||
import { describeAction } from "../../../../data/script_i18n";
|
||||
import { callExecuteScript } from "../../../../data/service";
|
||||
import {
|
||||
@ -184,6 +196,17 @@ export default class HaAutomationActionRow extends LitElement {
|
||||
</h3>
|
||||
|
||||
<slot name="icons" slot="icons"></slot>
|
||||
${type !== "condition" &&
|
||||
(this.action as NonConditionAction).continue_on_error === true
|
||||
? html`<div slot="icons">
|
||||
<ha-svg-icon .path=${mdiAlertCircleCheck}></ha-svg-icon>
|
||||
<simple-tooltip animation-delay="0">
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.actions.continue_on_error"
|
||||
)}
|
||||
</simple-tooltip>
|
||||
</div> `
|
||||
: nothing}
|
||||
${this.hideMenu
|
||||
? ""
|
||||
: html`
|
||||
|
@ -2501,6 +2501,7 @@
|
||||
"delete_confirm_text": "[%key:ui::panel::config::automation::editor::triggers::delete_confirm_text%]",
|
||||
"unsupported_action": "No visual editor support for action: {action}",
|
||||
"type_select": "Action type",
|
||||
"continue_on_error": "Continue on error",
|
||||
"type": {
|
||||
"service": {
|
||||
"label": "Call service"
|
||||
|
Loading…
x
Reference in New Issue
Block a user