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";
@customElement("ha-battery-icon")
class HaBatteryIcon extends LitElement {
export class HaBatteryIcon extends LitElement {
@property() public batteryStateObj;
@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>
<a
href=${`/config/integrations#config_entry=${relatedConfigEntryId}`}
@click=${this._close}
>
${this.hass.localize(`component.${entry.domain}.title`)}:
${entry.title}
@ -116,10 +115,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
<h3>
${this.hass.localize("ui.components.related-items.device")}:
</h3>
<a
href="/config/devices/device/${relatedDeviceId}"
@click=${this._close}
>
<a href="/config/devices/device/${relatedDeviceId}">
${device.name_by_user || device.name}
</a>
`;
@ -137,7 +133,9 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
<h3>
${this.hass.localize("ui.components.related-items.area")}:
</h3>
<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 });
}
private _close() {
fireEvent(this, "close-dialog");
}
static get styles(): CSSResult {
return css`
a {

View File

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