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