A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
fixed some issues with the data access service, support for requesting all IDs of filtered documents (required for selection)
jonaswinkler2c702eb568df
diff --git a/src-ui/src/app/services/document-list-view.service.ts b/src-ui/src/app/services/document-list-view.service.tsindex 811ac3c4b..149096591 100644--- a/src-ui/src/app/services/document-list-view.service.ts+++ b/src-ui/src/app/services/document-list-view.service.ts@@ -90,7 +90,7 @@ export class DocumentListViewService {reload(onFinish?) {this.isReloading = true- this.documentService.list(+ this.documentService.listFiltered(this.currentPage,this.currentPageSize,this.view.sortField,diff --git a/src-ui/src/app/services/rest/abstract-paperless-service.ts b/src-ui/src/app/services/rest/abstract-paperless-service.tsindex 3feed320e..d05b4aced 100644--- a/src-ui/src/app/services/rest/abstract-paperless-service.ts+++ b/src-ui/src/app/services/rest/abstract-paperless-service.ts@@ -54,9 +54,9 @@ export abstract class AbstractPaperlessService<T extends ObjectWithId> {private _listAll: Observable<Results<T>>- listAll(ordering?: string, extraParams?): Observable<Results<T>> {+ listAll(sortField?: string, sortDirection?: string, extraParams?): Observable<Results<T>> {if (!this._listAll) {- this._listAll = this.list(1, 100000, ordering, extraParams).pipe(+ this._listAll = this.list(1, 100000, sortField, sortDirection, extraParams).pipe(publishReplay(1),refCount())@@ -94,4 +94,4 @@ export abstract class AbstractPaperlessService<T extends ObjectWithId> {this._listAll = nullreturn this.http.put<T>(this.getResourceUrl(o.id), o)}-}\ No newline at end of file+}diff --git a/src-ui/src/app/services/rest/document.service.ts b/src-ui/src/app/services/rest/document.service.tsindex 4979ba8be..99ec1f3ee 100644--- a/src-ui/src/app/services/rest/document.service.ts+++ b/src-ui/src/app/services/rest/document.service.ts@@ -64,8 +64,8 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>return doc}- list(page?: number, pageSize?: number, sortField?: string, sortDirection?: string, filterRules?: FilterRule[]): Observable<Results<PaperlessDocument>> {- return super.list(page, pageSize, sortField, sortDirection, this.filterRulesToQueryParams(filterRules)).pipe(+ listFiltered(page?: number, pageSize?: number, sortField?: string, sortDirection?: string, filterRules?: FilterRule[], extraParams = {}): Observable<Results<PaperlessDocument>> {+ return this.list(page, pageSize, sortField, sortDirection, Object.assign(extraParams, this.filterRulesToQueryParams(filterRules))).pipe(map(results => {results.results.forEach(doc => this.addObservablesToDocument(doc))return results@@ -73,6 +73,12 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>)}+ listAllFilteredIds(filterRules?: FilterRule[]): Observable<number[]> {+ return this.listFiltered(1, 100000, null, null, filterRules, {"fields": "id"}).pipe(+ map(response => response.results.map(doc => doc.id))+ )+ }+getPreviewUrl(id: number, original: boolean = false): string {let url = this.getResourceUrl(id, 'preview')if (original) {@@ -101,11 +107,11 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>return this.http.get<PaperlessDocumentMetadata>(this.getResourceUrl(id, 'metadata'))}- bulk_edit(ids: number[], method: string, args: any[]) {+ bulkEdit(ids: number[], method: string, args: any) {return this.http.post(this.getResourceUrl(null, 'bulk_edit'), {- 'ids': ids,+ 'documents': ids,'method': method,- 'args': args+ 'parameters': args})}