mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 18:39:40 +00:00
Add filtering and grouping to scenes and scripts (#20203)
* Add filtering and grouping to scenes and scripts * hide labels when there are none * Update ha-data-table.ts
This commit is contained in:
@@ -533,15 +533,20 @@ export class HaDataTable extends LitElement {
|
||||
}, {});
|
||||
const groupedItems: DataTableRowData[] = [];
|
||||
Object.entries(sorted).forEach(([groupName, rows]) => {
|
||||
groupedItems.push({
|
||||
append: true,
|
||||
content: html`<div
|
||||
class="mdc-data-table__cell group-header"
|
||||
role="cell"
|
||||
>
|
||||
${groupName === UNDEFINED_GROUP_KEY ? "" : groupName || ""}
|
||||
</div>`,
|
||||
});
|
||||
if (
|
||||
groupName !== UNDEFINED_GROUP_KEY ||
|
||||
Object.keys(sorted).length > 1
|
||||
) {
|
||||
groupedItems.push({
|
||||
append: true,
|
||||
content: html`<div
|
||||
class="mdc-data-table__cell group-header"
|
||||
role="cell"
|
||||
>
|
||||
${groupName === UNDEFINED_GROUP_KEY ? "" : groupName || ""}
|
||||
</div>`,
|
||||
});
|
||||
}
|
||||
|
||||
groupedItems.push(...rows);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user