mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 02:27:06 +01:00
Warn on closing edited doc due to max open docs
This commit is contained in:
parent
c7412deb77
commit
f5e740f2ec
9 changed files with 79 additions and 20 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, Input, OnDestroy, OnInit } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { first, 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'
|
||||
|
|
@ -8,6 +8,7 @@ import { DocumentService } from 'src/app/services/rest/document.service'
|
|||
import { PaperlessTag } from 'src/app/data/paperless-tag'
|
||||
import { FILTER_HAS_TAGS_ALL } from 'src/app/data/filter-rule-type'
|
||||
import { QueryParamsService } from 'src/app/services/query-params.service'
|
||||
import { OpenDocumentsService } from 'src/app/services/open-documents.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-saved-view-widget',
|
||||
|
|
@ -21,7 +22,8 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy {
|
|||
private documentService: DocumentService,
|
||||
private router: Router,
|
||||
private queryParamsService: QueryParamsService,
|
||||
private consumerStatusService: ConsumerStatusService
|
||||
private consumerStatusService: ConsumerStatusService,
|
||||
private openDocumentsService: OpenDocumentsService
|
||||
) {}
|
||||
|
||||
@Input()
|
||||
|
|
@ -70,6 +72,15 @@ 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() },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue