mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Sort domains correctly, scroll to top on back (#19197)
This commit is contained in:
parent
721ec8e559
commit
ee57f26415
@ -254,31 +254,29 @@ class DialogAddAutomationElement extends LitElement implements HassDialog {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const result: ListItem[] = [];
|
const result: ListItem[] = [];
|
||||||
Object.keys(services)
|
Object.keys(services).forEach((domain) => {
|
||||||
.sort()
|
const manifest = manifests[domain];
|
||||||
.forEach((domain) => {
|
if (
|
||||||
const manifest = manifests[domain];
|
(type === undefined &&
|
||||||
if (
|
manifest?.integration_type === "entity" &&
|
||||||
(type === undefined &&
|
!ENTITY_DOMAINS_OTHER.has(domain)) ||
|
||||||
manifest?.integration_type === "entity" &&
|
(type === "helper" && manifest?.integration_type === "helper") ||
|
||||||
!ENTITY_DOMAINS_OTHER.has(domain)) ||
|
(type === "other" &&
|
||||||
(type === "helper" && manifest?.integration_type === "helper") ||
|
(ENTITY_DOMAINS_OTHER.has(domain) ||
|
||||||
(type === "other" &&
|
!["helper", "entity"].includes(manifest?.integration_type || "")))
|
||||||
(ENTITY_DOMAINS_OTHER.has(domain) ||
|
) {
|
||||||
!["helper", "entity"].includes(
|
result.push({
|
||||||
manifest?.integration_type || ""
|
group: true,
|
||||||
)))
|
icon: domainIcon(domain),
|
||||||
) {
|
key: `${SERVICE_PREFIX}${domain}`,
|
||||||
result.push({
|
name: domainToName(localize, domain, manifest),
|
||||||
group: true,
|
description: "",
|
||||||
icon: domainIcon(domain),
|
});
|
||||||
key: `${SERVICE_PREFIX}${domain}`,
|
}
|
||||||
name: domainToName(localize, domain, manifest),
|
});
|
||||||
description: "",
|
return result.sort((a, b) =>
|
||||||
});
|
stringCompare(a.name, b.name, this.hass.locale.language)
|
||||||
}
|
);
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -515,6 +513,7 @@ class DialogAddAutomationElement extends LitElement implements HassDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _back() {
|
private _back() {
|
||||||
|
this._dialog!.scrollToPos(0, 0);
|
||||||
if (this._filter) {
|
if (this._filter) {
|
||||||
this._filter = "";
|
this._filter = "";
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user