mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-16 00:36:22 +00:00
Refactor frontend data models
This commit is contained in:
@@ -5,7 +5,7 @@ import { UserService } from 'src/app/services/rest/user.service'
|
||||
import { of, throwError } from 'rxjs'
|
||||
import { DocumentNotesService } from 'src/app/services/rest/document-notes.service'
|
||||
import { ToastService } from 'src/app/services/toast.service'
|
||||
import { PaperlessDocumentNote } from 'src/app/data/paperless-document-note'
|
||||
import { DocumentNote } from 'src/app/data/document-note'
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing'
|
||||
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
|
||||
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
|
||||
@@ -14,7 +14,7 @@ import { By } from '@angular/platform-browser'
|
||||
import { PermissionsService } from 'src/app/services/permissions.service'
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
||||
|
||||
const notes: PaperlessDocumentNote[] = [
|
||||
const notes: DocumentNote[] = [
|
||||
{
|
||||
id: 23,
|
||||
note: 'Note 23',
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core'
|
||||
import { DocumentNotesService } from 'src/app/services/rest/document-notes.service'
|
||||
import { PaperlessDocumentNote } from 'src/app/data/paperless-document-note'
|
||||
import { DocumentNote } from 'src/app/data/document-note'
|
||||
import { FormControl, FormGroup } from '@angular/forms'
|
||||
import { ToastService } from 'src/app/services/toast.service'
|
||||
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
|
||||
import { UserService } from 'src/app/services/rest/user.service'
|
||||
import { PaperlessUser } from 'src/app/data/paperless-user'
|
||||
import { User } from 'src/app/data/user'
|
||||
|
||||
@Component({
|
||||
selector: 'pngx-document-notes',
|
||||
@@ -24,14 +24,14 @@ export class DocumentNotesComponent extends ComponentWithPermissions {
|
||||
documentId: number
|
||||
|
||||
@Input()
|
||||
notes: PaperlessDocumentNote[] = []
|
||||
notes: DocumentNote[] = []
|
||||
|
||||
@Input()
|
||||
addDisabled: boolean = false
|
||||
|
||||
@Output()
|
||||
updated: EventEmitter<PaperlessDocumentNote[]> = new EventEmitter()
|
||||
users: PaperlessUser[]
|
||||
updated: EventEmitter<DocumentNote[]> = new EventEmitter()
|
||||
users: User[]
|
||||
|
||||
constructor(
|
||||
private notesService: DocumentNotesService,
|
||||
@@ -82,7 +82,7 @@ export class DocumentNotesComponent extends ComponentWithPermissions {
|
||||
})
|
||||
}
|
||||
|
||||
displayName(note: PaperlessDocumentNote): string {
|
||||
displayName(note: DocumentNote): string {
|
||||
if (!note.user) return ''
|
||||
const user = this.users?.find((u) => u.id === note.user)
|
||||
if (!user) return ''
|
||||
|
Reference in New Issue
Block a user