Fix history issue when closing more info dialog by clicking update (#17257)

* Fix history issue when closing more info dialog by clicking update

* Remove hideMoreInfoDialog function
This commit is contained in:
Paul Bottein 2023-07-11 15:00:12 +02:00 committed by GitHub
parent 33b9786ae7
commit 606b96f6fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 16 deletions

View File

@ -5,6 +5,3 @@ export const showMoreInfoDialog = (
element: HTMLElement, element: HTMLElement,
params: MoreInfoDialogParams params: MoreInfoDialogParams
) => fireEvent(element, "hass-more-info", params); ) => fireEvent(element, "hass-more-info", params);
export const hideMoreInfoDialog = (element: HTMLElement) =>
fireEvent(element, "hass-more-info", { entityId: null });

View File

@ -16,7 +16,6 @@ import {
} from "../../../../../data/entity_registry"; } from "../../../../../data/entity_registry";
import { HELPERS_CRUD } from "../../../../../data/helpers_crud"; import { HELPERS_CRUD } from "../../../../../data/helpers_crud";
import { showConfirmationDialog } from "../../../../../dialogs/generic/show-dialog-box"; import { showConfirmationDialog } from "../../../../../dialogs/generic/show-dialog-box";
import { hideMoreInfoDialog } from "../../../../../dialogs/more-info/show-ha-more-info-dialog";
import { haStyle } from "../../../../../resources/styles"; import { haStyle } from "../../../../../resources/styles";
import type { HomeAssistant } from "../../../../../types"; import type { HomeAssistant } from "../../../../../types";
import type { Helper } from "../../../helpers/const"; import type { Helper } from "../../../helpers/const";
@ -151,7 +150,7 @@ export class EntityRegistrySettingsHelper extends LitElement {
} }
const result = await this._registryEditor!.updateEntry(); const result = await this._registryEditor!.updateEntry();
if (result.close) { if (result.close) {
hideMoreInfoDialog(this); fireEvent(this, "close-dialog");
} }
} catch (err: any) { } catch (err: any) {
this._error = err.message || "Unknown error"; this._error = err.message || "Unknown error";

View File

@ -22,7 +22,6 @@ import {
showAlertDialog, showAlertDialog,
showConfirmationDialog, showConfirmationDialog,
} from "../../../dialogs/generic/show-dialog-box"; } from "../../../dialogs/generic/show-dialog-box";
import { hideMoreInfoDialog } from "../../../dialogs/more-info/show-ha-more-info-dialog";
import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
import { haStyle } from "../../../resources/styles"; import { haStyle } from "../../../resources/styles";
import type { HomeAssistant } from "../../../types"; import type { HomeAssistant } from "../../../types";
@ -200,7 +199,7 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
try { try {
const result = await this._registryEditor!.updateEntry(); const result = await this._registryEditor!.updateEntry();
if (result.close) { if (result.close) {
hideMoreInfoDialog(this); fireEvent(this, "close-dialog");
} }
} catch (err: any) { } catch (err: any) {
this._error = err.message || "Unknown error"; this._error = err.message || "Unknown error";

View File

@ -55,10 +55,7 @@ import {
showAlertDialog, showAlertDialog,
showConfirmationDialog, showConfirmationDialog,
} from "../../../dialogs/generic/show-dialog-box"; } from "../../../dialogs/generic/show-dialog-box";
import { import { showMoreInfoDialog } from "../../../dialogs/more-info/show-ha-more-info-dialog";
hideMoreInfoDialog,
showMoreInfoDialog,
} from "../../../dialogs/more-info/show-ha-more-info-dialog";
import "../../../layouts/hass-loading-screen"; import "../../../layouts/hass-loading-screen";
import "../../../layouts/hass-tabs-subpage-data-table"; import "../../../layouts/hass-tabs-subpage-data-table";
import type { HaTabsSubpageDataTable } from "../../../layouts/hass-tabs-subpage-data-table"; import type { HaTabsSubpageDataTable } from "../../../layouts/hass-tabs-subpage-data-table";
@ -487,11 +484,6 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
]; ];
} }
public disconnectedCallback() {
super.disconnectedCallback();
hideMoreInfoDialog(this);
}
protected render() { protected render() {
if (!this.hass || this._entities === undefined) { if (!this.hass || this._entities === undefined) {
return html` <hass-loading-screen></hass-loading-screen> `; return html` <hass-loading-screen></hass-loading-screen> `;