Skip to content

Commit

Permalink
Fix data table types (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Jul 29, 2024
1 parent 3c55c9d commit 04f9377
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/dashboards/hacs-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { mainWindow } from "../../homeassistant-frontend/src/common/dom/get_main
import { navigate } from "../../homeassistant-frontend/src/common/navigate";
import type {
DataTableColumnContainer,
DataTableRowData,
SortingDirection,
} from "../../homeassistant-frontend/src/components/data-table/ha-data-table";
import "../../homeassistant-frontend/src/layouts/hass-tabs-subpage-data-table";
Expand Down Expand Up @@ -50,6 +51,7 @@ import { repositoriesClearNew } from "../data/websocket";
import { HacsStyles } from "../styles/hacs-common-style";
import { documentationUrl } from "../tools/documentation";
import { typeIcon } from "../tools/type-icon";
import { PageNavigation } from "../../homeassistant-frontend/src/layouts/hass-tabs-subpage";

const defaultKeyData = {
title: "",
Expand All @@ -59,9 +61,10 @@ const defaultKeyData = {

const STATUS_ORDER = ["pending-restart", "pending-upgrade", "installed", "new", "default"];

const TABS = [
const TABS: PageNavigation[] = [
{
name: APP_FULL_NAME,
path: "",
},
];

Expand All @@ -88,7 +91,7 @@ export class HacsDashboard extends LitElement {
private _activeGrouping?: string;

@storage({ key: "hacs-table-collapsed", state: false, subscribe: false })
private _activeCollapsed?: string;
private _activeCollapsed?: string[];

@storage({ key: "hacs-active-search", state: true, subscribe: false })
private _activeSearch?: string;
Expand All @@ -113,7 +116,7 @@ export class HacsDashboard extends LitElement {
.data=${repositories}
.hass=${this.hass}
?iswide=${this.isWide}
.localizeFunc=${this.hacs.localize}
.localizeFunc=${this.hacs.localize as LocalizeFunc}
main-page
.narrow=${this.narrow}
.route=${this.route}
Expand All @@ -124,7 +127,7 @@ export class HacsDashboard extends LitElement {
.filters=${this._activeFilters?.length}
.noDataText=${this.hacs.localize("dashboard.no_data")}
.initialGroupColumn=${this._activeGrouping || "translated_status"}
.initialCollapsedGroups=${this._activeCollapsed}
.initialCollapsedGroups=${this._activeCollapsed || []}
.groupOrder=${this._groupOrder(this.hacs.localize, this._activeGrouping)}
.initialSorting=${this._activeSorting}
.columnOrder=${this._orderTableColumns}
Expand Down Expand Up @@ -220,7 +223,7 @@ export class HacsDashboard extends LitElement {
repositories: RepositoryBase[],
localizeFunc: LocalizeFunc<HacsLocalizeKeys>,
activeFilters?: string[],
): RepositoryBase[] =>
): DataTableRowData[] =>
repositories
.filter((repository) => {
if (
Expand Down

0 comments on commit 04f9377

Please sign in to comment.