mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Warn on switching to automation UI mode with yaml errors (#22780)
This commit is contained in:
parent
3f4351476f
commit
de57b025e6
@ -756,7 +756,20 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _switchUiMode() {
|
private async _switchUiMode() {
|
||||||
|
if (this._yamlErrors) {
|
||||||
|
const result = await showConfirmationDialog(this, {
|
||||||
|
text: html`${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.switch_ui_yaml_error"
|
||||||
|
)}<br /><br />${this._yamlErrors}`,
|
||||||
|
confirmText: this.hass!.localize("ui.common.continue"),
|
||||||
|
destructive: true,
|
||||||
|
dismissText: this.hass!.localize("ui.common.cancel"),
|
||||||
|
});
|
||||||
|
if (!result) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this._yamlErrors = undefined;
|
this._yamlErrors = undefined;
|
||||||
this._mode = "gui";
|
this._mode = "gui";
|
||||||
}
|
}
|
||||||
|
@ -2942,6 +2942,7 @@
|
|||||||
"search_in": "Search · {group}",
|
"search_in": "Search · {group}",
|
||||||
"unknown_entity": "unknown entity",
|
"unknown_entity": "unknown entity",
|
||||||
"edit_unknown_device": "Editor not available for unknown device",
|
"edit_unknown_device": "Editor not available for unknown device",
|
||||||
|
"switch_ui_yaml_error": "There are currently YAML errors in the automation, and it cannot be parsed. Switching to UI mode may cause pending changes to be lost. Press cancel to correct any errors before proceeding to prevent loss of pending changes, or continue if you are sure.",
|
||||||
"triggers": {
|
"triggers": {
|
||||||
"name": "Triggers",
|
"name": "Triggers",
|
||||||
"header": "When",
|
"header": "When",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user