Skip to content

Commit bc59ae5

Browse files
UFAL/Fix the bulk access (#852)
* Do not use the clarin item view box for the bulk access * Removed unused import * Clarify the `showClarinViewBox` is boolean * Use the constant for the hardcoded bulk access list id
1 parent 7f6580a commit bc59ae5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/app/shared/object-list/object-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
(prev)="goPrev()"
1717
(next)="goNext()">
1818
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}">
19-
<div *ngIf="context === 'search'">
19+
<div *ngIf="showClarinViewBox()">
2020
<ds-clarin-item-box-view
2121
*ngFor="let object of objects?.payload?.page; let i = index; let last = last"
2222
[object]="object"
2323
[isSearchResult]="true">
2424
</ds-clarin-item-box-view>
2525
</div>
26-
<div *ngIf="context !== 'search'">
26+
<div *ngIf="!showClarinViewBox()">
2727
<li *ngFor="let object of objects?.payload?.page; let i = index; let last = last" class="mt-4 mb-4 d-flex" [class.border-bottom]="hasBorder && !last" [attr.data-test]="'list-object' | dsBrowserOnly">
2828
<ds-selectable-list-item-control *ngIf="selectable" [index]="i"
2929
[object]="object"

src/app/shared/object-list/object-list.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import { CollectionElementLinkType } from '../object-collection/collection-eleme
1919
animations: [fadeIn]
2020
})
2121
export class ObjectListComponent {
22+
/**
23+
* The id of the list used for bulk access
24+
*/
25+
BULK_ACCESS_LIST_ID = 'bulk-access-list';
26+
2227
/**
2328
* The view mode of the this component
2429
*/
@@ -227,4 +232,10 @@ export class ObjectListComponent {
227232
this.next.emit(true);
228233
}
229234

235+
/**
236+
* Show the search results in the Clarin view box or use the default view
237+
*/
238+
showClarinViewBox(): boolean {
239+
return this.context === 'search' && this.selectionConfig?.listId !== this.BULK_ACCESS_LIST_ID;
240+
}
230241
}

0 commit comments

Comments
 (0)