mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Close entity registry dialog when navigation away (#6511)
This commit is contained in:
parent
6991403203
commit
bb5f6e88d0
@ -97,6 +97,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||
</h3>
|
||||
<a
|
||||
href=${`/config/integrations#config_entry=${relatedConfigEntryId}`}
|
||||
@click=${this._navigateAwayClose}
|
||||
>
|
||||
${this.hass.localize(`component.${entry.domain}.title`)}:
|
||||
${entry.title}
|
||||
@ -116,7 +117,10 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||
<h3>
|
||||
${this.hass.localize("ui.components.related-items.device")}:
|
||||
</h3>
|
||||
<a href="/config/devices/device/${relatedDeviceId}">
|
||||
<a
|
||||
href="/config/devices/device/${relatedDeviceId}"
|
||||
@click=${this._navigateAwayClose}
|
||||
>
|
||||
${device.name_by_user || device.name}
|
||||
</a>
|
||||
`;
|
||||
@ -134,7 +138,10 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||
<h3>
|
||||
${this.hass.localize("ui.components.related-items.area")}:
|
||||
</h3>
|
||||
<a href="/config/areas/area/${relatedAreaId}">
|
||||
<a
|
||||
href="/config/areas/area/${relatedAreaId}"
|
||||
@click=${this._navigateAwayClose}
|
||||
>
|
||||
${area.name}
|
||||
</a>
|
||||
`;
|
||||
@ -278,6 +285,12 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||
`;
|
||||
}
|
||||
|
||||
private async _navigateAwayClose() {
|
||||
// allow new page to open before closing dialog
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
fireEvent(this, "close-dialog");
|
||||
}
|
||||
|
||||
private async _findRelated() {
|
||||
this._related = await findRelated(this.hass, this.itemType, this.itemId);
|
||||
await this.updateComplete;
|
||||
|
@ -73,7 +73,7 @@ export class EntityRegistrySettings extends LitElement {
|
||||
return html`
|
||||
${!stateObj
|
||||
? html`
|
||||
<div>
|
||||
<div class="container">
|
||||
${this.hass!.localize(
|
||||
"ui.dialogs.entity_registry.editor.unavailable"
|
||||
)}
|
||||
@ -81,7 +81,7 @@ export class EntityRegistrySettings extends LitElement {
|
||||
`
|
||||
: ""}
|
||||
${this._error ? html` <div class="error">${this._error}</div> ` : ""}
|
||||
<div class="form">
|
||||
<div class="form container">
|
||||
<paper-input
|
||||
.value=${this._name}
|
||||
@value-changed=${this._nameChanged}
|
||||
@ -227,8 +227,10 @@ export class EntityRegistrySettings extends LitElement {
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
.form {
|
||||
.container {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
.form {
|
||||
margin-bottom: 53px;
|
||||
}
|
||||
.buttons {
|
||||
|
Loading…
x
Reference in New Issue
Block a user