20240530.0 (#20925)

This commit is contained in:
Bram Kragten 2024-05-30 16:27:39 +02:00 committed by GitHub
commit 10a5c4dfb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 118 additions and 143 deletions

View File

@ -126,6 +126,5 @@
"lit-a11y/anchor-is-valid": "warn", "lit-a11y/anchor-is-valid": "warn",
"lit-a11y/role-has-required-aria-attrs": "warn" "lit-a11y/role-has-required-aria-attrs": "warn"
}, },
"plugins": ["disable", "unused-imports"], "plugins": ["unused-imports"]
"processor": "disable/disable"
} }

View File

@ -198,7 +198,6 @@
"eslint-config-airbnb-typescript": "18.0.0", "eslint-config-airbnb-typescript": "18.0.0",
"eslint-config-prettier": "9.1.0", "eslint-config-prettier": "9.1.0",
"eslint-import-resolver-webpack": "0.13.8", "eslint-import-resolver-webpack": "0.13.8",
"eslint-plugin-disable": "2.0.3",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.29.1",
"eslint-plugin-lit": "1.13.0", "eslint-plugin-lit": "1.13.0",
"eslint-plugin-lit-a11y": "4.1.2", "eslint-plugin-lit-a11y": "4.1.2",

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "home-assistant-frontend" name = "home-assistant-frontend"
version = "20240529.0" version = "20240530.0"
license = {text = "Apache-2.0"} license = {text = "Apache-2.0"}
description = "The Home Assistant frontend" description = "The Home Assistant frontend"
readme = "README.md" readme = "README.md"

View File

