Fix dialog heading aria label (#11524)

Co-authored-by: Zack Barett <arnett.zackary@gmail.com>
This commit is contained in:
Bram Kragten 2022-02-03 15:54:37 +01:00 committed by GitHub
parent 0c6f647f53
commit 0540bae707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 42 additions and 34 deletions

View File

@ -47,7 +47,9 @@ export class DialogHassioBackupUpload
scrimClickAction
escapeKeyAction
hideActions
.heading=${true}
.heading=${this.hass?.localize(
"ui.panel.page-onboarding.restore.upload_backup"
) || "Upload backup"}
@closed=${this.closeDialog}
>
<div slot="heading">

View File

@ -71,7 +71,7 @@ class HassioBackupDialog
open
scrimClickAction
@closed=${this.closeDialog}
.heading=${true}
.heading=${this._backup.name}
>
<div slot="heading">
<ha-header-bar>

View File

@ -65,7 +65,9 @@ class HassioHardwareDialog extends LitElement {
scrimClickAction
hideActions
@closed=${this.closeDialog}
.heading=${true}
.heading=${this._dialogParams.supervisor.localize(
"dialog.hardware.title"
)}
>
<div class="header" slot="heading">
<h2>

View File

@ -94,7 +94,7 @@ export class DialogHassioNetwork
open
scrimClickAction
escapeKeyAction
.heading=${true}
.heading=${this.supervisor.localize("dialog.network.title")}
hideActions
@closed=${this.closeDialog}
>

View File

@ -55,7 +55,11 @@ class DialogMediaPlayerBrowse extends LitElement {
escapeKeyAction
hideActions
flexContent
.heading=${true}
.heading=${!this._currentItem
? this.hass.localize(
"ui.components.media-browser.media-player-browser"
)
: this._currentItem.title}
@closed=${this.closeDialog}
>
<ha-header-bar slot="heading">

View File

@ -105,7 +105,7 @@ export class MoreInfoDialog extends LitElement {
<ha-dialog
open
@closed=${this.closeDialog}
.heading=${true}
.heading=${name}
hideActions
data-domain=${domain}
>

View File

@ -139,7 +139,7 @@ export class QuickBar extends LitElement {
return html`
<ha-dialog
.heading=${true}
.heading=${this.hass.localize("ui.dialogs.quick-bar.title")}
open
@opened=${this._handleOpened}
@closed=${this.closeDialog}

View File

@ -74,7 +74,9 @@ export class DialogEntityEditor extends LitElement {
return html`
<ha-dialog
open
.heading=${true}
.heading=${stateObj
? computeStateName(stateObj)
: entry?.name || entityId}
hideActions
@closed=${this.closeDialog}
@close-dialog=${this.closeDialog}

View File

@ -69,8 +69,18 @@ class DialogSystemLogDetail extends LitElement {
// Custom components with our official docs should not link to our docs
!this._manifest.documentation.includes("://www.home-assistant.io"));
const title = this.hass.localize(
"ui.panel.config.logs.details",
"level",
html`<span class=${item.level.toLowerCase()}
>${this.hass.localize(
"ui.panel.config.logs.level." + item.level.toLowerCase()
)}</span
>`
);
return html`
<ha-dialog open @closed=${this.closeDialog} hideActions .heading=${true}>
<ha-dialog open @closed=${this.closeDialog} hideActions .heading=${title}>
<ha-header-bar slot="heading">
<ha-icon-button
slot="navigationIcon"
@ -78,17 +88,7 @@ class DialogSystemLogDetail extends LitElement {
.label=${this.hass.localize("ui.common.close")}
.path=${mdiClose}
></ha-icon-button>
<span slot="title">
${this.hass.localize(
"ui.panel.config.logs.details",
"level",
html`<span class=${item.level.toLowerCase()}
>${this.hass.localize(
"ui.panel.config.logs.level." + item.level.toLowerCase()
)}</span
>`
)}
</span>
<span slot="title"> ${title} </span>
<ha-icon-button
id="copy"
@click=${this._copyLog}

View File

@ -65,28 +65,26 @@ export class HuiCreateDialogCard
return html``;
}
const title = this._viewConfig.title
? this.hass!.localize(
"ui.panel.lovelace.editor.edit_card.pick_card_view_title",
"name",
`"${this._viewConfig.title}"`
)
: this.hass!.localize("ui.panel.lovelace.editor.edit_card.pick_card");
return html`
<ha-dialog
open
scrimClickAction
@keydown=${this._ignoreKeydown}
@closed=${this._cancel}
.heading=${true}
.heading=${title}
class=${classMap({ table: this._currTabIndex === 1 })}
>
<div slot="heading">
<ha-header-bar>
<span slot="title">
${this._viewConfig.title
? this.hass!.localize(
"ui.panel.lovelace.editor.edit_card.pick_card_view_title",
"name",
`"${this._viewConfig.title}"`
)
: this.hass!.localize(
"ui.panel.lovelace.editor.edit_card.pick_card"
)}
</span>
<span slot="title"> ${title} </span>
</ha-header-bar>
<mwc-tab-bar
.activeIndex=${this._currTabIndex}

View File

@ -176,7 +176,7 @@ export class HuiDialogEditCard
@keydown=${this._ignoreKeydown}
@closed=${this._cancel}
@opened=${this._opened}
.heading=${true}
.heading=${heading}
>
<div slot="heading">
<ha-header-bar>

View File

@ -173,7 +173,7 @@ export class HuiDialogEditView extends LitElement {
scrimClickAction
escapeKeyAction
@closed=${this.closeDialog}
.heading=${true}
.heading=${this._viewConfigTitle}
>
<div slot="heading">
<h2>${this._viewConfigTitle}</h2>