Skip to content

Commit

Permalink
Fix zwave_js provisioned table for narrow (#22507)
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts authored Oct 24, 2024
1 parent 913837f commit 5843877
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
SecurityClass,
unprovisionZwaveSmartStartNode,
} from "../../../../../data/zwave_js";
import { LocalizeFunc } from "../../../../../common/translations/localize";
import { showConfirmationDialog } from "../../../../../dialogs/generic/show-dialog-box";
import "../../../../../layouts/hass-tabs-subpage-data-table";
import { HomeAssistant, Route } from "../../../../../types";
Expand All @@ -33,19 +34,20 @@ class ZWaveJSProvisioned extends LitElement {
.narrow=${this.narrow}
.route=${this.route}
.tabs=${configTabs}
.columns=${this._columns(this.narrow)}
.columns=${this._columns(this.hass.localize)}
.data=${this._provisioningEntries}
>
</hass-tabs-subpage-data-table>
`;
}

private _columns = memoizeOne(
(narrow: boolean): DataTableColumnContainer<ZwaveJSProvisioningEntry> => ({
(
localize: LocalizeFunc
): DataTableColumnContainer<ZwaveJSProvisioningEntry> => ({
included: {
title: this.hass.localize(
"ui.panel.config.zwave_js.provisioned.included"
),
showNarrow: true,
title: localize("ui.panel.config.zwave_js.provisioned.included"),
type: "icon",
template: (entry) =>
entry.nodeId
Expand All @@ -67,16 +69,16 @@ class ZWaveJSProvisioned extends LitElement {
`,
},
dsk: {
title: this.hass.localize("ui.panel.config.zwave_js.provisioned.dsk"),
main: true,
title: localize("ui.panel.config.zwave_js.provisioned.dsk"),
sortable: true,
filterable: true,
flex: 2,
},
security_classes: {
title: this.hass.localize(
title: localize(
"ui.panel.config.zwave_js.provisioned.security_classes"
),
hidden: narrow,
filterable: true,
sortable: true,
template: (entry) => {
Expand All @@ -91,9 +93,8 @@ class ZWaveJSProvisioned extends LitElement {
},
},
unprovision: {
title: this.hass.localize(
"ui.panel.config.zwave_js.provisioned.unprovison"
),
showNarrow: true,
title: localize("ui.panel.config.zwave_js.provisioned.unprovison"),
type: "icon-button",
template: (entry) => html`
<ha-icon-button
Expand Down

0 comments on commit 5843877

Please sign in to comment.