Merge remote-tracking branch 'upstream/dev' into feature/dark-mode

This commit is contained in:
Michael Shamoon
2020-12-30 19:50:29 -08:00
30 changed files with 1818 additions and 72 deletions

View File

@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { cloneFilterRules, FilterRule } from '../data/filter-rule';
import { PaperlessDocument } from '../data/paperless-document';
@@ -155,6 +156,14 @@ export class DocumentListViewService {
sessionStorage.setItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG, JSON.stringify(this.documentListView))
}
quickFilter(filterRules: FilterRule[]) {
this.savedView = null
this.view.filter_rules = filterRules
this.reduceSelectionToFilter()
this.saveDocumentListView()
this.router.navigate(["documents"])
}
getLastPage(): number {
return Math.ceil(this.collectionSize / this.currentPageSize)
}
@@ -240,7 +249,7 @@ export class DocumentListViewService {
}
}
constructor(private documentService: DocumentService, private settings: SettingsService) {
constructor(private documentService: DocumentService, private settings: SettingsService, private router: Router) {
let documentListViewConfigJson = sessionStorage.getItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG)
if (documentListViewConfigJson) {
try {

View File

@@ -28,6 +28,9 @@ export class OpenDocumentsService {
if (index > -1) {
this.documentService.get(id).subscribe(doc => {
this.openDocuments[index] = doc
}, error => {
this.openDocuments.splice(index, 1)
this.save()
})
}
}