From 10a5d50ce961a93ae9c3da187e6afdab1d607fee Mon Sep 17 00:00:00 2001 From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Tue, 24 Jan 2023 18:49:14 -0800 Subject: [PATCH 1/6] Reset version string to indicate development --- src-ui/src/environments/environment.prod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/environments/environment.prod.ts b/src-ui/src/environments/environment.prod.ts index 88672659a..23c9a0755 100644 --- a/src-ui/src/environments/environment.prod.ts +++ b/src-ui/src/environments/environment.prod.ts @@ -5,7 +5,7 @@ export const environment = { apiBaseUrl: document.baseURI + 'api/', apiVersion: '2', appTitle: 'Paperless-ngx', - version: '1.12.0', + version: '1.12.0-dev', webSocketHost: window.location.host, webSocketProtocol: window.location.protocol == 'https:' ? 'wss:' : 'ws:', webSocketBaseUrl: base_url.pathname + 'ws/', From 16fc7ebecc6cc985d54397c99178bada51698e53 Mon Sep 17 00:00:00 2001 From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Tue, 24 Jan 2023 19:38:44 -0800 Subject: [PATCH 2/6] Adds the build platform flag to specific this is a single arch image --- Dockerfile | 2 +- docker-builders/Dockerfile.pikepdf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 687d993c7..9522728d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ARG PIKEPDF_VERSION ARG PSYCOPG2_VERSION FROM ghcr.io/paperless-ngx/paperless-ngx/builder/jbig2enc:${JBIG2ENC_VERSION} as jbig2enc-builder -FROM ghcr.io/paperless-ngx/paperless-ngx/builder/qpdf:${QPDF_VERSION} as qpdf-builder +FROM --platform=$BUILDPLATFORM ghcr.io/paperless-ngx/paperless-ngx/builder/qpdf:${QPDF_VERSION} as qpdf-builder FROM ghcr.io/paperless-ngx/paperless-ngx/builder/pikepdf:${PIKEPDF_VERSION} as pikepdf-builder FROM ghcr.io/paperless-ngx/paperless-ngx/builder/psycopg2:${PSYCOPG2_VERSION} as psycopg2-builder diff --git a/docker-builders/Dockerfile.pikepdf b/docker-builders/Dockerfile.pikepdf index 0331576ba..c4d1ee1dc 100644 --- a/docker-builders/Dockerfile.pikepdf +++ b/docker-builders/Dockerfile.pikepdf @@ -8,7 +8,7 @@ ARG REPO="paperless-ngx/paperless-ngx" ARG QPDF_VERSION -FROM ghcr.io/${REPO}/builder/qpdf:${QPDF_VERSION} as qpdf-builder +FROM --platform=$BUILDPLATFORM ghcr.io/${REPO}/builder/qpdf:${QPDF_VERSION} as qpdf-builder # This does nothing, except provide a name for a copy below From 5e9a7b94ba2969c656df0632c5a2f1026ff5b053 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 25 Jan 2023 08:37:26 -0800 Subject: [PATCH 3/6] Fix broken date range search --- src/documents/views.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/documents/views.py b/src/documents/views.py index 87862fe07..e2807edff 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -468,14 +468,16 @@ class DocumentViewSet( class SearchResultSerializer(DocumentSerializer): def to_representation(self, instance): doc = Document.objects.get(id=instance["id"]) - commentTerm = instance.results.q.subqueries[0] - comments = ",".join( - [ - str(c.comment) - for c in Comment.objects.filter(document=instance["id"]) - if commentTerm.text in c.comment - ], - ) + comments = "" + if hasattr(instance.results.q, "subqueries"): + commentTerm = instance.results.q.subqueries[0] + comments = ",".join( + [ + str(c.comment) + for c in Comment.objects.filter(document=instance["id"]) + if commentTerm.text in c.comment + ], + ) r = super().to_representation(doc) r["__search_hit__"] = { "score": instance.score, From 75d2a3a45f880def28ec227e919cf253bc735d4a Mon Sep 17 00:00:00 2001 From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Tue, 24 Jan 2023 19:29:54 -0800 Subject: [PATCH 4/6] Moves back to the main release-drafter now that it does what we wanted --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d83b2a3a0..ac0b89611 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -500,7 +500,7 @@ jobs: - name: Create Release and Changelog id: create-release - uses: paperless-ngx/release-drafter@master + uses: release-drafter/release-drafter@v5 with: name: Paperless-ngx ${{ steps.get_version.outputs.version }} tag: ${{ steps.get_version.outputs.version }} From b38aacd1ce18c4ff51adbd026a7dbfd799cf3d85 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 25 Jan 2023 12:04:13 -0800 Subject: [PATCH 5/6] Trigger reindex on comment add / delete --- src/documents/views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/documents/views.py b/src/documents/views.py index e2807edff..854f2da2b 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -445,6 +445,10 @@ class DocumentViewSet( ) c.save() + from documents import index + + index.add_or_update_document(self.get_object()) + return Response(self.getComments(doc)) except Exception as e: logger.warning(f"An error occurred saving comment: {str(e)}") @@ -456,6 +460,11 @@ class DocumentViewSet( elif request.method == "DELETE": comment = Comment.objects.get(id=int(request.GET.get("id"))) comment.delete() + + from documents import index + + index.add_or_update_document(self.get_object()) + return Response(self.getComments(doc)) return Response( From 459de80124de331d787f5dc903da1c8e80963016 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 25 Jan 2023 12:04:33 -0800 Subject: [PATCH 6/6] Fix display of comment search hit in large cards --- .../document-card-large/document-card-large.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0eb965a22..c114a2d6e 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,7 +26,7 @@
- +