From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:57:38 +0000 (-0700) Subject: Fix: dont display trashed docs in doc links X-Git-Tag: v2.13.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b1dffe0dcbe553d2a7e64a1efe2fae4911bbe29;p=thirdparty%2Fpaperless-ngx.git Fix: dont display trashed docs in doc links --- diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index e3b5027805..dfea48ad7a 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -2231,7 +2231,7 @@ src/app/components/manage/custom-fields/custom-fields.component.ts - 80 + 83 src/app/components/manage/mail/mail.component.ts @@ -2570,7 +2570,7 @@ src/app/components/manage/custom-fields/custom-fields.component.ts - 82 + 85 src/app/components/manage/mail/mail.component.ts @@ -3265,7 +3265,7 @@ View src/app/components/common/custom-field-display/custom-field-display.component.html - 21 + 22 src/app/components/common/input/permissions/permissions-form/permissions-form.component.html @@ -3302,7 +3302,7 @@ src/app/components/manage/custom-fields/custom-fields.component.ts - 63 + 65 @@ -3313,7 +3313,7 @@ src/app/components/manage/custom-fields/custom-fields.component.ts - 70 + 73 @@ -7544,28 +7544,28 @@ Confirm delete field src/app/components/manage/custom-fields/custom-fields.component.ts - 78 + 81 This operation will permanently delete this field. src/app/components/manage/custom-fields/custom-fields.component.ts - 79 + 82 Deleted field src/app/components/manage/custom-fields/custom-fields.component.ts - 88 + 91 Error deleting field. src/app/components/manage/custom-fields/custom-fields.component.ts - 93 + 97 diff --git a/src-ui/src/app/components/common/custom-field-display/custom-field-display.component.html b/src-ui/src/app/components/common/custom-field-display/custom-field-display.component.html index b8cd1dd9d7..bfac6ef23a 100644 --- a/src-ui/src/app/components/common/custom-field-display/custom-field-display.component.html +++ b/src-ui/src/app/components/common/custom-field-display/custom-field-display.component.html @@ -18,9 +18,11 @@ @case (CustomFieldDataType.DocumentLink) {
@for (docId of value; track docId) { - -  {{ getDocumentTitle(docId) }} - + @if (getDocumentTitle(docId)) { + +  {{ getDocumentTitle(docId) }} + + } }
} diff --git a/src-ui/src/app/components/common/input/document-link/document-link.component.ts b/src-ui/src/app/components/common/input/document-link/document-link.component.ts index 882aacad55..54784b83de 100644 --- a/src-ui/src/app/components/common/input/document-link/document-link.component.ts +++ b/src-ui/src/app/components/common/input/document-link/document-link.component.ts @@ -71,9 +71,9 @@ export class DocumentLinkComponent .pipe(takeUntil(this.unsubscribeNotifier)) .subscribe((documentResults) => { this.loading = false - this.selectedDocuments = documentIDs.map((id) => - documentResults.results.find((d) => d.id === id) - ) + this.selectedDocuments = documentIDs + .map((id) => documentResults.results.find((d) => d.id === id)) + .filter((d) => d) super.writeValue(documentIDs) }) }