Add last_updated tooltip to more info dialog (#6926)

This commit is contained in:
Pawel 2020-09-29 22:10:29 +02:00 committed by GitHub
parent 2f21f6ef8a
commit a214ab463e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { html } from "@polymer/polymer/lib/utils/html-tag"; import { html } from "@polymer/polymer/lib/utils/html-tag";
import "@polymer/paper-tooltip/paper-tooltip";
/* eslint-plugin-disable lit */ /* eslint-plugin-disable lit */
import { PolymerElement } from "@polymer/polymer/polymer-element"; import { PolymerElement } from "@polymer/polymer/polymer-element";
import { computeStateName } from "../../common/entity/compute_state_name"; import { computeStateName } from "../../common/entity/compute_state_name";
@ -71,13 +72,20 @@ class StateInfo extends PolymerElement {
<div class="name" in-dialog$="[[inDialog]]"> <div class="name" in-dialog$="[[inDialog]]">
[[computeStateName(stateObj)]] [[computeStateName(stateObj)]]
</div> </div>
<template is="dom-if" if="[[inDialog]]"> <template is="dom-if" if="[[inDialog]]">
<div class="time-ago"> <div class="time-ago">
<ha-relative-time <ha-relative-time
id="last_changed"
hass="[[hass]]" hass="[[hass]]"
datetime="[[stateObj.last_changed]]" datetime="[[stateObj.last_changed]]"
></ha-relative-time> ></ha-relative-time>
<paper-tooltip animation-delay="0" for="last_changed">
[[localize('ui.dialogs.more_info_control.last_updated')]]:
<ha-relative-time
hass="[[hass]]"
datetime="[[stateObj.last_updated]]"
></ha-relative-time>
</paper-tooltip>
</div> </div>
</template> </template>
<template is="dom-if" if="[[!inDialog]]"> <template is="dom-if" if="[[!inDialog]]">

View File

@ -430,6 +430,7 @@
"edit": "Edit entity", "edit": "Edit entity",
"details": "Details", "details": "Details",
"history": "History", "history": "History",
"last_updated": "Last updated",
"script": { "script": {
"last_action": "Last Action", "last_action": "Last Action",
"last_triggered": "Last Triggered" "last_triggered": "Last Triggered"