Add link to related area (#6381)

This commit is contained in:
Bram Kragten 2020-07-14 18:14:26 +02:00 committed by GitHub
parent 5d6e332044
commit f291ea6647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 16 deletions

View File

@ -3,7 +3,7 @@ import "../ha-icon";
import { customElement, html, property, LitElement } from "lit-element"; import { customElement, html, property, LitElement } from "lit-element";
@customElement("ha-battery-icon") @customElement("ha-battery-icon")
class HaBatteryIcon extends LitElement { export class HaBatteryIcon extends LitElement {
@property() public batteryStateObj; @property() public batteryStateObj;
@property() public batteryChargingStateObj; @property() public batteryChargingStateObj;
@ -16,5 +16,3 @@ class HaBatteryIcon extends LitElement {
`; `;
} }
} }
customElements.define("ha-battery-icon", HaBatteryIcon);

View File

@ -96,7 +96,6 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
</h3> </h3>
<a <a
href=${`/config/integrations#config_entry=${relatedConfigEntryId}`} href=${`/config/integrations#config_entry=${relatedConfigEntryId}`}
@click=${this._close}
> >
${this.hass.localize(`component.${entry.domain}.title`)}: ${this.hass.localize(`component.${entry.domain}.title`)}:
${entry.title} ${entry.title}
@ -116,10 +115,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
<h3> <h3>
${this.hass.localize("ui.components.related-items.device")}: ${this.hass.localize("ui.components.related-items.device")}:
</h3> </h3>
<a <a href="/config/devices/device/${relatedDeviceId}">
href="/config/devices/device/${relatedDeviceId}"
@click=${this._close}
>
${device.name_by_user || device.name} ${device.name_by_user || device.name}
</a> </a>
`; `;
@ -137,7 +133,9 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
<h3> <h3>
${this.hass.localize("ui.components.related-items.area")}: ${this.hass.localize("ui.components.related-items.area")}:
</h3> </h3>
${area.name} <a href="/config/areas/area/${relatedAreaId}">
${area.name}
</a>
`; `;
}) })
: ""} : ""}
@ -290,10 +288,6 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
fireEvent(this, "hass-more-info", { entityId }); fireEvent(this, "hass-more-info", { entityId });
} }
private _close() {
fireEvent(this, "close-dialog");
}
static get styles(): CSSResult { static get styles(): CSSResult {
return css` return css`
a { a {

View File

@ -1,6 +1,4 @@
import "@material/mwc-button"; import "@material/mwc-button";
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
import "@polymer/paper-input/paper-input";
import { import {
css, css,
CSSResult, CSSResult,
@ -14,7 +12,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
import memoizeOne from "memoize-one"; import memoizeOne from "memoize-one";
import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { computeStateName } from "../../../common/entity/compute_state_name"; import { computeStateName } from "../../../common/entity/compute_state_name";
import "../../../components/dialog/ha-paper-dialog"; import "../../../components/ha-card";
import { import {
AreaRegistryEntry, AreaRegistryEntry,
deleteAreaRegistryEntry, deleteAreaRegistryEntry,