mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Hide ignored entries (#16737)
This commit is contained in:
parent
b1f5ff26d9
commit
0d0e5fdaaa
@ -213,6 +213,22 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
|||||||
ERROR_STATES.includes(entry.state)
|
ERROR_STATES.includes(entry.state)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const normalEntries = configEntries
|
||||||
|
.filter(
|
||||||
|
(entry) =>
|
||||||
|
entry.source !== "ignore" && !ERROR_STATES.includes(entry.state)
|
||||||
|
)
|
||||||
|
.sort((a, b) => {
|
||||||
|
if (Boolean(a.disabled_by) !== Boolean(b.disabled_by)) {
|
||||||
|
return a.disabled_by ? 1 : -1;
|
||||||
|
}
|
||||||
|
return caseInsensitiveStringCompare(
|
||||||
|
a.title,
|
||||||
|
b.title,
|
||||||
|
this.hass.locale.language
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<hass-subpage
|
<hass-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -414,7 +430,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
|||||||
`ui.panel.config.integrations.integration_page.entries`
|
`ui.panel.config.integrations.integration_page.entries`
|
||||||
)}
|
)}
|
||||||
</h1>
|
</h1>
|
||||||
${configEntries.length === 0
|
${normalEntries.length === 0
|
||||||
? html`<div class="card-content no-entries">
|
? html`<div class="card-content no-entries">
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
`ui.panel.config.integrations.integration_page.no_entries`
|
`ui.panel.config.integrations.integration_page.no_entries`
|
||||||
@ -422,19 +438,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
|||||||
</div>`
|
</div>`
|
||||||
: nothing}
|
: nothing}
|
||||||
<mwc-list>
|
<mwc-list>
|
||||||
${configEntries
|
${normalEntries.map((item) => this._renderConfigEntry(item))}
|
||||||
.filter((entry) => !ERROR_STATES.includes(entry.state))
|
|
||||||
.sort((a, b) => {
|
|
||||||
if (Boolean(a.disabled_by) !== Boolean(b.disabled_by)) {
|
|
||||||
return a.disabled_by ? 1 : -1;
|
|
||||||
}
|
|
||||||
return caseInsensitiveStringCompare(
|
|
||||||
a.title,
|
|
||||||
b.title,
|
|
||||||
this.hass.locale.language
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.map((item) => this._renderConfigEntry(item))}
|
|
||||||
</mwc-list>
|
</mwc-list>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user