From 03fbf2f866278e54781abcb7c957a904f28b38bf Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 8 Jul 2026 19:20:00 -0700 Subject: [PATCH] Yikes a lot we missed --- .../page-header/page-header.component.html | 2 +- .../page-header/page-header.component.ts | 17 +-- .../profile-edit-dialog.component.spec.ts | 4 +- .../profile-edit-dialog.component.ts | 4 +- ...ink-bundle-manage-dialog.component.spec.ts | 8 +- .../system-status-dialog.component.html | 140 +++++++++--------- .../system-status-dialog.component.spec.ts | 26 ++-- .../components/common/tag/tag.component.html | 20 +-- .../components/common/tag/tag.component.ts | 80 +++------- .../dashboard/dashboard.component.spec.ts | 6 +- .../saved-view-widget.component.html | 2 +- .../saved-view-widget.component.spec.ts | 2 +- .../saved-view-widget.component.ts | 2 +- .../bulk-editor/bulk-editor.component.spec.ts | 10 +- .../document-card-large.component.html | 96 ++++++------ .../document-card-large.component.ts | 64 +++----- .../document-card-small.component.html | 92 ++++++------ .../document-card-small.component.ts | 56 ++----- .../file-drop/file-drop.component.ts | 2 +- 19 files changed, 275 insertions(+), 358 deletions(-) diff --git a/src-ui/src/app/components/common/page-header/page-header.component.html b/src-ui/src/app/components/common/page-header/page-header.component.html index 99e1d426b..05df7dcd5 100644 --- a/src-ui/src/app/components/common/page-header/page-header.component.html +++ b/src-ui/src/app/components/common/page-header/page-header.component.html @@ -1,7 +1,7 @@

- {{title}} + {{title()}} @if (id()) { @if (copied()) { diff --git a/src-ui/src/app/components/common/page-header/page-header.component.ts b/src-ui/src/app/components/common/page-header/page-header.component.ts index 66cef548f..ec209bf2e 100644 --- a/src-ui/src/app/components/common/page-header/page-header.component.ts +++ b/src-ui/src/app/components/common/page-header/page-header.component.ts @@ -1,5 +1,5 @@ import { Clipboard } from '@angular/cdk/clipboard' -import { Component, Input, inject, input, signal } from '@angular/core' +import { Component, effect, inject, input, signal } from '@angular/core' import { Title } from '@angular/platform-browser' import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap' import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons' @@ -21,19 +21,14 @@ export class PageHeaderComponent { readonly info = input(undefined) readonly infoLink = input(undefined) readonly loading = input(false) + readonly title = input('') readonly copied = signal(false) private copyTimeout: any - private readonly titleSignal = signal('') - - @Input() - set title(title: string) { - this.titleSignal.set(title) - this.titleService.setTitle(`${title} - ${environment.appTitle}`) - } - - get title() { - return this.titleSignal() + constructor() { + effect(() => { + this.titleService.setTitle(`${this.title()} - ${environment.appTitle}`) + }) } public copyID() { diff --git a/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.spec.ts b/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.spec.ts index 101406990..e97cfd37a 100644 --- a/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.spec.ts +++ b/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.spec.ts @@ -229,9 +229,9 @@ describe('ProfileEditDialogComponent', () => { const copySpy = jest.spyOn(clipboard, 'copy') component.copyAuthToken() expect(copySpy).toHaveBeenCalledWith(profile.auth_token) - expect(component.copied).toBeTruthy() + expect(component.copied()).toBeTruthy() tick(3000) - expect(component.copied).toBeFalsy() + expect(component.copied()).toBeFalsy() })) it('should support generate token, display error if needed', () => { diff --git a/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.ts b/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.ts index f8bd68cbc..812ae34f6 100644 --- a/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.ts +++ b/src-ui/src/app/components/common/profile-edit-dialog/profile-edit-dialog.component.ts @@ -140,7 +140,7 @@ export class ProfileEditDialogComponent onEmailChange(): void { this.showEmailConfirm.set(this.currentEmail !== this.newEmail) - if (this.showEmailConfirm) { + if (this.showEmailConfirm()) { this.form.get('email_confirm').enable() if (this.newEmail !== this.emailConfirm) { this.setFieldError('email_confirm', $localize`Emails must match`) @@ -167,7 +167,7 @@ export class ProfileEditDialogComponent onPasswordChange(): void { this.showPasswordConfirm.set(this.currentPassword !== this.newPassword) - if (this.showPasswordConfirm) { + if (this.showPasswordConfirm()) { this.form.get('password_confirm').enable() if (this.newPassword !== this.passwordConfirm) { this.setFieldError('password_confirm', $localize`Passwords must match`) diff --git a/src-ui/src/app/components/common/share-link-bundle-manage-dialog/share-link-bundle-manage-dialog.component.spec.ts b/src-ui/src/app/components/common/share-link-bundle-manage-dialog/share-link-bundle-manage-dialog.component.spec.ts index 113cd65a3..991d79a8d 100644 --- a/src-ui/src/app/components/common/share-link-bundle-manage-dialog/share-link-bundle-manage-dialog.component.spec.ts +++ b/src-ui/src/app/components/common/share-link-bundle-manage-dialog/share-link-bundle-manage-dialog.component.spec.ts @@ -97,7 +97,7 @@ describe('ShareLinkBundleManageDialogComponent', () => { expect(service.listAllBundles).toHaveBeenCalledTimes(1) expect(component.bundles).toEqual(bundles) - expect(component.loading).toBe(false) + expect(component.loading()).toBe(false) expect(component.error).toBeNull() tick(5000) @@ -115,7 +115,7 @@ describe('ShareLinkBundleManageDialogComponent', () => { expect(component.error).toContain('Failed to load share link bundles.') expect(toastService.showError).toHaveBeenCalled() - expect(component.loading).toBe(false) + expect(component.loading()).toBe(false) tick(5000) expect(service.listAllBundles).toHaveBeenCalledTimes(2) @@ -165,7 +165,7 @@ describe('ShareLinkBundleManageDialogComponent', () => { expect.stringContaining('deleted.') ) expect(service.listAllBundles).toHaveBeenCalledTimes(2) - expect(component.loading).toBe(false) + expect(component.loading()).toBe(false) })) it('handles delete errors gracefully', fakeAsync(() => { @@ -179,7 +179,7 @@ describe('ShareLinkBundleManageDialogComponent', () => { tick() expect(toastService.showError).toHaveBeenCalled() - expect(component.loading).toBe(false) + expect(component.loading()).toBe(false) })) it('retries bundle build and replaces existing entry', fakeAsync(() => { diff --git a/src-ui/src/app/components/common/system-status-dialog/system-status-dialog.component.html b/src-ui/src/app/components/common/system-status-dialog/system-status-dialog.component.html index 5422c875e..badd44b5d 100644 --- a/src-ui/src/app/components/common/system-status-dialog/system-status-dialog.component.html +++ b/src-ui/src/app/components/common/system-status-dialog/system-status-dialog.component.html @@ -3,7 +3,7 @@