mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Sort addons in backup by name (#23442)
* Sort addons in backup by name * Update ha-backup-addons-picker.ts
This commit is contained in:
parent
7150016375
commit
f7dbd38c2e
@ -2,7 +2,9 @@ import { mdiPuzzle } from "@mdi/js";
|
||||
import type { CSSResultGroup } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||
import { stringCompare } from "../../../../common/string/compare";
|
||||
import "../../../../components/ha-checkbox";
|
||||
import type { HaCheckbox } from "../../../../components/ha-checkbox";
|
||||
import "../../../../components/ha-formfield";
|
||||
@ -29,10 +31,16 @@ export class HaBackupAddonsPicker extends LitElement {
|
||||
@property({ attribute: "hide-version", type: Boolean })
|
||||
public hideVersion = false;
|
||||
|
||||
private _addons = memoizeOne((addons: BackupAddonItem[]) =>
|
||||
addons.sort((a, b) =>
|
||||
stringCompare(a.name, b.name, this.hass.locale.language)
|
||||
)
|
||||
);
|
||||
|
||||
protected render() {
|
||||
return html`
|
||||
<div class="items">
|
||||
${this.addons.map(
|
||||
${this._addons(this.addons).map(
|
||||
(item) => html`
|
||||
<ha-formfield>
|
||||
<ha-backup-formfield-label
|
||||
|
Loading…
x
Reference in New Issue
Block a user