diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 7f3facc65..d45a2a8b1 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -2950,7 +2950,7 @@ src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html - 80 + 103 src/app/components/document-detail/document-detail.component.html @@ -5961,11 +5961,40 @@ 345 + + Filter by owner + + src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html + 73 + + + + Yes + + src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html + 83 + + + src/app/components/document-list/document-list.component.html + 366 + + + + No + + src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html + 83 + + + src/app/components/document-list/document-list.component.html + 366 + + No documents src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html - 125 + 148 @@ -7594,20 +7623,6 @@ 307 - - Yes - - src/app/components/document-list/document-list.component.html - 366 - - - - No - - src/app/components/document-list/document-list.component.html - 366 - - Reset filters / selection diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html index e52272787..52aa48c2e 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html @@ -68,6 +68,29 @@ {{(doc.storage_path$ | async)?.name}} } } + @case (DisplayField.OWNER) { + @if (doc.owner) { + {{doc.owner | username}} + } + } + @case (DisplayField.ASN) { + {{doc.archive_serial_number}} + } + @case (DisplayField.PAGE_COUNT) { + {{ doc.page_count }} + } + @case (DisplayField.SHARED) { + @if (doc.is_shared_by_requester) { Yes } @else { No } + } + @case (DisplayField.NOTES) { + @if (doc.notes.length) { + + + + {{doc.notes.length}} + + } + } } @if (field.startsWith(DisplayField.CUSTOM_FIELD)) { diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.spec.ts b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.spec.ts index d827c9305..5f66c68d6 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.spec.ts +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.spec.ts @@ -24,6 +24,7 @@ import { FILTER_DOCUMENT_TYPE, FILTER_FULLTEXT_MORELIKE, FILTER_HAS_TAGS_ALL, + FILTER_OWNER_ANY, FILTER_STORAGE_PATH, } from 'src/app/data/filter-rule-type' import { SavedView } from 'src/app/data/saved-view' @@ -295,6 +296,15 @@ describe('SavedViewWidgetComponent', () => { component.clickStoragePath(11) // coverage }) + it('should navigate via quickfilter on click owner', () => { + const qfSpy = jest.spyOn(documentListViewService, 'quickFilter') + component.clickOwner(11, new MouseEvent('click')) + expect(qfSpy).toHaveBeenCalledWith([ + { rule_type: FILTER_OWNER_ANY, value: '11' }, + ]) + component.clickOwner(11) // coverage + }) + it('should navigate via quickfilter on click more like', () => { const qfSpy = jest.spyOn(documentListViewService, 'quickFilter') component.clickMoreLike(11) diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts index edd499438..cf2dc4a45 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts @@ -31,12 +31,14 @@ import { FILTER_DOCUMENT_TYPE, FILTER_FULLTEXT_MORELIKE, FILTER_HAS_TAGS_ALL, + FILTER_OWNER_ANY, FILTER_STORAGE_PATH, } from 'src/app/data/filter-rule-type' import { SavedView } from 'src/app/data/saved-view' import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive' import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe' import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe' +import { UsernamePipe } from 'src/app/pipes/username.pipe' import { ConsumerStatusService } from 'src/app/services/consumer-status.service' import { DocumentListViewService } from 'src/app/services/document-list-view.service' import { OpenDocumentsService } from 'src/app/services/open-documents.service' @@ -62,6 +64,7 @@ import { WidgetFrameComponent } from '../widget-frame/widget-frame.component' TagComponent, WidgetFrameComponent, IfPermissionsDirective, + UsernamePipe, AsyncPipe, DocumentTitlePipe, CustomDatePipe, @@ -229,6 +232,15 @@ export class SavedViewWidgetComponent ]) } + clickOwner(ownerID: number, event: MouseEvent = null) { + event?.preventDefault() + event?.stopImmediatePropagation() + + this.list.quickFilter([ + { rule_type: FILTER_OWNER_ANY, value: ownerID.toString() }, + ]) + } + openDocumentDetail(document: Document) { this.router.navigate(['documents', document.id]) } diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index 65d291464..73f7a1ce8 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -357,10 +357,10 @@ } @if (activeDisplayFields.includes(DisplayField.PAGE_COUNT)) { - - {{ d.page_count }} - - } + + {{ d.page_count }} + + } @if (activeDisplayFields.includes(DisplayField.SHARED)) { @if (d.is_shared_by_requester) { Yes } @else { No }