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/role-has-required-aria-attrs": "warn"
},
"plugins": ["disable", "unused-imports"],
"processor": "disable/disable"
"plugins": ["unused-imports"]
}

View File

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

View File

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

View File

@ -82,10 +82,13 @@ class HaConfigSectionUpdates extends LitElement {
>
${this.hass.localize("ui.panel.config.updates.show_skipped")}
</ha-check-list-item>
${this._supervisorInfo && this._supervisorInfo.channel !== "dev"
${this._supervisorInfo
? html`
<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.hass.localize("ui.panel.config.updates.join_beta")
: this.hass.localize(

View File

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

View File

@ -135,10 +135,15 @@ class HaLongLivedTokens extends LitElement {
const token = (ev.currentTarget as any).token;
if (
!(await showConfirmationDialog(this, {
title: this.hass.localize(
"ui.panel.profile.long_lived_access_tokens.confirm_delete_title"
),
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 }
),
confirmText: this.hass.localize("ui.common.delete"),
destructive: true,
}))
) {
return;

View File

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

View File

@ -1888,7 +1888,9 @@
"editor": {
"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"
},
"updates": {
@ -6405,6 +6407,7 @@
"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.",
"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.",
"delete_failed": "Failed to delete the 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.",
"learn_auth_requests": "Learn how to make authenticated requests.",
"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.",
"create": "Create Token",
"create_failed": "Failed to create the access token.",

View File

@ -7583,17 +7583,6 @@ __metadata:
languageName: node
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":
version: 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-prettier: "npm:9.1.0"
eslint-import-resolver-webpack: "npm:0.13.8"
eslint-plugin-disable: "npm:2.0.3"
eslint-plugin-import: "npm:2.29.1"
eslint-plugin-lit: "npm:1.13.0"
eslint-plugin-lit-a11y: "npm:4.1.2"
@ -12571,7 +12559,7 @@ __metadata:
languageName: node
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
resolution: "resolve@npm:1.22.8"
dependencies:
@ -12597,7 +12585,7 @@ __metadata:
languageName: node
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
resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
dependencies: