mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
let OpenDocumentsService handle nav
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<use xlink:href="assets/bootstrap-icons.svg#diagram-3"/>
|
||||
</svg> <span class="d-none d-md-inline" i18n>More like this</span>
|
||||
</a>
|
||||
<a (click)="clickEdit()" class="btn btn-sm btn-outline-secondary">
|
||||
<a (click)="openDocumentsService.openDocument(document)" class="btn btn-sm btn-outline-secondary">
|
||||
<svg class="sidebaricon" fill="currentColor" class="sidebaricon">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#pencil"/>
|
||||
</svg> <span class="d-none d-md-inline" i18n>Edit</span>
|
||||
|
@@ -14,8 +14,6 @@ import {
|
||||
} from 'src/app/services/settings.service'
|
||||
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { OpenDocumentsService } from 'src/app/services/open-documents.service'
|
||||
import { Router } from '@angular/router'
|
||||
import { first } from 'rxjs'
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-card-large',
|
||||
@@ -29,8 +27,7 @@ export class DocumentCardLargeComponent implements OnInit {
|
||||
constructor(
|
||||
private documentService: DocumentService,
|
||||
private settingsService: SettingsService,
|
||||
private openDocumentsService: OpenDocumentsService,
|
||||
private router: Router
|
||||
public openDocumentsService: OpenDocumentsService
|
||||
) {}
|
||||
|
||||
@Input()
|
||||
@@ -121,13 +118,4 @@ export class DocumentCardLargeComponent implements OnInit {
|
||||
get contentTrimmed() {
|
||||
return this.document.content.substr(0, 500)
|
||||
}
|
||||
|
||||
clickEdit() {
|
||||
this.openDocumentsService
|
||||
.openDocument(this.document)
|
||||
.pipe(first())
|
||||
.subscribe((open) => {
|
||||
if (open) this.router.navigate(['documents', this.document.id])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user