</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html</context>
- <context context-type="linenumber">80</context>
+ <context context-type="linenumber">103</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">345</context>
</context-group>
</trans-unit>
+ <trans-unit id="883965278435032344" datatype="html">
+ <source>Filter by owner</source>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html</context>
+ <context context-type="linenumber">73</context>
+ </context-group>
+ </trans-unit>
+ <trans-unit id="2807800733729323332" datatype="html">
+ <source>Yes</source>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html</context>
+ <context context-type="linenumber">83</context>
+ </context-group>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/document-list/document-list.component.html</context>
+ <context context-type="linenumber">366</context>
+ </context-group>
+ </trans-unit>
+ <trans-unit id="3542042671420335679" datatype="html">
+ <source>No</source>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html</context>
+ <context context-type="linenumber">83</context>
+ </context-group>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/document-list/document-list.component.html</context>
+ <context context-type="linenumber">366</context>
+ </context-group>
+ </trans-unit>
<trans-unit id="872092479747931526" datatype="html">
<source>No documents</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html</context>
- <context context-type="linenumber">125</context>
+ <context context-type="linenumber">148</context>
</context-group>
</trans-unit>
<trans-unit id="1069523139277190436" datatype="html">
<context context-type="linenumber">307</context>
</context-group>
</trans-unit>
- <trans-unit id="2807800733729323332" datatype="html">
- <source>Yes</source>
- <context-group purpose="location">
- <context context-type="sourcefile">src/app/components/document-list/document-list.component.html</context>
- <context context-type="linenumber">366</context>
- </context-group>
- </trans-unit>
- <trans-unit id="3542042671420335679" datatype="html">
- <source>No</source>
- <context-group purpose="location">
- <context context-type="sourcefile">src/app/components/document-list/document-list.component.html</context>
- <context context-type="linenumber">366</context>
- </context-group>
- </trans-unit>
<trans-unit id="4512084577073831437" datatype="html">
<source>Reset filters / selection</source>
<context-group purpose="location">
<a class="btn-link text-dark text-decoration-none" type="button" (click)="clickStoragePath(doc.storage_path, $event)" title="Filter by storage path" i18n-title>{{(doc.storage_path$ | async)?.name}}</a>
}
}
+ @case (DisplayField.OWNER) {
+ @if (doc.owner) {
+ <a class="btn-link text-dark text-decoration-none" type="button" (click)="clickOwner(doc.owner, $event)" title="Filter by owner" i18n-title>{{doc.owner | username}}</a>
+ }
+ }
+ @case (DisplayField.ASN) {
+ {{doc.archive_serial_number}}
+ }
+ @case (DisplayField.PAGE_COUNT) {
+ {{ doc.page_count }}
+ }
+ @case (DisplayField.SHARED) {
+ @if (doc.is_shared_by_requester) { <ng-container i18n>Yes</ng-container> } @else { <ng-container i18n>No</ng-container> }
+ }
+ @case (DisplayField.NOTES) {
+ @if (doc.notes.length) {
+ <a routerLink="/documents/{{doc.id}}/notes" class="btn btn-sm p-0">
+ <span class="badge rounded-pill bg-light border text-primary">
+ <i-bs width="1.2em" height="1.2em" class="ms-1 me-1" name="chat-left-text"></i-bs>
+ {{doc.notes.length}}</span>
+ </a>
+ }
+ }
}
@if (field.startsWith(DisplayField.CUSTOM_FIELD)) {
<pngx-custom-field-display [document]="doc" [fieldDisplayKey]="field"></pngx-custom-field-display>
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'
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)
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'
TagComponent,
WidgetFrameComponent,
IfPermissionsDirective,
+ UsernamePipe,
AsyncPipe,
DocumentTitlePipe,
CustomDatePipe,
])
}
+ 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])
}
</td>
}
@if (activeDisplayFields.includes(DisplayField.PAGE_COUNT)) {
- <td>
- {{ d.page_count }}
- </td>
- }
+ <td>
+ {{ d.page_count }}
+ </td>
+ }
@if (activeDisplayFields.includes(DisplayField.SHARED)) {
<td>
@if (d.is_shared_by_requester) { <ng-container i18n>Yes</ng-container> } @else { <ng-container i18n>No</ng-container> }