mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Allow for custom submit button text in data flows (#15383)
This commit is contained in:
parent
658ce80801
commit
48dcd98634
@ -101,6 +101,19 @@ export const showConfigFlowDialog = (
|
|||||||
return hass.localize(`component.${step.handler}.selector.${key}`);
|
return hass.localize(`component.${step.handler}.selector.${key}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderShowFormStepSubmitButton(hass, step) {
|
||||||
|
return (
|
||||||
|
hass.localize(
|
||||||
|
`component.${step.handler}.config.step.${step.step_id}.submit`
|
||||||
|
) ||
|
||||||
|
hass.localize(
|
||||||
|
`ui.panel.config.integrations.config_flow.${
|
||||||
|
step.last_step === false ? "next" : "submit"
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
renderExternalStepHeader(hass, step) {
|
renderExternalStepHeader(hass, step) {
|
||||||
return (
|
return (
|
||||||
hass.localize(
|
hass.localize(
|
||||||
|
@ -67,6 +67,11 @@ export interface FlowConfig {
|
|||||||
key: string
|
key: string
|
||||||
): string;
|
): string;
|
||||||
|
|
||||||
|
renderShowFormStepSubmitButton(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
step: DataEntryFlowStepForm
|
||||||
|
): string;
|
||||||
|
|
||||||
renderExternalStepHeader(
|
renderExternalStepHeader(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
step: DataEntryFlowStepExternal
|
step: DataEntryFlowStepExternal
|
||||||
|
@ -115,6 +115,19 @@ export const showOptionsFlowDialog = (
|
|||||||
return hass.localize(`component.${configEntry.domain}.selector.${key}`);
|
return hass.localize(`component.${configEntry.domain}.selector.${key}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderShowFormStepSubmitButton(hass, step) {
|
||||||
|
return (
|
||||||
|
hass.localize(
|
||||||
|
`component.${configEntry.domain}.options.step.${step.step_id}.submit`
|
||||||
|
) ||
|
||||||
|
hass.localize(
|
||||||
|
`ui.panel.config.integrations.config_flow.${
|
||||||
|
step.last_step === false ? "next" : "submit"
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
renderExternalStepHeader(_hass, _step) {
|
renderExternalStepHeader(_hass, _step) {
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
@ -70,10 +70,9 @@ class StepFlowForm extends LitElement {
|
|||||||
: html`
|
: html`
|
||||||
<div>
|
<div>
|
||||||
<mwc-button @click=${this._submitStep}>
|
<mwc-button @click=${this._submitStep}>
|
||||||
${this.hass.localize(
|
${this.flowConfig.renderShowFormStepSubmitButton(
|
||||||
`ui.panel.config.integrations.config_flow.${
|
this.hass,
|
||||||
this.step.last_step === false ? "next" : "submit"
|
this.step
|
||||||
}`
|
|
||||||
)}
|
)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -128,6 +128,21 @@ export const showRepairsFlowDialog = (
|
|||||||
return hass.localize(`component.${issue.domain}.selector.${key}`);
|
return hass.localize(`component.${issue.domain}.selector.${key}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderShowFormStepSubmitButton(hass, step) {
|
||||||
|
return (
|
||||||
|
hass.localize(
|
||||||
|
`component.${issue.domain}.issues.${
|
||||||
|
issue.translation_key || issue.issue_id
|
||||||
|
}.fix_flow.step.${step.step_id}.submit`
|
||||||
|
) ||
|
||||||
|
hass.localize(
|
||||||
|
`ui.panel.config.integrations.config_flow.${
|
||||||
|
step.last_step === false ? "next" : "submit"
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
renderExternalStepHeader(_hass, _step) {
|
renderExternalStepHeader(_hass, _step) {
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user