mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +00:00
Add context to config update entries (#25208)
* Add context to config update entries * Add no area
This commit is contained in:
parent
92521d4565
commit
f65a0ef4f7
@ -6,6 +6,7 @@ import { ifDefined } from "lit/directives/if-defined";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { fireEvent } from "../../../common/dom/fire_event";
|
||||
import { computeDeviceNameDisplay } from "../../../common/entity/compute_device_name";
|
||||
import { getDeviceContext } from "../../../common/entity/get_device_context";
|
||||
import "../../../components/entity/state-badge";
|
||||
import "../../../components/ha-alert";
|
||||
import "../../../components/ha-icon-next";
|
||||
@ -76,6 +77,12 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
||||
? this.getDeviceEntry(entityEntry.device_id)
|
||||
: undefined;
|
||||
|
||||
const areaName =
|
||||
deviceEntry && deviceEntry.entry_type !== "service"
|
||||
? getDeviceContext(deviceEntry, this.hass).area?.name ||
|
||||
this.hass.localize("ui.panel.config.updates.no_area")
|
||||
: undefined;
|
||||
|
||||
return html`
|
||||
<ha-md-list-item
|
||||
class=${ifDefined(
|
||||
@ -106,7 +113,7 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
||||
"ui.panel.config.updates.update_in_progress"
|
||||
)}
|
||||
></ha-spinner>`
|
||||
: ""}
|
||||
: nothing}
|
||||
</div>
|
||||
<span
|
||||
>${deviceEntry
|
||||
@ -114,10 +121,11 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
||||
: entity.attributes.friendly_name}</span
|
||||
>
|
||||
<span slot="supporting-text">
|
||||
${areaName ? html`${areaName} ⸱ ` : nothing}
|
||||
${entity.attributes.title} ${entity.attributes.latest_version}
|
||||
${entity.attributes.skipped_version
|
||||
? `(${this.hass.localize("ui.panel.config.updates.skipped")})`
|
||||
: ""}
|
||||
: nothing}
|
||||
</span>
|
||||
${!this.narrow
|
||||
? entity.attributes.in_progress
|
||||
@ -130,7 +138,7 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
||||
></ha-spinner>
|
||||
</div>`
|
||||
: html`<ha-icon-next slot="end"></ha-icon-next>`
|
||||
: ""}
|
||||
: nothing}
|
||||
</ha-md-list-item>
|
||||
`;
|
||||
})}
|
||||
|
@ -2119,7 +2119,8 @@
|
||||
"join_beta": "[%key:supervisor::system::supervisor::join_beta_action%]",
|
||||
"leave_beta": "[%key:supervisor::system::supervisor::leave_beta_action%]",
|
||||
"skipped": "Skipped",
|
||||
"update_in_progress": "Update in progress"
|
||||
"update_in_progress": "Update in progress",
|
||||
"no_area": "No area"
|
||||
},
|
||||
"repairs": {
|
||||
"caption": "Repairs",
|
||||
|
Loading…
x
Reference in New Issue
Block a user