mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
let OpenDocumentsService handle nav
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let doc of documents" (click)="clickDoc(doc)">
|
||||
<tr *ngFor="let doc of documents" (click)="openDocumentsService.openDocument(doc)">
|
||||
<td>{{doc.created | customDate}}</td>
|
||||
<td>{{doc.title | documentTitle}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ms-1" (click)="clickTag(t); $event.stopPropagation();"></app-tag></td>
|
||||
</tr>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
import { first, Subscription } from 'rxjs'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { PaperlessDocument } from 'src/app/data/paperless-document'
|
||||
import { PaperlessSavedView } from 'src/app/data/paperless-saved-view'
|
||||
import { ConsumerStatusService } from 'src/app/services/consumer-status.service'
|
||||
@@ -23,7 +23,7 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy {
|
||||
private router: Router,
|
||||
private queryParamsService: QueryParamsService,
|
||||
private consumerStatusService: ConsumerStatusService,
|
||||
private openDocumentsService: OpenDocumentsService
|
||||
public openDocumentsService: OpenDocumentsService
|
||||
) {}
|
||||
|
||||
@Input()
|
||||
@@ -72,15 +72,6 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
clickDoc(doc: PaperlessDocument) {
|
||||
this.openDocumentsService
|
||||
.openDocument(doc)
|
||||
.pipe(first())
|
||||
.subscribe((open) => {
|
||||
if (open) this.router.navigate(['documents', doc.id])
|
||||
})
|
||||
}
|
||||
|
||||
clickTag(tag: PaperlessTag) {
|
||||
this.queryParamsService.navigateWithFilterRules([
|
||||
{ rule_type: FILTER_HAS_TAGS_ALL, value: tag.id.toString() },
|
||||
|
Reference in New Issue
Block a user