Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overview summary for backups #23343

Merged
merged 6 commits into from
Dec 19, 2024
Merged

Add overview summary for backups #23343

merged 6 commits into from
Dec 19, 2024

Conversation

piitaya
Copy link
Member

@piitaya piitaya commented Dec 19, 2024

Proposed change

Add overview summary card at the top
Move fetching and subscribe logic to backup root component.
Update icons

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@piitaya piitaya changed the title Backup overview summary Add overview summary for backups Dec 19, 2024
});
fireEvent(this, "ha-refresh-backup-config");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should only do this on disconnected? As it will cause a lot of fetches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agree 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can not be done in disconnected because it's already disconnected so the element will be fired.
Also, I don't think people will change these settings too often.
Should I try to improve it in another way or is it ok like that ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok for now 👍🏻 would be nice if the update call would return the new config like other APIs do

@@ -196,10 +159,10 @@ class HaConfigBackupSettings extends LitElement {

private _encryptionKeyChanged(ev) {
const password = ev.detail.value as string;
this._backupConfig = {
...this._backupConfig,
this.config = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should change a public property, it could be overwritten by the parent before it is saved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a state before, I forgot to change this logic

this._backupConfig = config;
protected firstUpdated(_changedProperties: PropertyValues): void {
super.firstUpdated(_changedProperties);
fireEvent(this, "ha-refresh-backup-config");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

protected willUpdate(changedProperties: PropertyValues): void {
super.willUpdate(changedProperties);
if (changedProperties.has("config")) {
this._config = this.config;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it only do this if _config is undefined?

@bramkragten bramkragten merged commit 92b02e3 into dev Dec 19, 2024
15 checks passed
@bramkragten bramkragten deleted the backup_overview_summary branch December 19, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants