PermissionType.Document
)
) {
- this.documentsService
- .getSuggestions(doc.id)
- .pipe(
- first(),
- takeUntil(this.unsubscribeNotifier),
- takeUntil(this.docChangeNotifier)
- )
- .subscribe({
- next: (result) => {
- this.suggestions = result
- },
- error: (error) => {
- this.suggestions = null
- this.toastService.showError(
- $localize`Error retrieving suggestions.`,
- error
- )
- },
- })
+ this.tagService.getCachedMany(doc.tags).subscribe((tags) => {
+ // only show suggestions if document has inbox tags
+ if (tags.some((tag) => tag.is_inbox_tag)) {
+ this.getSuggestions()
+ }
+ })
}
this.title = this.documentTitlePipe.transform(doc.title)
- const docFormValues = Object.assign({}, doc)
- docFormValues['permissions_form'] = {
- owner: doc.owner,
- set_permissions: doc.permissions,
- }
-
- this.documentForm.patchValue(docFormValues, { emitEvent: false })
- if (!this.userCanEdit) this.documentForm.disable()
+ this.prepareForm(doc)
}
get customFieldFormFields(): FormArray {