From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 27 Jan 2023 18:29:40 +0000 (-0800) Subject: Better display of multiple comment hits X-Git-Tag: v1.12.2~1^2~6^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2542%2Fhead;p=thirdparty%2Fpaperless-ngx.git Better display of multiple comment hits --- diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html index c114a2d6e1..b18524e386 100644 --- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html +++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html @@ -26,11 +26,11 @@
- + - + {{contentTrimmed}}
diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts index b431878798..5d24042b9c 100644 --- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts +++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts @@ -70,6 +70,22 @@ export class DocumentCardLargeComponent { } } + get searchCommentHighlights() { + let highlights = [] + if ( + this.document['__search_hit__'] && + this.document['__search_hit__'].comment_highlights + ) { + // only show comments with a match + highlights = ( + this.document['__search_hit__'].comment_highlights as string + ) + .split(',') + .filter((higlight) => higlight.includes('