From 06b822fd783f3957422a1e85f5666c1db6b05079 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 8 Jul 2026 08:17:31 -0700 Subject: [PATCH] Doc notes --- .../document-notes.component.ts | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) 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 43530ce7c..4ebd91e72 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,4 +1,11 @@ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core' +import { + Component, + EventEmitter, + Input, + Output, + inject, + signal, +} from '@angular/core' import { FormControl, FormGroup, @@ -31,22 +38,51 @@ export class DocumentNotesComponent extends ComponentWithPermissions { private notesService = inject(DocumentNotesService) private toastService = inject(ToastService) private usersService = inject(UserService) + private documentIdSignal = signal(undefined) + private notesSignal = signal([]) + private addDisabledSignal = signal(false) + private networkActiveSignal = signal(false) noteForm: FormGroup = new FormGroup({ newNote: new FormControl(''), }) - networkActive = false + get networkActive(): boolean { + return this.networkActiveSignal() + } + + set networkActive(networkActive: boolean) { + this.networkActiveSignal.set(networkActive) + } + newNoteError: boolean = false @Input() - documentId: number + get documentId(): number { + return this.documentIdSignal() + } + + set documentId(documentId: number) { + this.documentIdSignal.set(documentId) + } @Input() - notes: DocumentNote[] = [] + get notes(): DocumentNote[] { + return this.notesSignal() + } + + set notes(notes: DocumentNote[]) { + this.notesSignal.set(notes) + } @Input() - addDisabled: boolean = false + get addDisabled(): boolean { + return this.addDisabledSignal() + } + + set addDisabled(addDisabled: boolean) { + this.addDisabledSignal.set(addDisabled) + } @Output() updated: EventEmitter = new EventEmitter()