mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Allow options flow to define form title/description (#4598)
* Allow options flow to define their own title * Allow description too
This commit is contained in:
parent
6874788cc0
commit
f95ba4c04c
@ -44,12 +44,25 @@ export const showOptionsFlowDialog = (
|
|||||||
: "";
|
: "";
|
||||||
},
|
},
|
||||||
|
|
||||||
renderShowFormStepHeader(hass, _step) {
|
renderShowFormStepHeader(hass, step) {
|
||||||
return hass.localize(`ui.dialogs.options_flow.form.header`);
|
return (
|
||||||
|
hass.localize(
|
||||||
|
`component.${step.handler}.options.step.${step.step_id}.title`
|
||||||
|
) || hass.localize(`ui.dialogs.options_flow.form.header`)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
renderShowFormStepDescription(_hass, _step) {
|
renderShowFormStepDescription(hass, step) {
|
||||||
return "";
|
const description = localizeKey(
|
||||||
|
hass.localize,
|
||||||
|
`component.${step.handler}.config.step.${step.step_id}.description`,
|
||||||
|
step.description_placeholders
|
||||||
|
);
|
||||||
|
return description
|
||||||
|
? html`
|
||||||
|
<ha-markdown allowsvg .content=${description}></ha-markdown>
|
||||||
|
`
|
||||||
|
: "";
|
||||||
},
|
},
|
||||||
|
|
||||||
renderShowFormStepFieldLabel(hass, step, field) {
|
renderShowFormStepFieldLabel(hass, step, field) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user