A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Manually dirty check title on doc change
Michael Shamoona51893c84979
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.tsindex 3d4289ad8..f3515c974 100644--- a/src-ui/src/app/components/document-detail/document-detail.component.ts+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts@@ -172,6 +172,7 @@ export class DocumentDetailComponentthis.route.paramMap.pipe(+ takeUntil(this.unsubscribeNotifier),switchMap((paramMap) => {const documentId = +paramMap.get('id')this.docChangeNotifier.next(documentId)@@ -206,9 +207,20 @@ export class DocumentDetailComponenttakeUntil(this.docChangeNotifier),takeUntil(this.unsubscribeNotifier))- .subscribe((titleValue) => {- this.title = titleValue- this.documentForm.patchValue({ title: titleValue })+ .subscribe({+ next: (titleValue) => {+ this.title = titleValue+ this.documentForm.patchValue({ title: titleValue })+ },+ complete: () => {+ // doc changed so we manually check dirty in case title was changed+ if (+ this.store.getValue().title !==+ this.documentForm.get('title').value+ ) {+ this.openDocumentService.setDirty(doc.id, true)+ }+ },})this.ogDate = new Date(normalizeDateStr(doc.created.toString()))@@ -238,7 +250,6 @@ export class DocumentDetailComponentreturn this.isDirty$.pipe(map((dirty) => ({ doc, dirty })))}))- .pipe(takeUntil(this.unsubscribeNotifier)).subscribe({next: ({ doc, dirty }) => {this.openDocumentService.setDirty(doc.id, dirty)