diff --git a/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.html b/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.html index ab0951d54..26f0464bf 100644 --- a/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.html +++ b/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.html @@ -9,9 +9,9 @@
Note that only PDFs will be included.
} diff --git a/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.spec.ts b/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.spec.ts index db772c592..e9b99763a 100644 --- a/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.spec.ts +++ b/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.spec.ts @@ -50,12 +50,12 @@ describe('MergeConfirmDialogComponent', () => { component.ngOnInit() - expect(component.documents).toEqual(documents) - expect(documentService.getFew).toHaveBeenCalledWith(component.documentIDs) + expect(component.documents()).toEqual(documents) + expect(documentService.getFew).toHaveBeenCalledWith(component.documentIDs()) }) it('should move documentIDs on drop', () => { - component.documentIDs = [1, 2, 3] + component.documentIDs.set([1, 2, 3]) const event = { previousIndex: 1, currentIndex: 2, @@ -63,7 +63,7 @@ describe('MergeConfirmDialogComponent', () => { component.onDrop(event as any) - expect(component.documentIDs).toEqual([1, 3, 2]) + expect(component.documentIDs()).toEqual([1, 3, 2]) }) it('should get document by ID', () => { diff --git a/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.ts b/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.ts index 8006600cd..e852e5a93 100644 --- a/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.ts +++ b/src-ui/src/app/components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component.ts @@ -36,47 +36,11 @@ export class MergeConfirmDialogComponent private documentService = inject(DocumentService) private permissionService = inject(PermissionsService) - private documentIDsSignal = signal
No share link bundles currently exist.
} - @if (bundles.length > 0) { + @if (bundles().length > 0) {|
{{ bundle.created | date: 'short' }}
@@ -113,10 +113,10 @@
title="Copy share link"
i18n-title
>
- @if (copiedSlug === bundle.slug) {
+ @if (copiedSlug() === bundle.slug) {
- @if (networkActive) {
+ @if (networkActive()) {
}
-
+
- @for (note of notes; track note) { + @for (note of notes(); track note) { {{note.note}} diff --git a/src-ui/src/app/components/document-notes/document-notes.component.spec.ts b/src-ui/src/app/components/document-notes/document-notes.component.spec.ts index 1c86c03a5..85b8c9570 100644 --- a/src-ui/src/app/components/document-notes/document-notes.component.spec.ts +++ b/src-ui/src/app/components/document-notes/document-notes.component.spec.ts @@ -110,7 +110,7 @@ describe('DocumentNotesComponent', () => { }) it('should display notes with user name / username', () => { - component.notes = notes + component.notes.set(notes) fixture.detectChanges() expect(fixture.debugElement.nativeElement.textContent).toContain( notes[0].note @@ -154,7 +154,7 @@ describe('DocumentNotesComponent', () => { }) it('should support note entry, show error if fails', () => { - component.documentId = 12 + component.documentId.set(12) const note = 'This is the new note.' const noteTextArea = fixture.debugElement.query(By.css('textarea')) noteTextArea.nativeElement.value = note @@ -177,7 +177,7 @@ describe('DocumentNotesComponent', () => { }) it('should support note save on ctrl+Enter', () => { - component.documentId = 12 + component.documentId.set(12) const note = 'This is the new note.' const noteTextArea = fixture.debugElement.query(By.css('textarea')) noteTextArea.nativeElement.value = note @@ -189,8 +189,8 @@ describe('DocumentNotesComponent', () => { }) it('should support delete note, show error if fails', () => { - component.documentId = 12 - component.notes = notes + component.documentId.set(12) + component.notes.set(notes) fixture.detectChanges() const deleteButton = fixture.debugElement.queryAll(By.css('button'))[1] // 0 is add button const deleteSpy = jest.spyOn(notesService, 'deleteNote') diff --git a/src-ui/src/app/components/document-notes/document-notes.component.ts b/src-ui/src/app/components/document-notes/document-notes.component.ts index 4ebd91e72..19dbdf486 100644 --- a/src-ui/src/app/components/document-notes/document-notes.component.ts +++ b/src-ui/src/app/components/document-notes/document-notes.component.ts @@ -1,9 +1,10 @@ import { Component, EventEmitter, - Input, Output, inject, + input, + model, signal, } from '@angular/core' import { @@ -38,52 +39,17 @@ export class DocumentNotesComponent extends ComponentWithPermissions { private notesService = inject(DocumentNotesService) private toastService = inject(ToastService) private usersService = inject(UserService) - private documentIdSignal = signal |