mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Sort filter-domains on translated name (#21116)
This commit is contained in:
parent
62528b2413
commit
8272bef890
@ -89,13 +89,18 @@ export class HaFilterDomains extends LitElement {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return Array.from(domains.values())
|
return Array.from(domains.values())
|
||||||
|
.map((domain) => ({
|
||||||
|
domain,
|
||||||
|
name: domainToName(this.hass.localize, domain),
|
||||||
|
}))
|
||||||
.filter(
|
.filter(
|
||||||
(entry) =>
|
(entry) =>
|
||||||
!filter ||
|
!filter ||
|
||||||
entry.toLowerCase().includes(filter) ||
|
entry.domain.toLowerCase().includes(filter) ||
|
||||||
domainToName(this.hass.localize, entry).toLowerCase().includes(filter)
|
entry.name.toLowerCase().includes(filter)
|
||||||
)
|
)
|
||||||
.sort((a, b) => stringCompare(a, b, this.hass.locale.language));
|
.sort((a, b) => stringCompare(a.name, b.name, this.hass.locale.language))
|
||||||
|
.map((entry) => entry.domain);
|
||||||
});
|
});
|
||||||
|
|
||||||
protected updated(changed) {
|
protected updated(changed) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user