Skip to content

Commit

Permalink
20240530.0 (#20925)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored May 30, 2024
2 parents 1a2daf8 + 6f1fa13 commit 10a5c4d
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 142 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions src/panels/config/core/ha-config-section-updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
211 changes: 92 additions & 119 deletions src/panels/config/integrations/ha-config-integration-page.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -27,43 +27,43 @@ 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";
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,
} from "../../../data/application_credential";
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";
Expand All @@ -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";
Expand Down Expand Up @@ -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"
>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.reload"
)}
<ha-svg-icon slot="graphic" .path=${mdiReload}></ha-svg-icon>
</ha-list-item>`
: ""}
? 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-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
href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
target="_blank"
@click=${this._signUrl}
>
<ha-list-item graphic="icon">
? html`
<ha-menu-item
href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
target="_blank"
@click=${this._signUrl}
>
<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"
>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.reconfigure"
)}
<ha-svg-icon slot="graphic" .path=${mdiWrench}></ha-svg-icon>
</ha-list-item>`
: ""}
? 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-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")}
<ha-svg-icon
slot="graphic"
.path=${mdiPlayCircleOutline}
></ha-svg-icon>
</ha-list-item>`
? html`
<ha-menu-item @click=${this._handleEnable}>
<ha-svg-icon
slot="start"
.path=${mdiPlayCircleOutline}
></ha-svg-icon>
${this.hass.localize("ui.common.enable")}
</ha-menu-item>
`
: item.source !== "system"
? html`<ha-list-item
class="warning"
@request-selected=${this._handleDisable}
graphic="icon"
>
${this.hass.localize("ui.common.disable")}
? 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"
? html`
<ha-menu-item class="warning" @click=${this._handleDelete}>
<ha-svg-icon
slot="graphic"
slot="start"
class="warning"
.path=${mdiStopCircleOutline}
.path=${mdiDelete}
></ha-svg-icon>
</ha-list-item>`
: ""}
${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"
)}
<ha-svg-icon
slot="graphic"
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>`;
}
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 10a5c4d

Please sign in to comment.