Skip to content

Commit c58eca9

Browse files
committed
Merged in ux-plus-2023_02_x-back-porting-UXP-103 (pull request DSpace#1393)
Ux plus 2023 02 x back porting UXP-103
2 parents cac92a3 + 2a0d775 commit c58eca9

2 files changed

Lines changed: 43 additions & 2 deletions

File tree

src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,36 @@
4848
</div>
4949
<ds-additional-metadata [object]="dso"></ds-additional-metadata>
5050
</ds-truncatable>
51+
<div *ngIf="fullTextHighlights.length" class="d-flex flex-row item-list-highlights p-3 border-bottom">
52+
<div>
53+
<ng-container *ngFor="let highlight of fullTextHighlights">
54+
<span [innerHTML]="highlight" class="d-block text-monospace small"></span>
55+
</ng-container>
56+
</div>
57+
</div>
58+
<div *ngIf="fullTextMirador.length" class="d-flex flex-row item-list-highlights p-3 border-bottom">
59+
<div>
60+
<ng-container *ngFor="let mirador of fullTextMirador">
61+
<span [innerHTML]="mirador" class="d-block text-monospace small"></span>
62+
</ng-container>
63+
</div>
64+
<div class="mirador-btn-wrapper ml-2 pl-2 border-left">
65+
<button class="text-center btn btn-outline-primary"
66+
[routerLink]="itemViewerRoute" queryParamsHandling="preserve"
67+
[ngbTooltip]="'item.search.results.open-mirador' | translate"
68+
>
69+
<i class="fas fa-eye"></i><br><i class="mirador-icon"></i>
70+
</button>
71+
</div>
72+
</div>
73+
<div *ngIf="fullTextVideo.length" class="d-flex flex-row item-list-highlights p-3 border-bottom">
74+
<hr/>
75+
<div>
76+
<ng-container *ngFor="let video of fullTextVideo">
77+
<span [innerHTML]="video" class="d-block text-monospace small"></span>
78+
</ng-container>
79+
</div>
80+
</div>
5181
<ds-metric-badges *ngIf="showMetrics" class="d-block clearfix" [item]="dso"></ds-metric-badges>
5282
</div>
5383
<div class="align-self-center" *ngIf="showMetrics">

src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ViewMode } from '../../../../../../core/shared/view-mode.model';
66
import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model';
77
import { SearchResultListElementComponent } from '../../../search-result-list-element.component';
88
import { Item } from '../../../../../../core/shared/item.model';
9-
import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths';
9+
import { getItemPageRoute, getItemViewerPath } from '../../../../../../item-page/item-page-routing-paths';
1010
import { Context } from '../../../../../../core/shared/context.model';
1111
import { environment } from '../../../../../../../environments/environment';
1212
import { KlaroService } from '../../../../../cookies/klaro.service';
@@ -40,13 +40,20 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen
4040
*/
4141
itemPageRoute: string;
4242

43+
itemViewerRoute: string;
44+
4345
authorMetadata = environment.searchResult.authorMetadata;
4446

47+
fullTextHighlights: string[];
48+
49+
fullTextMirador: string[];
50+
51+
fullTextVideo: string[];
52+
4553
hasLoadedThirdPartyMetrics$: Observable<boolean>;
4654

4755
private thirdPartyMetrics = environment.info.metricsConsents.filter(metric => metric.enabled).map(metric => metric.key);
4856

49-
5057
constructor(
5158
protected truncatableService: TruncatableService,
5259
public dsoNameService: DSONameService,
@@ -59,6 +66,10 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen
5966
ngOnInit(): void {
6067
super.ngOnInit();
6168
this.itemPageRoute = getItemPageRoute(this.dso);
69+
this.itemViewerRoute = getItemViewerPath(this.dso, 'iiif');
70+
this.fullTextHighlights = this.allMetadataValues('fulltext');
71+
this.fullTextMirador = this.allMetadataValues('fulltext.mirador');
72+
this.fullTextVideo = this.allMetadataValues('fulltext.video');
6273
}
6374

6475
/**

0 commit comments

Comments
 (0)