mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +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 memoizeOne from "memoize-one";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { computeDeviceNameDisplay } from "../../../common/entity/compute_device_name";
|
import { computeDeviceNameDisplay } from "../../../common/entity/compute_device_name";
|
||||||
|
import { getDeviceContext } from "../../../common/entity/get_device_context";
|
||||||
import "../../../components/entity/state-badge";
|
import "../../../components/entity/state-badge";
|
||||||
import "../../../components/ha-alert";
|
import "../../../components/ha-alert";
|
||||||
import "../../../components/ha-icon-next";
|
import "../../../components/ha-icon-next";
|
||||||
@ -76,6 +77,12 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
|||||||
? this.getDeviceEntry(entityEntry.device_id)
|
? this.getDeviceEntry(entityEntry.device_id)
|
||||||
: undefined;
|
: 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`
|
return html`
|
||||||
<ha-md-list-item
|
<ha-md-list-item
|
||||||
class=${ifDefined(
|
class=${ifDefined(
|
||||||
@ -106,7 +113,7 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
|||||||
"ui.panel.config.updates.update_in_progress"
|
"ui.panel.config.updates.update_in_progress"
|
||||||
)}
|
)}
|
||||||
></ha-spinner>`
|
></ha-spinner>`
|
||||||
: ""}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
>${deviceEntry
|
>${deviceEntry
|
||||||
@ -114,10 +121,11 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
|||||||
: entity.attributes.friendly_name}</span
|
: entity.attributes.friendly_name}</span
|
||||||
>
|
>
|
||||||
<span slot="supporting-text">
|
<span slot="supporting-text">
|
||||||
|
${areaName ? html`${areaName} ⸱ ` : nothing}
|
||||||
${entity.attributes.title} ${entity.attributes.latest_version}
|
${entity.attributes.title} ${entity.attributes.latest_version}
|
||||||
${entity.attributes.skipped_version
|
${entity.attributes.skipped_version
|
||||||
? `(${this.hass.localize("ui.panel.config.updates.skipped")})`
|
? `(${this.hass.localize("ui.panel.config.updates.skipped")})`
|
||||||
: ""}
|
: nothing}
|
||||||
</span>
|
</span>
|
||||||
${!this.narrow
|
${!this.narrow
|
||||||
? entity.attributes.in_progress
|
? entity.attributes.in_progress
|
||||||
@ -130,7 +138,7 @@ class HaConfigUpdates extends SubscribeMixin(LitElement) {
|
|||||||
></ha-spinner>
|
></ha-spinner>
|
||||||
</div>`
|
</div>`
|
||||||
: html`<ha-icon-next slot="end"></ha-icon-next>`
|
: html`<ha-icon-next slot="end"></ha-icon-next>`
|
||||||
: ""}
|
: nothing}
|
||||||
</ha-md-list-item>
|
</ha-md-list-item>
|
||||||
`;
|
`;
|
||||||
})}
|
})}
|
||||||
|
@ -2119,7 +2119,8 @@
|
|||||||
"join_beta": "[%key:supervisor::system::supervisor::join_beta_action%]",
|
"join_beta": "[%key:supervisor::system::supervisor::join_beta_action%]",
|
||||||
"leave_beta": "[%key:supervisor::system::supervisor::leave_beta_action%]",
|
"leave_beta": "[%key:supervisor::system::supervisor::leave_beta_action%]",
|
||||||
"skipped": "Skipped",
|
"skipped": "Skipped",
|
||||||
"update_in_progress": "Update in progress"
|
"update_in_progress": "Update in progress",
|
||||||
|
"no_area": "No area"
|
||||||
},
|
},
|
||||||
"repairs": {
|
"repairs": {
|
||||||
"caption": "Repairs",
|
"caption": "Repairs",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user