From 33df8051685126a54676f7cd7d47354c6ad305c4 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Fri, 20 Dec 2024 18:21:24 +0100 Subject: [PATCH] Revert "Add overview settings link to backup settings sections" This reverts commit fad435ea10feb4a88e3323f8685e2be571997631. --- .../config/ha-backup-config-data.ts | 7 ---- .../overview/ha-backup-overview-settings.ts | 36 +++++++------------ .../backup/ha-config-backup-settings.ts | 34 ++---------------- 3 files changed, 15 insertions(+), 62 deletions(-) diff --git a/src/panels/config/backup/components/config/ha-backup-config-data.ts b/src/panels/config/backup/components/config/ha-backup-config-data.ts index 0b014e7d12..20bde138ab 100644 --- a/src/panels/config/backup/components/config/ha-backup-config-data.ts +++ b/src/panels/config/backup/components/config/ha-backup-config-data.ts @@ -53,12 +53,6 @@ export type BackupConfigData = { include_addons?: string[]; }; -declare global { - interface HASSDomEvents { - "backup-addons-fetched": void; - } -} - @customElement("ha-backup-config-data") class HaBackupConfigData extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @@ -95,7 +89,6 @@ class HaBackupConfigData extends LitElement { private async _fetchAddons() { const { addons } = await fetchHassioAddonsInfo(this.hass); this._addons = addons; - fireEvent(this, "backup-addons-fetched"); } private _hasLocalAddons(addons: BackupAddonItem[]): boolean { diff --git a/src/panels/config/backup/components/overview/ha-backup-overview-settings.ts b/src/panels/config/backup/components/overview/ha-backup-overview-settings.ts index dc3679f1ba..9e3ebd0206 100644 --- a/src/panels/config/backup/components/overview/ha-backup-overview-settings.ts +++ b/src/panels/config/backup/components/overview/ha-backup-overview-settings.ts @@ -5,7 +5,6 @@ import { customElement, property } from "lit/decorators"; import { navigate } from "../../../../../common/navigate"; import "../../../../../components/ha-button"; import "../../../../../components/ha-card"; -import "../../../../../components/ha-icon-next"; import "../../../../../components/ha-md-list"; import "../../../../../components/ha-md-list-item"; import "../../../../../components/ha-svg-icon"; @@ -104,10 +103,7 @@ class HaBackupBackupsSummary extends LitElement {
Automatic backups
- +
${this._scheduleDescription(this.config)} @@ -115,9 +111,8 @@ class HaBackupBackupsSummary extends LitElement {
Schedule and number of backups to keep
- - +
${this.config.create_backup.include_database @@ -127,34 +122,27 @@ class HaBackupBackupsSummary extends LitElement {
Home Assistant data that is included
- ${isHassio ? html` - +
${this._addonsDescription(this.config)}
Add-ons that are included
- +
+ + +
+ ${this._agentsDescription(this.config)} +
+
+ Locations where backup is uploaded to +
` : nothing} - - -
${this._agentsDescription(this.config)}
-
- Locations where backup is uploaded to -
- -
diff --git a/src/panels/config/backup/ha-config-backup-settings.ts b/src/panels/config/backup/ha-config-backup-settings.ts index 2e05c60565..f1e11d67e2 100644 --- a/src/panels/config/backup/ha-config-backup-settings.ts +++ b/src/panels/config/backup/ha-config-backup-settings.ts @@ -3,7 +3,6 @@ import { css, html, LitElement, nothing } from "lit"; import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import { debounce } from "../../../common/util/debounce"; -import { nextRender } from "../../../common/util/render-status"; import "../../../components/ha-button"; import "../../../components/ha-card"; import "../../../components/ha-icon-next"; @@ -39,30 +38,6 @@ class HaConfigBackupSettings extends LitElement { } } - protected firstUpdated(_changedProperties: PropertyValues): void { - super.firstUpdated(_changedProperties); - this._scrollTo(); - } - - private async _scrollTo() { - const hash = window.location.hash.substring(1); - if (hash === "locations") { - // Wait for the addons to be loaded before scrolling because the height can change - this.addEventListener("backup-addons-fetched", async () => { - await nextRender(); - this._scrolltoHash(hash); - }); - return; - } - this._scrolltoHash(hash); - } - - private _scrolltoHash(hash: string) { - const element = this.shadowRoot!.getElementById(hash); - element?.scrollIntoView(); - history.replaceState(null, "", window.location.pathname); - } - protected render() { if (!this._config) { return nothing; @@ -76,7 +51,7 @@ class HaConfigBackupSettings extends LitElement { .header=${"Automatic backups"} >
- +
Automatic backups

@@ -90,7 +65,7 @@ class HaConfigBackupSettings extends LitElement { >

- +
Backup data
- +
Locations

@@ -224,9 +199,6 @@ class HaConfigBackupSettings extends LitElement { } static styles = css` - ha-card { - scroll-margin-top: 16px; - } .content { padding: 28px 20px 0; max-width: 690px;