Merge pull request #6431 from yosilevy/Unused-entities-search

ha-data-table search label + no data text label
This commit is contained in:
Yosi Levy 2020-07-20 14:31:41 +03:00 committed by GitHub
commit ccafdc6e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 2 deletions

View File

@ -98,6 +98,8 @@ export class HaDataTable extends LitElement {
@property({ type: String }) public noDataText?: string; @property({ type: String }) public noDataText?: string;
@property({ type: String }) public searchLabel?: string;
@property({ type: String }) public filter = ""; @property({ type: String }) public filter = "";
@internalProperty() private _filterable = false; @internalProperty() private _filterable = false;
@ -202,6 +204,7 @@ export class HaDataTable extends LitElement {
<div class="table-header"> <div class="table-header">
<search-input <search-input
@value-changed=${this._handleSearchChange} @value-changed=${this._handleSearchChange}
.label=${this.searchLabel}
></search-input> ></search-input>
</div> </div>
` `

View File

@ -93,6 +93,8 @@ export class ZHAClustersDataTable extends LitElement {
selectable selectable
auto-height auto-height
.dir=${computeRTLDirection(this.hass)} .dir=${computeRTLDirection(this.hass)}
.searchLabel=${this.hass.localize("ui.components.data-table.search")}
.noDataText=${this.hass.localize("ui.components.data-table.no-data")}
></ha-data-table> ></ha-data-table>
`; `;
} }

View File

@ -149,6 +149,8 @@ export class ZHADeviceEndpointDataTable extends LitElement {
.selectable=${this.selectable} .selectable=${this.selectable}
auto-height auto-height
.dir=${computeRTLDirection(this.hass)} .dir=${computeRTLDirection(this.hass)}
.searchLabel=${this.hass.localize("ui.components.data-table.search")}
.noDataText=${this.hass.localize("ui.components.data-table.no-data")}
></ha-data-table> ></ha-data-table>
`; `;
} }

View File

@ -176,6 +176,12 @@ export class HuiUnusedEntities extends LitElement {
selectable selectable
@selection-changed=${this._handleSelectionChanged} @selection-changed=${this._handleSelectionChanged}
.dir=${computeRTLDirection(this.hass)} .dir=${computeRTLDirection(this.hass)}
.searchLabel=${this.hass.localize(
"ui.panel.lovelace.unused_entities.search"
)}
.noDataText=${this.hass.localize(
"ui.panel.lovelace.unused_entities.no_data"
)}
></ha-data-table> ></ha-data-table>
${this._selectedEntities.length ${this._selectedEntities.length

View File

@ -335,7 +335,8 @@
"automation": "Part of the following automations" "automation": "Part of the following automations"
}, },
"data-table": { "data-table": {
"search": "Search" "search": "Search",
"no-data": "No data"
} }
}, },
"dialogs": { "dialogs": {
@ -1829,7 +1830,9 @@
"entity": "Entity", "entity": "Entity",
"entity_id": "Entity ID", "entity_id": "Entity ID",
"domain": "Domain", "domain": "Domain",
"last_changed": "Last Changed" "last_changed": "Last Changed",
"search": "Search entities",
"no_data": "No unused entities found"
}, },
"add_entities": { "add_entities": {
"yaml_unsupported": "You cannot use this function when using Lovelace UI in YAML mode.", "yaml_unsupported": "You cannot use this function when using Lovelace UI in YAML mode.",