diff --git a/src/panels/config/core/ha-config-section-updates.ts b/src/panels/config/core/ha-config-section-updates.ts index e7f11d6318..4b2da37924 100644 --- a/src/panels/config/core/ha-config-section-updates.ts +++ b/src/panels/config/core/ha-config-section-updates.ts @@ -1,15 +1,16 @@ -import type { ActionDetail } from "@material/mwc-list"; -import "@material/mwc-list/mwc-list-item"; +import { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import { mdiDotsVertical, mdiRefresh } from "@mdi/js"; import { HassEntities } from "home-assistant-js-websocket"; import { css, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; +import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event"; import "../../../components/ha-alert"; import "../../../components/ha-bar"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; +import "../../../components/ha-check-list-item"; import "../../../components/ha-metric"; import { extractApiErrorMessage } from "../../../data/hassio/common"; import { @@ -72,20 +73,23 @@ class HaConfigSectionUpdates extends LitElement { .path=${mdiRefresh} @click=${this._checkUpdates} > - + - - ${this._showSkipped - ? this.hass.localize("ui.panel.config.updates.hide_skipped") - : this.hass.localize("ui.panel.config.updates.show_skipped")} - + + ${this.hass.localize("ui.panel.config.updates.show_skipped")} + ${this._supervisorInfo?.channel !== "dev" ? html` - +
  • + ${this._supervisorInfo?.channel === "stable" ? this.hass.localize("ui.panel.config.updates.join_beta") : this.hass.localize( @@ -122,18 +126,21 @@ class HaConfigSectionUpdates extends LitElement { `; } - private _handleAction(ev: CustomEvent) { - switch (ev.detail.index) { - case 0: - this._showSkipped = !this._showSkipped; - break; - case 1: - this._toggleBeta(); - break; + private _toggleSkipped(ev: CustomEvent): void { + if (ev.detail.source !== "property") { + return; } + + this._showSkipped = !this._showSkipped; } - private async _toggleBeta(): Promise { + private async _toggleBeta( + ev: CustomEvent + ): Promise { + if (!shouldHandleRequestSelectedEvent(ev)) { + return; + } + if (this._supervisorInfo!.channel === "stable") { const confirmed = await showConfirmationDialog(this, { title: this.hass.localize("ui.dialogs.join_beta_channel.title"), @@ -206,6 +213,9 @@ class HaConfigSectionUpdates extends LitElement { .no-updates { padding: 16px; } + li[divider] { + border-bottom-color: var(--divider-color); + } `; } diff --git a/src/panels/config/repairs/dialog-integration-startup.ts b/src/panels/config/repairs/dialog-integration-startup.ts index 971be731f6..edc9c96aa6 100644 --- a/src/panels/config/repairs/dialog-integration-startup.ts +++ b/src/panels/config/repairs/dialog-integration-startup.ts @@ -1,5 +1,5 @@ import "@material/mwc-button/mwc-button"; -import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-card"; @@ -31,13 +31,14 @@ class DialogIntegrationStartup extends LitElement { return html`
    - + + + ${this.hass.localize("ui.panel.config.repairs.show_ignored")} + +
  • ${isComponentLoaded(this.hass, "system_health") || isComponentLoaded(this.hass, "hassio") ? html` @@ -90,11 +99,6 @@ class HaConfigRepairsDashboard extends SubscribeMixin(LitElement) { "ui.panel.config.repairs.integration_startup_time" )} - - ${this._showIgnored - ? this.hass.localize("ui.panel.config.repairs.hide_ignored") - : this.hass.localize("ui.panel.config.repairs.show_ignored")} -
    @@ -143,7 +147,7 @@ class HaConfigRepairsDashboard extends SubscribeMixin(LitElement) { } private _toggleIgnored(ev: CustomEvent): void { - if (!shouldHandleRequestSelectedEvent(ev)) { + if (ev.detail.source !== "property") { return; } @@ -177,6 +181,9 @@ class HaConfigRepairsDashboard extends SubscribeMixin(LitElement) { .no-repairs { padding: 16px; } + li[divider] { + border-bottom-color: var(--divider-color); + } `; } diff --git a/src/translations/en.json b/src/translations/en.json index e44d991384..6ef64b1060 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1220,8 +1220,7 @@ "version_available": "Version {version_available} is available", "more_updates": "Show all updates", "show": "show", - "show_skipped": "Show skipped", - "hide_skipped": "Hide skipped", + "show_skipped": "Show skipped updates", "join_beta": "[%key:supervisor::system::supervisor::join_beta_action%]", "leave_beta": "[%key:supervisor::system::supervisor::leave_beta_action%]", "skipped": "Skipped" @@ -1232,8 +1231,7 @@ "title": "{count} {count, plural,\n one {repair}\n other {repairs}\n}", "no_repairs": "There are currently no repairs available", "more_repairs": "Show all repairs", - "show_ignored": "Show ignored", - "hide_ignored": "Hide ignored", + "show_ignored": "Show ignored repairs", "critical": "Critical", "error": "Error", "warning": "Warning",