mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Merge pull request #860 from shamoon/feature/issue-858
Suppport search term PDF open parameter
This commit is contained in:
commit
6d8782f771
@ -128,7 +128,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
set filterRules (value: FilterRule[]) {
|
||||
this._filterRules = value
|
||||
|
||||
|
||||
this.documentTypeSelectionModel.clear(false)
|
||||
this.tagSelectionModel.clear(false)
|
||||
this.correspondentSelectionModel.clear(false)
|
||||
@ -290,8 +290,12 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
|
||||
distinctUntilChanged()
|
||||
).subscribe(text => {
|
||||
this._textFilter = text
|
||||
this.documentService.searchQuery = text
|
||||
this.updateRules()
|
||||
})
|
||||
|
||||
if (this._textFilter) this.documentService.searchQuery = this._textFilter
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@ -39,6 +39,8 @@ export interface SelectionData {
|
||||
})
|
||||
export class DocumentService extends AbstractPaperlessService<PaperlessDocument> {
|
||||
|
||||
private _searchQuery: string
|
||||
|
||||
constructor(http: HttpClient, private correspondentService: CorrespondentService, private documentTypeService: DocumentTypeService, private tagService: TagService) {
|
||||
super(http, 'documents')
|
||||
}
|
||||
@ -92,6 +94,7 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>
|
||||
|
||||
getPreviewUrl(id: number, original: boolean = false): string {
|
||||
let url = this.getResourceUrl(id, 'preview')
|
||||
if (this._searchQuery) url += `#search="${this._searchQuery}"`
|
||||
if (original) {
|
||||
url += "?original=true"
|
||||
}
|
||||
@ -138,4 +141,8 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>
|
||||
return this.http.post(this.getResourceUrl(null, 'bulk_download'), {"documents": ids, "content": content}, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
public set searchQuery(query: string) {
|
||||
this._searchQuery = query
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user