+
@if (hasNext()) {
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts
index d7b1f6069..6f386ad73 100644
--- a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts
+++ b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts
@@ -993,7 +993,7 @@ describe('DocumentDetailComponent', () => {
expect(component.document.custom_fields).toHaveLength(initialLength - 1)
expect(component.customFieldFormFields).toHaveLength(initialLength - 1)
expect(
- fixture.debugElement.query(By.css('form')).nativeElement.textContent
+ fixture.debugElement.query(By.css('form ul')).nativeElement.textContent
).not.toContain('Field 1')
const updateSpy = jest.spyOn(documentService, 'update')
component.save(true)
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts
index 0a3d9ec38..4f0893474 100644
--- a/src-ui/src/app/components/document-detail/document-detail.component.ts
+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts
@@ -191,6 +191,7 @@ export class DocumentDetailComponent
document: Document
metadata: DocumentMetadata
suggestions: DocumentSuggestions
+ suggestionsLoading: boolean = false
users: User[]
title: string
@@ -650,25 +651,7 @@ export class DocumentDetailComponent
this.tagService.getCachedMany(doc.tags).subscribe((tags) => {
// only show suggestions if document has inbox tags
if (tags.some((tag) => tag.is_inbox_tag)) {
- 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.getSuggestions()
}
})
}
@@ -687,6 +670,31 @@ export class DocumentDetailComponent
return this.documentForm.get('custom_fields') as FormArray
}
+ getSuggestions() {
+ this.suggestionsLoading = true
+ this.documentsService
+ .getSuggestions(this.documentId)
+ .pipe(
+ first(),
+ takeUntil(this.unsubscribeNotifier),
+ takeUntil(this.docChangeNotifier)
+ )
+ .subscribe({
+ next: (result) => {
+ this.suggestions = result
+ this.suggestionsLoading = false
+ },
+ error: (error) => {
+ this.suggestions = null
+ this.suggestionsLoading = false
+ this.toastService.showError(
+ $localize`Error retrieving suggestions.`,
+ error
+ )
+ },
+ })
+ }
+
createDocumentType(newName: string) {
var modal = this.modalService.open(DocumentTypeEditDialogComponent, {
backdrop: 'static',
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index eb34b94b4..c906856bb 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -118,6 +118,7 @@ import {
sliders2Vertical,
sortAlphaDown,
sortAlphaUpAlt,
+ stars,
tag,
tagFill,
tags,
@@ -324,6 +325,7 @@ const icons = {
sliders2Vertical,
sortAlphaDown,
sortAlphaUpAlt,
+ stars,
tagFill,
tag,
tags,