mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -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()
|
@Input()
|
||||||
set filterRules (value: FilterRule[]) {
|
set filterRules (value: FilterRule[]) {
|
||||||
this._filterRules = value
|
this._filterRules = value
|
||||||
|
|
||||||
this.documentTypeSelectionModel.clear(false)
|
this.documentTypeSelectionModel.clear(false)
|
||||||
this.tagSelectionModel.clear(false)
|
this.tagSelectionModel.clear(false)
|
||||||
this.correspondentSelectionModel.clear(false)
|
this.correspondentSelectionModel.clear(false)
|
||||||
@ -290,8 +290,12 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
|
|||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
).subscribe(text => {
|
).subscribe(text => {
|
||||||
this._textFilter = text
|
this._textFilter = text
|
||||||
|
this.documentService.searchQuery = text
|
||||||
this.updateRules()
|
this.updateRules()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (this._textFilter) this.documentService.searchQuery = this._textFilter
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -39,6 +39,8 @@ export interface SelectionData {
|
|||||||
})
|
})
|
||||||
export class DocumentService extends AbstractPaperlessService<PaperlessDocument> {
|
export class DocumentService extends AbstractPaperlessService<PaperlessDocument> {
|
||||||
|
|
||||||
|
private _searchQuery: string
|
||||||
|
|
||||||
constructor(http: HttpClient, private correspondentService: CorrespondentService, private documentTypeService: DocumentTypeService, private tagService: TagService) {
|
constructor(http: HttpClient, private correspondentService: CorrespondentService, private documentTypeService: DocumentTypeService, private tagService: TagService) {
|
||||||
super(http, 'documents')
|
super(http, 'documents')
|
||||||
}
|
}
|
||||||
@ -92,6 +94,7 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>
|
|||||||
|
|
||||||
getPreviewUrl(id: number, original: boolean = false): string {
|
getPreviewUrl(id: number, original: boolean = false): string {
|
||||||
let url = this.getResourceUrl(id, 'preview')
|
let url = this.getResourceUrl(id, 'preview')
|
||||||
|
if (this._searchQuery) url += `#search="${this._searchQuery}"`
|
||||||
if (original) {
|
if (original) {
|
||||||
url += "?original=true"
|
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' })
|
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