mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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}`);
|
||||
},
|
||||
|
||||
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) {
|
||||
return (
|
||||
hass.localize(
|
||||
|
@ -67,6 +67,11 @@ export interface FlowConfig {
|
||||
key: string
|
||||
): string;
|
||||
|
||||
renderShowFormStepSubmitButton(
|
||||
hass: HomeAssistant,
|
||||
step: DataEntryFlowStepForm
|
||||
): string;
|
||||
|
||||
renderExternalStepHeader(
|
||||
hass: HomeAssistant,
|
||||
step: DataEntryFlowStepExternal
|
||||
|
@ -115,6 +115,19 @@ export const showOptionsFlowDialog = (
|
||||
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) {
|
||||
return "";
|
||||
},
|
||||
|
@ -70,10 +70,9 @@ class StepFlowForm extends LitElement {
|
||||
: html`
|
||||
<div>
|
||||
<mwc-button @click=${this._submitStep}>
|
||||
${this.hass.localize(
|
||||
`ui.panel.config.integrations.config_flow.${
|
||||
this.step.last_step === false ? "next" : "submit"
|
||||
}`
|
||||
${this.flowConfig.renderShowFormStepSubmitButton(
|
||||
this.hass,
|
||||
this.step
|
||||
)}
|
||||
</mwc-button>
|
||||
</div>
|
||||
|
@ -128,6 +128,21 @@ export const showRepairsFlowDialog = (
|
||||
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) {
|
||||
return "";
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user