diff --git a/gallery/src/demos/demo-ha-alert.ts b/gallery/src/demos/demo-ha-alert.ts index bb833bed54..57b80e47ec 100644 --- a/gallery/src/demos/demo-ha-alert.ts +++ b/gallery/src/demos/demo-ha-alert.ts @@ -9,7 +9,6 @@ const alerts: { description: string | TemplateResult; type: "info" | "warning" | "error" | "success"; dismissable?: boolean; - action?: string; rtl?: boolean; iconSlot?: TemplateResult; actionSlot?: TemplateResult; @@ -76,13 +75,13 @@ const alerts: { title: "Error with action", description: "This is a test error alert with action", type: "error", - action: "restart", + actionSlot: html``, }, { title: "Unsaved data", description: "You have unsaved data", type: "warning", - action: "save", + actionSlot: html``, }, { title: "Slotted icon", @@ -106,7 +105,7 @@ const alerts: { title: "Error with action", description: "This is a test error alert with action (RTL)", type: "error", - action: "restart", + actionSlot: html``, rtl: true, }, { @@ -129,7 +128,6 @@ export class DemoHaAlert extends LitElement { .title=${alert.title || ""} .alertType=${alert.type} .dismissable=${alert.dismissable || false} - .actionText=${alert.action || ""} .rtl=${alert.rtl || false} > ${alert.iconSlot} ${alert.description} ${alert.actionSlot} diff --git a/gallery/src/ha-gallery.js b/gallery/src/ha-gallery.js index 7f53dd717a..671cbe9077 100644 --- a/gallery/src/ha-gallery.js +++ b/gallery/src/ha-gallery.js @@ -176,11 +176,6 @@ class HaGallery extends PolymerElement { this.addEventListener("alert-dismissed-clicked", () => this.$.notifications.showDialog({ message: "Alert dismissed clicked" }) ); - - this.addEventListener("alert-action-clicked", () => - this.$.notifications.showDialog({ message: "Alert action clicked" }) - ); - this.addEventListener("hass-more-info", (ev) => { if (ev.detail.entityId) { this.$.notifications.showDialog({ diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index be50bc59c5..756a471359 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -151,14 +151,18 @@ class HassioAddonInfo extends LitElement { .title=${this.supervisor.localize( "addon.dashboard.protection_mode.title" )} - .actionText=${this.supervisor.localize( - "addon.dashboard.protection_mode.enable" - )} - @alert-action-clicked=${this._protectionToggled} > ${this.supervisor.localize( "addon.dashboard.protection_mode.content" )} + + ` : ""} diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index 887ddd105d..4c3a50efa4 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -151,24 +151,28 @@ class HassioSupervisorInfo extends LitElement { > ` : "" - : html` + : html` ${this.supervisor.localize( "system.supervisor.unsupported_title" )} + + `} ${!this.supervisor.supervisor.healthy - ? html` + ? html` ${this.supervisor.localize( "system.supervisor.unhealthy_title" )} + + ` : ""} @@ -466,6 +470,9 @@ class HassioSupervisorInfo extends LitElement { white-space: normal; color: var(--secondary-text-color); } + ha-alert mwc-button { + --mdc-theme-primary: var(--primary-text-color); + } a { text-decoration: none; } diff --git a/src/components/ha-alert.ts b/src/components/ha-alert.ts index 236ae8c7c5..93df6b7e24 100644 --- a/src/components/ha-alert.ts +++ b/src/components/ha-alert.ts @@ -1,4 +1,3 @@ -import "@material/mwc-button/mwc-button"; import { mdiAlertCircleOutline, mdiAlertOutline, @@ -23,7 +22,6 @@ const ALERT_ICONS = { declare global { interface HASSDomEvents { "alert-dismissed-clicked": undefined; - "alert-action-clicked": undefined; } } @@ -37,8 +35,6 @@ class HaAlert extends LitElement { | "error" | "success" = "info"; - @property({ attribute: "action-text" }) public actionText = ""; - @property({ type: Boolean }) public dismissable = false; @property({ type: Boolean }) public rtl = false; @@ -63,12 +59,7 @@ class HaAlert extends LitElement {
- ${this.actionText - ? html`` - : this.dismissable + ${this.dismissable ? html`