@ -82,10 +82,13 @@ class HaConfigSectionUpdates extends LitElement {
> >
${this.hass.localize("ui.panel.config.updates.show_skipped")} ${this.hass.localize("ui.panel.config.updates.show_skipped")}
</ha-check-list-item> </ha-check-list-item>
${this._supervisorInfo && this._supervisorInfo.channel !== "dev" ${this._supervisorInfo
? html` ? html`
<li divider role="separator"></li> <li divider role="separator"></li>
<mwc-list-item @request-selected=${this._toggleBeta}> <mwc-list-item
@request-selected=${this._toggleBeta}
.disabled=${this._supervisorInfo.channel === "dev"}
>
${this._supervisorInfo.channel === "stable" ${this._supervisorInfo.channel === "stable"
? this.hass.localize("ui.panel.config.updates.join_beta") ? this.hass.localize("ui.panel.config.updates.join_beta")
: this.hass.localize( : this.hass.localize(

View File

@ -1,6 +1,6 @@
import "@lrnwebcomponents/simple-tooltip/simple-tooltip"; import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
import "@material/mwc-list/mwc-list"; import "@material/mwc-list/mwc-list";
import { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item-base"; import "@material/web/divider/divider";
import { import {
mdiAlertCircle, mdiAlertCircle,
mdiBookshelf, mdiBookshelf,
@ -27,13 +27,13 @@ import {
} from "@mdi/js"; } from "@mdi/js";
import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { UnsubscribeFunc } from "home-assistant-js-websocket";
import { import {
css,
CSSResultGroup, CSSResultGroup,
html,
LitElement, LitElement,
nothing,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
css,
html,
nothing,
} from "lit"; } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map"; import { classMap } from "lit/directives/class-map";
@ -41,15 +41,15 @@ import { until } from "lit/directives/until";
import memoizeOne from "memoize-one"; import memoizeOne from "memoize-one";
import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { isDevVersion } from "../../../common/config/version"; import { isDevVersion } from "../../../common/config/version";
import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event";
import { caseInsensitiveStringCompare } from "../../../common/string/compare"; import { caseInsensitiveStringCompare } from "../../../common/string/compare";
import { nextRender } from "../../../common/util/render-status"; import { nextRender } from "../../../common/util/render-status";
import "../../../components/ha-button"; import "../../../components/ha-button";
import "../../../components/ha-button-menu-new";
import "../../../components/ha-card"; import "../../../components/ha-card";
import "../../../components/ha-list-item"; import "../../../components/ha-list-item";
import "../../../components/ha-list-new";
import "../../../components/ha-list-item-new"; import "../../../components/ha-list-item-new";
import "../../../components/ha-button-menu-new"; import "../../../components/ha-list-new";
import "../../../components/ha-menu-item";
import { import {
deleteApplicationCredential, deleteApplicationCredential,
fetchApplicationCredentialsConfigEntry, fetchApplicationCredentialsConfigEntry,
@ -57,13 +57,13 @@ import {
import { getSignedPath } from "../../../data/auth"; import { getSignedPath } from "../../../data/auth";
import { import {
ConfigEntry, ConfigEntry,
DisableConfigEntryResult,
ERROR_STATES,
RECOVERABLE_STATES,
deleteConfigEntry, deleteConfigEntry,
disableConfigEntry, disableConfigEntry,
DisableConfigEntryResult,
enableConfigEntry, enableConfigEntry,
ERROR_STATES,
getConfigEntries, getConfigEntries,
RECOVERABLE_STATES,
reloadConfigEntry, reloadConfigEntry,
updateConfigEntry, updateConfigEntry,
} from "../../../data/config_entries"; } from "../../../data/config_entries";
@ -80,13 +80,13 @@ import {
} from "../../../data/entity_registry"; } from "../../../data/entity_registry";
import { getErrorLogDownloadUrl } from "../../../data/error_log"; import { getErrorLogDownloadUrl } from "../../../data/error_log";
import { import {
IntegrationLogInfo,
IntegrationManifest,
LogSeverity,
domainToName, domainToName,
fetchIntegrationManifest, fetchIntegrationManifest,
integrationIssuesUrl, integrationIssuesUrl,
IntegrationLogInfo,
IntegrationManifest,
integrationsWithPanel, integrationsWithPanel,
LogSeverity,
setIntegrationLogLevel, setIntegrationLogLevel,
subscribeLogInfo, subscribeLogInfo,
} from "../../../data/integration"; } from "../../../data/integration";
@ -792,104 +792,98 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
RECOVERABLE_STATES.includes(item.state) && RECOVERABLE_STATES.includes(item.state) &&
item.supports_unload && item.supports_unload &&
item.source !== "system" item.source !== "system"
? html`<ha-list-item ? html`
@request-selected=${this._handleReload} <ha-menu-item @click=${this._handleReload}>
graphic="icon" <ha-svg-icon slot="start" .path=${mdiReload}></ha-svg-icon>
> ${this.hass.localize(
${this.hass.localize( "ui.panel.config.integrations.config_entry.reload"
"ui.panel.config.integrations.config_entry.reload" )}
)} </ha-menu-item>
<ha-svg-icon slot="graphic" .path=${mdiReload}></ha-svg-icon> `
</ha-list-item>` : nothing}
: ""}
<ha-list-item @request-selected=${this._handleRename} graphic="icon"> <ha-menu-item @click=${this._handleRename} graphic="icon">
<ha-svg-icon slot="start" .path=${mdiRenameBox}></ha-svg-icon>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.integrations.config_entry.rename" "ui.panel.config.integrations.config_entry.rename"
)} )}
<ha-svg-icon slot="graphic" .path=${mdiRenameBox}></ha-svg-icon> </ha-menu-item>
</ha-list-item>
<li divider role="separator"></li> <md-divider role="separator" tabindex="-1"></md-divider>
${this._diagnosticHandler && item.state === "loaded" ${this._diagnosticHandler && item.state === "loaded"
? html`<a ? html`
href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)} <ha-menu-item
target="_blank" href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
@click=${this._signUrl} target="_blank"
> @click=${this._signUrl}
<ha-list-item graphic="icon"> >
<ha-svg-icon slot="start" .path=${mdiDownload}></ha-svg-icon>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.integrations.config_entry.download_diagnostics" "ui.panel.config.integrations.config_entry.download_diagnostics"
)} )}
<ha-svg-icon slot="graphic" .path=${mdiDownload}></ha-svg-icon> </ha-menu-item>
</ha-list-item> `
</a>`
: ""} : ""}
${!item.disabled_by && ${!item.disabled_by &&
item.supports_reconfigure && item.supports_reconfigure &&
item.source !== "system" item.source !== "system"
? html`<ha-list-item ? html`
@request-selected=${this._handleReconfigure} <ha-menu-item @click=${this._handleReconfigure}>
graphic="icon" <ha-svg-icon slot="start" .path=${mdiWrench}></ha-svg-icon>
> ${this.hass.localize(
${this.hass.localize( "ui.panel.config.integrations.config_entry.reconfigure"
"ui.panel.config.integrations.config_entry.reconfigure" )}
)} </ha-menu-item>
<ha-svg-icon slot="graphic" .path=${mdiWrench}></ha-svg-icon> `
</ha-list-item>` : nothing}
: ""}
<ha-list-item <ha-menu-item @click=${this._handleSystemOptions} graphic="icon">
@request-selected=${this._handleSystemOptions} <ha-svg-icon slot="start" .path=${mdiCog}></ha-svg-icon>
graphic="icon"
>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.integrations.config_entry.system_options" "ui.panel.config.integrations.config_entry.system_options"
)} )}
<ha-svg-icon slot="graphic" .path=${mdiCog}></ha-svg-icon> </ha-menu-item>
</ha-list-item>
${item.disabled_by === "user" ${item.disabled_by === "user"
? html`<ha-list-item ? html`
@request-selected=${this._handleEnable} <ha-menu-item @click=${this._handleEnable}>
graphic="icon"
>
${this.hass.localize("ui.common.enable")}
<ha-svg-icon
slot="graphic"
.path=${mdiPlayCircleOutline}
></ha-svg-icon>
</ha-list-item>`
: item.source !== "system"
? html`<ha-list-item
class="warning"
@request-selected=${this._handleDisable}
graphic="icon"
>
${this.hass.localize("ui.common.disable")}
<ha-svg-icon <ha-svg-icon
slot="graphic" slot="start"
class="warning" .path=${mdiPlayCircleOutline}
.path=${mdiStopCircleOutline}
></ha-svg-icon> ></ha-svg-icon>
</ha-list-item>` ${this.hass.localize("ui.common.enable")}
: ""} </ha-menu-item>
`
: item.source !== "system"
? html`
<ha-menu-item
class="warning"
@click=${this._handleDisable}
graphic="icon"
>
<ha-svg-icon
slot="start"
class="warning"
.path=${mdiStopCircleOutline}
></ha-svg-icon>
${this.hass.localize("ui.common.disable")}
</ha-menu-item>
`
: nothing}
${item.source !== "system" ${item.source !== "system"
? html`<ha-list-item ? html`
class="warning" <ha-menu-item class="warning" @click=${this._handleDelete}>
@request-selected=${this._handleDelete} <ha-svg-icon
graphic="icon" slot="start"
> class="warning"
${this.hass.localize( .path=${mdiDelete}
"ui.panel.config.integrations.config_entry.delete" ></ha-svg-icon>
)} ${this.hass.localize(
<ha-svg-icon "ui.panel.config.integrations.config_entry.delete"
slot="graphic" )}
class="warning" </ha-menu-item>
.path=${mdiDelete} `
></ha-svg-icon> : nothing}
</ha-list-item>`
: ""}
</ha-button-menu-new> </ha-button-menu-new>
</ha-list-item-new>`; </ha-list-item-new>`;
} }
@ -1055,64 +1049,43 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
); );
} }
private _handleRename(ev: CustomEvent<RequestSelectedDetail>): void { private _handleRename(ev: Event): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._editEntryName( this._editEntryName(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
} }
private _handleReload(ev: CustomEvent<RequestSelectedDetail>): void { private _handleReload(ev: Event): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._reloadIntegration( this._reloadIntegration(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
} }
private _handleReconfigure(ev: CustomEvent<RequestSelectedDetail>): void { private _handleReconfigure(ev: Event): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._reconfigureIntegration( this._reconfigureIntegration(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
} }
private _handleDelete(ev: CustomEvent<RequestSelectedDetail>): void { private _handleDelete(ev: Event): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._removeIntegration( this._removeIntegration(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
} }
private _handleDisable(ev: CustomEvent<RequestSelectedDetail>): void { private _handleDisable(ev: Event): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._disableIntegration( this._disableIntegration(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
} }
private _handleEnable(ev: CustomEvent<RequestSelectedDetail>): void { private _handleEnable(ev: Event): void {
if (ev.detail.source && !shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._enableIntegration( this._enableIntegration(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
} }
private _handleSystemOptions(ev: CustomEvent<RequestSelectedDetail>): void { private _handleSystemOptions(ev: Event): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
this._showSystemOptions( this._showSystemOptions(
((ev.target as HTMLElement).closest(".config_entry") as any).configEntry ((ev.target as HTMLElement).closest(".config_entry") as any).configEntry
); );
@ -1327,7 +1300,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
} }
private async _signUrl(ev) { private async _signUrl(ev) {
const anchor = ev.target.closest("a"); const anchor = ev.currentTarget;
ev.preventDefault(); ev.preventDefault();
const signedUrl = await getSignedPath( const signedUrl = await getSignedPath(
this.hass, this.hass,
@ -1438,8 +1411,8 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
--mdc-list-item-meta-size: auto; --mdc-list-item-meta-size: auto;
--mdc-list-item-meta-display: flex; --mdc-list-item-meta-display: flex;
} }
ha-button-menu-new ha-list-item { ha-button-menu-new ha-menu-item {
--mdc-list-item-meta-size: 24px; --mdc-icon-size: 24px;
} }
ha-list-item-new.config_entry::after { ha-list-item-new.config_entry::after {
position: absolute; position: absolute;

View File

@ -135,10 +135,15 @@ class HaLongLivedTokens extends LitElement {
const token = (ev.currentTarget as any).token; const token = (ev.currentTarget as any).token;
if ( if (
!(await showConfirmationDialog(this, { !(await showConfirmationDialog(this, {
title: this.hass.localize(
"ui.panel.profile.long_lived_access_tokens.confirm_delete_title"
),
text: this.hass.localize( text: this.hass.localize(
"ui.panel.profile.long_lived_access_tokens.confirm_delete", "ui.panel.profile.long_lived_access_tokens.confirm_delete_text",
{ name: token.client_name } { name: token.client_name }
), ),
confirmText: this.hass.localize("ui.common.delete"),
destructive: true,
})) }))
) { ) {
return; return;

View File

@ -295,9 +295,13 @@ class HaRefreshTokens extends LitElement {
private async _deleteAllTokens(): Promise<void> { private async _deleteAllTokens(): Promise<void> {
if ( if (
!(await showConfirmationDialog(this, { !(await showConfirmationDialog(this, {
title: this.hass.localize(
"ui.panel.profile.refresh_tokens.confirm_delete_all_title"
),
text: this.hass.localize( text: this.hass.localize(
"ui.panel.profile.refresh_tokens.confirm_delete_all" "ui.panel.profile.refresh_tokens.confirm_delete_all"
), ),
confirmText: this.hass.localize("ui.common.delete"),
destructive: true, destructive: true,
})) }))
) { ) {

View File

@ -1888,7 +1888,9 @@
"editor": { "editor": {
"confirm_unsaved": "You have unsaved changes. Are you sure you want to leave?" "confirm_unsaved": "You have unsaved changes. Are you sure you want to leave?"
}, },
"multiselect": { "failed": "Failed to update {number} items." }, "multiselect": {
"failed": "Failed to update {number} items."
},
"learn_more": "Learn more" "learn_more": "Learn more"
}, },
"updates": { "updates": {
@ -6405,6 +6407,7 @@
"confirm_delete_title": "Delete refresh token?", "confirm_delete_title": "Delete refresh token?",
"confirm_delete_text": "The refresh token for ''{name}'' will be permanently deleted. This will end the login session on the associated device.", "confirm_delete_text": "The refresh token for ''{name}'' will be permanently deleted. This will end the login session on the associated device.",
"delete_all_tokens": "Delete all tokens", "delete_all_tokens": "Delete all tokens",
"confirm_delete_all_title": "Delete all refresh tokens?",
"confirm_delete_all": "Are you sure you want to delete all refresh tokens? Your current session token will not be removed. Your long-lived access tokens will not be removed.", "confirm_delete_all": "Are you sure you want to delete all refresh tokens? Your current session token will not be removed. Your long-lived access tokens will not be removed.",
"delete_failed": "Failed to delete the refresh token.", "delete_failed": "Failed to delete the refresh token.",
"current_token_tooltip": "Unable to delete current refresh token" "current_token_tooltip": "Unable to delete current refresh token"
@ -6414,7 +6417,8 @@
"description": "Create long-lived access tokens to allow your scripts to interact with your Home Assistant instance. Each token will be valid for 10 years from creation. The following long-lived access tokens are currently active.", "description": "Create long-lived access tokens to allow your scripts to interact with your Home Assistant instance. Each token will be valid for 10 years from creation. The following long-lived access tokens are currently active.",
"learn_auth_requests": "Learn how to make authenticated requests.", "learn_auth_requests": "Learn how to make authenticated requests.",
"created": "Created {date}", "created": "Created {date}",
"confirm_delete": "Are you sure you want to delete the access token for {name}?", "confirm_delete_title": "Delete long-lived access token?",
"confirm_delete_text": "Are you sure you want to delete the long-lived access token for {name}?",
"delete_failed": "Failed to delete the access token.", "delete_failed": "Failed to delete the access token.",
"create": "Create Token", "create": "Create Token",
"create_failed": "Failed to create the access token.", "create_failed": "Failed to create the access token.",

View File

@ -7583,17 +7583,6 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"eslint-plugin-disable@npm:2.0.3":
version: 2.0.3
resolution: "eslint-plugin-disable@npm:2.0.3"
dependencies:
resolve: "npm:^1.1.6"
peerDependencies:
eslint: ">=0.16.0"
checksum: 10/2d68c0e5750325fb42c5cdc4300751753a10530df8e4a0656f102bcd1eb44cca01dfdf563b3f0a33c10c8ffdb7d92b8bb38b4c73717e04a967500af649512128
languageName: node
linkType: hard
"eslint-plugin-import@npm:2.29.1": "eslint-plugin-import@npm:2.29.1":
version: 2.29.1 version: 2.29.1
resolution: "eslint-plugin-import@npm:2.29.1" resolution: "eslint-plugin-import@npm:2.29.1"
@ -9057,7 +9046,6 @@ __metadata:
eslint-config-airbnb-typescript: "npm:18.0.0" eslint-config-airbnb-typescript: "npm:18.0.0"
eslint-config-prettier: "npm:9.1.0" eslint-config-prettier: "npm:9.1.0"
eslint-import-resolver-webpack: "npm:0.13.8" eslint-import-resolver-webpack: "npm:0.13.8"
eslint-plugin-disable: "npm:2.0.3"
eslint-plugin-import: "npm:2.29.1" eslint-plugin-import: "npm:2.29.1"
eslint-plugin-lit: "npm:1.13.0" eslint-plugin-lit: "npm:1.13.0"
eslint-plugin-lit-a11y: "npm:4.1.2" eslint-plugin-lit-a11y: "npm:4.1.2"
@ -12571,7 +12559,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"resolve@npm:^1.1.6, resolve@npm:^1.14.2, resolve@npm:^1.19.0, resolve@npm:^1.20.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4": "resolve@npm:^1.14.2, resolve@npm:^1.19.0, resolve@npm:^1.20.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4":
version: 1.22.8 version: 1.22.8
resolution: "resolve@npm:1.22.8" resolution: "resolve@npm:1.22.8"
dependencies: dependencies:
@ -12597,7 +12585,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"resolve@patch:resolve@npm%3A^1.1.6#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.19.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin<compat/resolve>": "resolve@patch:resolve@npm%3A^1.14.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.19.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin<compat/resolve>":
version: 1.22.8 version: 1.22.8
resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d" resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
dependencies: dependencies: