mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fixes a bug with invisible selection
This commit is contained in:
parent
1428b26703
commit
ef1ee8e0c0
@ -1,5 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { FILTER_CORRESPONDENT } from 'src/app/data/filter-rule-type';
|
import { FILTER_CORRESPONDENT } from 'src/app/data/filter-rule-type';
|
||||||
import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
|
import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
|
||||||
@ -16,7 +15,6 @@ import { CorrespondentEditDialogComponent } from './correspondent-edit-dialog/co
|
|||||||
export class CorrespondentListComponent extends GenericListComponent<PaperlessCorrespondent> {
|
export class CorrespondentListComponent extends GenericListComponent<PaperlessCorrespondent> {
|
||||||
|
|
||||||
constructor(correspondentsService: CorrespondentService, modalService: NgbModal,
|
constructor(correspondentsService: CorrespondentService, modalService: NgbModal,
|
||||||
private router: Router,
|
|
||||||
private list: DocumentListViewService
|
private list: DocumentListViewService
|
||||||
) {
|
) {
|
||||||
super(correspondentsService,modalService,CorrespondentEditDialogComponent)
|
super(correspondentsService,modalService,CorrespondentEditDialogComponent)
|
||||||
@ -27,9 +25,6 @@ export class CorrespondentListComponent extends GenericListComponent<PaperlessCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
filterDocuments(object: PaperlessCorrespondent) {
|
filterDocuments(object: PaperlessCorrespondent) {
|
||||||
this.list.documentListView.filter_rules = [
|
this.list.quickFilter([{rule_type: FILTER_CORRESPONDENT, value: object.id.toString()}])
|
||||||
{rule_type: FILTER_CORRESPONDENT, value: object.id.toString()}
|
|
||||||
]
|
|
||||||
this.router.navigate(["documents"])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { FILTER_DOCUMENT_TYPE } from 'src/app/data/filter-rule-type';
|
import { FILTER_DOCUMENT_TYPE } from 'src/app/data/filter-rule-type';
|
||||||
import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
|
import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
|
||||||
@ -16,7 +15,6 @@ import { DocumentTypeEditDialogComponent } from './document-type-edit-dialog/doc
|
|||||||
export class DocumentTypeListComponent extends GenericListComponent<PaperlessDocumentType> {
|
export class DocumentTypeListComponent extends GenericListComponent<PaperlessDocumentType> {
|
||||||
|
|
||||||
constructor(service: DocumentTypeService, modalService: NgbModal,
|
constructor(service: DocumentTypeService, modalService: NgbModal,
|
||||||
private router: Router,
|
|
||||||
private list: DocumentListViewService
|
private list: DocumentListViewService
|
||||||
) {
|
) {
|
||||||
super(service, modalService, DocumentTypeEditDialogComponent)
|
super(service, modalService, DocumentTypeEditDialogComponent)
|
||||||
@ -28,9 +26,6 @@ export class DocumentTypeListComponent extends GenericListComponent<PaperlessDoc
|
|||||||
|
|
||||||
|
|
||||||
filterDocuments(object: PaperlessDocumentType) {
|
filterDocuments(object: PaperlessDocumentType) {
|
||||||
this.list.documentListView.filter_rules = [
|
this.list.quickFilter([{rule_type: FILTER_DOCUMENT_TYPE, value: object.id.toString()}])
|
||||||
{rule_type: FILTER_DOCUMENT_TYPE, value: object.id.toString()}
|
|
||||||
]
|
|
||||||
this.router.navigate(["documents"])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { FILTER_HAS_TAG } from 'src/app/data/filter-rule-type';
|
import { FILTER_HAS_TAG } from 'src/app/data/filter-rule-type';
|
||||||
import { TAG_COLOURS, PaperlessTag } from 'src/app/data/paperless-tag';
|
import { TAG_COLOURS, PaperlessTag } from 'src/app/data/paperless-tag';
|
||||||
@ -16,7 +15,6 @@ import { TagEditDialogComponent } from './tag-edit-dialog/tag-edit-dialog.compon
|
|||||||
export class TagListComponent extends GenericListComponent<PaperlessTag> {
|
export class TagListComponent extends GenericListComponent<PaperlessTag> {
|
||||||
|
|
||||||
constructor(tagService: TagService, modalService: NgbModal,
|
constructor(tagService: TagService, modalService: NgbModal,
|
||||||
private router: Router,
|
|
||||||
private list: DocumentListViewService
|
private list: DocumentListViewService
|
||||||
) {
|
) {
|
||||||
super(tagService, modalService, TagEditDialogComponent)
|
super(tagService, modalService, TagEditDialogComponent)
|
||||||
@ -27,14 +25,11 @@ export class TagListComponent extends GenericListComponent<PaperlessTag> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDeleteMessage(object: PaperlessTag) {
|
getDeleteMessage(object: PaperlessTag) {
|
||||||
|
|
||||||
return $localize`Do you really want to delete the tag "${object.name}"?`
|
return $localize`Do you really want to delete the tag "${object.name}"?`
|
||||||
}
|
}
|
||||||
|
|
||||||
filterDocuments(object: PaperlessTag) {
|
filterDocuments(object: PaperlessTag) {
|
||||||
this.list.documentListView.filter_rules = [
|
this.list.quickFilter([{rule_type: FILTER_HAS_TAG, value: object.id.toString()}])
|
||||||
{rule_type: FILTER_HAS_TAG, value: object.id.toString()}
|
|
||||||
]
|
|
||||||
this.router.navigate(["documents"])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { cloneFilterRules, FilterRule } from '../data/filter-rule';
|
import { cloneFilterRules, FilterRule } from '../data/filter-rule';
|
||||||
import { PaperlessDocument } from '../data/paperless-document';
|
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))
|
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 {
|
getLastPage(): number {
|
||||||
return Math.ceil(this.collectionSize / this.currentPageSize)
|
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)
|
let documentListViewConfigJson = sessionStorage.getItem(DOCUMENT_LIST_SERVICE.CURRENT_VIEW_CONFIG)
|
||||||
if (documentListViewConfigJson) {
|
if (documentListViewConfigJson) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user