mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Separate action field YAML examples (#27218)
* Comma separate field examples if it is a list * Remove prettier ignore and json.stringify all examples * Use YAML format --------- Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { mdiHelpCircle } from "@mdi/js";
|
||||
import type { HassService } from "home-assistant-js-websocket";
|
||||
import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket";
|
||||
import { load } from "js-yaml";
|
||||
import { dump, load } from "js-yaml";
|
||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||
import { css, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, query, state } from "lit/decorators";
|
||||
@@ -320,7 +320,10 @@ class HaPanelDevAction extends LitElement {
|
||||
${this.hass.localize(
|
||||
`component.${domain}.services.${serviceName}.fields.${field.key}.example`,
|
||||
descriptionPlaceholders
|
||||
) || field.example}
|
||||
) ||
|
||||
(typeof field.example === "object"
|
||||
? html`<pre>${dump(field.example)}</pre>`
|
||||
: field.example)}
|
||||
</td>
|
||||
</tr>`
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user