Rename comments --> notes

This commit is contained in:
shamoon
2023-03-17 16:36:08 -07:00
parent 78cb8cff69
commit 5108bbc192
45 changed files with 540 additions and 528 deletions

View File

@@ -171,10 +171,10 @@
</ng-template>
</li>
<li [ngbNavItem]="DocumentDetailNavIDs.Comments" *ngIf="commentsEnabled">
<a ngbNavLink i18n>Comments <span *ngIf="document?.comments.length" class="badge text-bg-secondary ms-1">{{document.comments.length}}</span></a>
<li [ngbNavItem]="DocumentDetailNavIDs.Notes" *ngIf="notesEnabled">
<a ngbNavLink i18n>Notes <span *ngIf="document?.notes.length" class="badge text-bg-secondary ms-1">{{document.notes.length}}</span></a>
<ng-template ngbNavContent>
<app-document-comments [documentId]="documentId" [comments]="document?.comments" (updated)="commentsUpdated($event)"></app-document-comments>
<app-document-notes [documentId]="documentId" [notes]="document?.notes" (updated)="notesUpdated($event)"></app-document-notes>
</ng-template>
</li>

View File

@@ -42,14 +42,14 @@ import {
} from 'src/app/services/permissions.service'
import { PaperlessUser } from 'src/app/data/paperless-user'
import { UserService } from 'src/app/services/rest/user.service'
import { PaperlessDocumentComment } from 'src/app/data/paperless-document-comment'
import { PaperlessDocumentNote } from 'src/app/data/paperless-document-note'
enum DocumentDetailNavIDs {
Details = 1,
Content = 2,
Metadata = 3,
Preview = 4,
Comments = 5,
Notes = 5,
Permissions = 6,
}
@@ -658,9 +658,9 @@ export class DocumentDetailComponent
}
}
get commentsEnabled(): boolean {
get notesEnabled(): boolean {
return (
this.settings.get(SETTINGS_KEYS.COMMENTS_ENABLED) &&
this.settings.get(SETTINGS_KEYS.NOTES_ENABLED) &&
this.permissionsService.currentUserCan(
PermissionAction.View,
PermissionType.Document
@@ -668,8 +668,8 @@ export class DocumentDetailComponent
)
}
commentsUpdated(comments: PaperlessDocumentComment[]) {
this.document.comments = comments
notesUpdated(notes: PaperlessDocumentNote[]) {
this.document.notes = notes
this.openDocumentService.refreshDocument(this.documentId)
}