add comment function

This commit is contained in:
tim-vogel
2022-08-07 12:41:30 -07:00
committed by Michael Shamoon
parent c2fda245ac
commit 278e9c12e1
20 changed files with 416 additions and 1 deletions

View File

@@ -169,6 +169,13 @@
</div>
</ng-template>
</li>
<li [ngbNavItem]="5" *ngIf="isCommentsEnabled">
<a ngbNavLink i18n>Comments</a>
<ng-template ngbNavContent>
<app-document-comment #commentComponent></app-document-comment>
</ng-template>
</li>
</ul>
<div [ngbNavOutlet]="nav" class="mt-2"></div>

View File

@@ -35,6 +35,7 @@ import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { PaperlessStoragePath } from 'src/app/data/paperless-storage-path'
import { StoragePathEditDialogComponent } from '../common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component'
import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings'
import { EnvironmentService } from 'src/app/services/rest/environment.service'
@Component({
selector: 'app-document-detail',
@@ -83,6 +84,8 @@ export class DocumentDetailComponent
previewCurrentPage: number = 1
previewNumPages: number = 1
isCommentsEnabled:boolean = false
store: BehaviorSubject<any>
isDirty$: Observable<boolean>
unsubscribeNotifier: Subject<any> = new Subject()
@@ -118,7 +121,8 @@ export class DocumentDetailComponent
private documentTitlePipe: DocumentTitlePipe,
private toastService: ToastService,
private settings: SettingsService,
private storagePathService: StoragePathService
private storagePathService: StoragePathService,
private environment: EnvironmentService
) {}
titleKeyUp(event) {
@@ -274,6 +278,13 @@ export class DocumentDetailComponent
this.suggestions = null
},
})
this.environment.get("PAPERLESS_COMMENTS_ENABLED").subscribe(result => {
this.isCommentsEnabled = (result.value.toString().toLowerCase() === "true"?true:false);
}, error => {
this.isCommentsEnabled = false;
})
this.title = this.documentTitlePipe.transform(doc.title)
this.documentForm.patchValue(doc)
}