mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Sort config flow picker (#3170)
This commit is contained in:
parent
fa13b95498
commit
8c904fb012
@ -8,3 +8,6 @@ export const compare = (a: string, b: string) => {
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
export const caseInsensitiveCompare = (a: string, b: string) =>
|
||||
compare(a.toLowerCase(), b.toLowerCase());
|
||||
|
@ -12,6 +12,7 @@ import "@material/mwc-button";
|
||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||
import "@polymer/paper-tooltip/paper-tooltip";
|
||||
import "@polymer/paper-spinner/paper-spinner";
|
||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
|
||||
import "../../components/ha-form";
|
||||
import "../../components/ha-markdown";
|
||||
@ -44,7 +45,7 @@ import {
|
||||
subscribeAreaRegistry,
|
||||
} from "../../data/area_registry";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import { caseInsensitiveCompare } from "../../common/string/compare";
|
||||
|
||||
let instance = 0;
|
||||
|
||||
@ -88,7 +89,13 @@ class ConfigFlowDialog extends LitElement {
|
||||
this._loading = true;
|
||||
this.updateComplete.then(() => this._scheduleCenterDialog());
|
||||
try {
|
||||
this._handlers = await getConfigFlowHandlers(this.hass);
|
||||
this._handlers = (await getConfigFlowHandlers(this.hass)).sort(
|
||||
(handlerA, handlerB) =>
|
||||
caseInsensitiveCompare(
|
||||
this.hass.localize(`component.${handlerA}.config.title`),
|
||||
this.hass.localize(`component.${handlerB}.config.title`)
|
||||
)
|
||||
);
|
||||
} finally {
|
||||
this._loading = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user