mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Require opt-in config flow navigateToResult (#24120)
This commit is contained in:
parent
748642a8d6
commit
44cc75afbc
@ -282,6 +282,8 @@ class DataEntryFlowDialog extends LitElement {
|
||||
.flowConfig=${this._params.flowConfig}
|
||||
.step=${this._step}
|
||||
.hass=${this.hass}
|
||||
.navigateToResult=${this._params
|
||||
.navigateToResult}
|
||||
></step-flow-create-entry>
|
||||
`}
|
||||
`}
|
||||
|
@ -150,6 +150,7 @@ export interface DataEntryFlowDialogParams {
|
||||
showAdvanced?: boolean;
|
||||
entryId?: string;
|
||||
dialogParentElement?: HTMLElement;
|
||||
navigateToResult?: boolean;
|
||||
}
|
||||
|
||||
export const loadDataEntryFlowDialog = () => import("./dialog-data-entry-flow");
|
||||
|
@ -60,6 +60,7 @@ class StepFlowAbort extends LitElement {
|
||||
dialogClosedCallback: this.params.dialogClosedCallback,
|
||||
startFlowHandler: this.domain,
|
||||
showAdvanced: this.hass.userData?.showAdvanced,
|
||||
navigateToResult: this.params.navigateToResult,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
@ -29,6 +29,8 @@ class StepFlowCreateEntry extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public step!: DataEntryFlowStepCreateEntry;
|
||||
|
||||
navigateToResult = false;
|
||||
|
||||
private _devices = memoizeOne(
|
||||
(
|
||||
showDevices: boolean,
|
||||
@ -153,7 +155,7 @@ class StepFlowCreateEntry extends LitElement {
|
||||
|
||||
private _flowDone(): void {
|
||||
fireEvent(this, "flow-update", { step: undefined });
|
||||
if (this.step.result) {
|
||||
if (this.step.result && this.navigateToResult) {
|
||||
navigate(
|
||||
`/config/integrations/integration/${this.step.result.domain}#config_entry=${this.step.result.entry_id}`
|
||||
);
|
||||
|
@ -654,6 +654,7 @@ class AddIntegrationDialog extends LitElement {
|
||||
startFlowHandler: domain,
|
||||
showAdvanced: this.hass.userData?.showAdvanced,
|
||||
manifest,
|
||||
navigateToResult: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -137,6 +137,7 @@ export class HaConfigFlowCard extends LitElement {
|
||||
}
|
||||
showConfigFlowDialog(this, {
|
||||
continueFlowId: this.flow.flow_id,
|
||||
navigateToResult: true,
|
||||
dialogClosedCallback: () => {
|
||||
this._handleFlowUpdated();
|
||||
},
|
||||
|
@ -1009,6 +1009,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
private _continueFlow(ev) {
|
||||
showConfigFlowDialog(this, {
|
||||
continueFlowId: ev.target.flow.flow_id,
|
||||
navigateToResult: true,
|
||||
dialogClosedCallback: () => {
|
||||
// this._handleFlowUpdated();
|
||||
},
|
||||
@ -1384,6 +1385,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
showAdvanced: this.hass.userData?.showAdvanced,
|
||||
manifest: await fetchIntegrationManifest(this.hass, configEntry.domain),
|
||||
entryId: configEntry.entry_id,
|
||||
navigateToResult: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -279,6 +279,7 @@ class HaDomainIntegrations extends LitElement {
|
||||
{
|
||||
startFlowHandler: domain,
|
||||
showAdvanced: this.hass.userData?.showAdvanced,
|
||||
navigateToResult: true,
|
||||
manifest: await fetchIntegrationManifest(this.hass, domain),
|
||||
}
|
||||
);
|
||||
@ -295,6 +296,7 @@ class HaDomainIntegrations extends LitElement {
|
||||
root instanceof ShadowRoot ? (root.host as HTMLElement) : this,
|
||||
{
|
||||
continueFlowId: flow.flow_id,
|
||||
navigateToResult: true,
|
||||
showAdvanced: this.hass.userData?.showAdvanced,
|
||||
manifest: await fetchIntegrationManifest(this.hass, flow.handler),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user