Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/data-table/ha-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface DataTableSortColumnData {

export interface DataTableColumnData<T = any> extends DataTableSortColumnData {
title: TemplateResult | string;
label?: TemplateResult | string;
type?: "numeric" | "icon" | "icon-button" | "overflow-menu";
template?: (data: any, row: T) => TemplateResult | string;
width?: string;
Expand Down Expand Up @@ -294,6 +295,7 @@ export class HaDataTable extends LitElement {
};
return html`
<div
aria-label=${column.label}
class="mdc-data-table__header-cell ${classMap(classes)}"
style=${column.width
? styleMap({
Expand Down
9 changes: 9 additions & 0 deletions src/panels/config/automation/ha-automation-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class HaAutomationPicker extends LitElement {
const columns: DataTableColumnContainer = {
toggle: {
title: "",
label: this.hass.localize(
"ui.panel.config.automation.picker.headers.toggle"
),
type: "icon",
template: (_toggle, automation: any) =>
html`
Expand Down Expand Up @@ -127,6 +130,9 @@ class HaAutomationPicker extends LitElement {
`,
};
columns.trigger = {
label: this.hass.localize(
"ui.panel.config.automation.picker.headers.trigger"
),
title: html`
<mwc-button style="visibility: hidden">
${this.hass.localize("ui.card.automation.trigger")}
Expand All @@ -146,6 +152,9 @@ class HaAutomationPicker extends LitElement {
}
columns.actions = {
title: "",
label: this.hass.localize(
"ui.panel.config.automation.picker.headers.actions"
),
type: "overflow-menu",
template: (_info, automation: any) => html`
<ha-icon-overflow-menu
Expand Down
3 changes: 3 additions & 0 deletions src/panels/config/devices/ha-config-devices-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ export class HaConfigDeviceDashboard extends LitElement {
if (showDisabled) {
columns.disabled_by = {
title: "",
label: this.hass.localize(
"ui.panel.config.devices.data_table.disabled_by"
),
type: "icon",
template: (disabled_by) =>
disabled_by
Expand Down
3 changes: 3 additions & 0 deletions src/panels/config/entities/ha-config-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
(narrow, _language, showDisabled): DataTableColumnContainer<EntityRow> => ({
icon: {
title: "",
label: this.hass.localize(
"ui.panel.config.entities.picker.headers.state_icon"
),
type: "icon",
template: (_, entry: EntityRow) => html`
<ha-state-icon
Expand Down
6 changes: 6 additions & 0 deletions src/panels/config/helpers/ha-config-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class HaConfigHelpers extends LitElement {
const columns: DataTableColumnContainer = {
icon: {
title: "",
label: this.hass.localize(
"ui.panel.config.helpers.picker.headers.icon"
),
type: "icon",
template: (icon, helper: any) =>
icon
Expand Down Expand Up @@ -88,6 +91,9 @@ export class HaConfigHelpers extends LitElement {
};
columns.editable = {
title: "",
label: this.hass.localize(
"ui.panel.config.helpers.picker.headers.editable"
),
type: "icon",
template: (editable) => html`
${!editable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export class HaConfigLovelaceDashboards extends LitElement {
const columns: DataTableColumnContainer = {
icon: {
title: "",
label: this.hass.localize(
"ui.panel.config.lovelace.dashboards.picker.headers.icon"
),
type: "icon",
template: (icon, dashboard) =>
icon
Expand Down Expand Up @@ -161,6 +164,9 @@ export class HaConfigLovelaceDashboards extends LitElement {

columns.url_path = {
title: "",
label: this.hass.localize(
"ui.panel.config.lovelace.dashboards.picker.headers.url"
),
filterable: true,
width: "100px",
template: (urlPath) =>
Expand Down
8 changes: 8 additions & 0 deletions src/panels/config/scene/ha-scene-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class HaSceneDashboard extends LitElement {
(_language): DataTableColumnContainer => ({
activate: {
title: "",
label: this.hass.localize(
"ui.panel.config.scene.picker.headers.activate"
),
type: "icon-button",
template: (_toggle, scene) =>
html`
Expand All @@ -82,6 +85,7 @@ class HaSceneDashboard extends LitElement {
},
icon: {
title: "",
label: this.hass.localize("ui.panel.config.scene.picker.headers.state"),
type: "icon",
template: (_, scene) =>
html` <ha-state-icon .state=${scene}></ha-state-icon> `,
Expand All @@ -95,6 +99,9 @@ class HaSceneDashboard extends LitElement {
},
info: {
title: "",
label: this.hass.localize(
"ui.panel.config.scene.picker.headers.show_info"
),
type: "icon-button",
template: (_info, scene) => html`
<ha-icon-button
Expand All @@ -109,6 +116,7 @@ class HaSceneDashboard extends LitElement {
},
edit: {
title: "",
label: this.hass.localize("ui.panel.config.scene.picker.headers.edit"),
type: "icon-button",
template: (_info, scene: any) => html`
<a
Expand Down
7 changes: 7 additions & 0 deletions src/panels/config/script/ha-script-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class HaScriptPicker extends LitElement {
const columns: DataTableColumnContainer = {
activate: {
title: "",
label: this.hass.localize("ui.panel.config.script.picker.run_script"),
type: "icon-button",
template: (_toggle, script) =>
html`
Expand All @@ -84,6 +85,9 @@ class HaScriptPicker extends LitElement {
},
icon: {
title: "",
label: this.hass.localize(
"ui.panel.config.script.picker.headers.state"
),
type: "icon",
template: (_icon, script) =>
html` <ha-state-icon .state=${script}></ha-state-icon>`,
Expand Down Expand Up @@ -124,6 +128,7 @@ class HaScriptPicker extends LitElement {
}
columns.info = {
title: "",
label: this.hass.localize("ui.panel.config.script.picker.show_info"),
type: "icon-button",
template: (_info, script) => html`
<ha-icon-button
Expand All @@ -138,6 +143,7 @@ class HaScriptPicker extends LitElement {
};
columns.trace = {
title: "",
label: this.hass.localize("ui.panel.config.script.picker.dev_script"),
type: "icon-button",
template: (_info, script: any) => html`
<a href="/config/script/trace/${script.entity_id}">
Expand All @@ -152,6 +158,7 @@ class HaScriptPicker extends LitElement {
};
columns.edit = {
title: "",
label: this.hass.localize("ui.panel.config.script.picker.edit_script"),
type: "icon-button",
template: (_info, script: any) => html`
<a href="/config/script/edit/${script.entity_id}">
Expand Down
2 changes: 2 additions & 0 deletions src/panels/config/tags/ha-config-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
const columns: DataTableColumnContainer = {
icon: {
title: "",
label: this.hass.localize("ui.panel.config.tag.headers.icon"),
type: "icon",
template: (_icon, tag) => html`<tag-image .tag=${tag}></tag-image>`,
},
Expand Down Expand Up @@ -103,6 +104,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
if (this._canWriteTags) {
columns.write = {
title: "",
label: this.hass.localize("ui.panel.config.tag.headers.write"),
type: "icon-button",
template: (_write, tag: any) => html` <ha-icon-button
.tag=${tag}
Expand Down
3 changes: 3 additions & 0 deletions src/panels/config/users/ha-config-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ export class HaConfigUsers extends LitElement {
},
icons: {
title: "",
label: this.hass.localize(
"ui.panel.config.users.picker.headers.icon"
),
type: "icon",
sortable: false,
filterable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export class HuiEntityPickerTable extends LitElement {
const columns: DataTableColumnContainer = {
icon: {
title: "",
label: this.hass!.localize(
"ui.panel.lovelace.unused_entities.state_icon"
),
type: "icon",
template: (_icon, entity: any) => html`
<state-badge
Expand Down
29 changes: 23 additions & 6 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,10 @@
"confirm_remove": "Are you sure you want to remove tag {tag}?",
"automation_title": "Tag {name} is scanned",
"headers": {
"icon": "Icon",
"name": "Name",
"last_scanned": "Last scanned"
"last_scanned": "Last scanned",
"write": "Write"
},
"detail": {
"new_tag": "New tag",
Expand Down Expand Up @@ -1270,6 +1272,7 @@
},
"picker": {
"headers": {
"icon": "Icon",
"name": "Name",
"entity_id": "Entity ID",
"type": "Type",
Expand Down Expand Up @@ -1374,12 +1377,14 @@
},
"picker": {
"headers": {
"icon": "Icon",
"title": "Title",
"conf_mode": "Configuration method",
"default": "Default",
"require_admin": "Admin only",
"sidebar": "Show in sidebar",
"filename": "Filename"
"filename": "Filename",
"url": "Open"
},
"open": "Open",
"add_dashboard": "Add dashboard"
Expand Down Expand Up @@ -1519,7 +1524,10 @@
"duplicate_automation": "Duplicate automation",
"duplicate": "Duplicate",
"headers": {
"name": "Name"
"toggle": "Enable/disable",
"name": "Name",
"trigger": "Trigger",
"actions": "Actions"
}
},
"dialog_new": {
Expand Down Expand Up @@ -1928,7 +1936,8 @@
"edit_script": "Edit script",
"dev_script": "Debug script",
"headers": {
"name": "Name"
"name": "Name",
"state": "State"
},
"duplicate_script": "Duplicate script",
"duplicate": "[%key:ui::panel::config::automation::picker::duplicate%]"
Expand Down Expand Up @@ -1984,7 +1993,11 @@
"duplicate_scene": "Duplicate scene",
"duplicate": "Duplicate",
"headers": {
"name": "Name"
"activate": "Activate",
"state": "State",
"name": "Name",
"show_info": "Show information",
"edit": "Edit"
}
},
"editor": {
Expand Down Expand Up @@ -2298,6 +2311,7 @@
"area": "Area",
"integration": "Integration",
"battery": "Battery",
"disabled_by": "Disabled",
"no_devices": "No devices",
"no_integration": "No integration"
},
Expand Down Expand Up @@ -2337,6 +2351,7 @@
"ok": "Ok"
},
"headers": {
"state_icon": "State icon",
"name": "Name",
"entity_id": "Entity ID",
"integration": "Integration",
Expand Down Expand Up @@ -2562,7 +2577,8 @@
"group": "Group",
"system": "System",
"is_active": "Active",
"local": "Local"
"local": "Local",
"icon": "Icon"
},
"add_user": "Add user"
},
Expand Down Expand Up @@ -3190,6 +3206,7 @@
"title": "Unused entities",
"available_entities": "These are the entities that you have available, but are not in your Lovelace UI yet.",
"select_to_add": "Select the entities you want to add to a card and then click the add card button.",
"state_icon": "State",
"entity": "Entity",
"entity_id": "Entity ID",
"domain": "Domain",
Expand Down