mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 13:03:04 +00:00
#0 fix thumbnail
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer" [routerLink]="['/items/' + dso.id]"
|
||||
class="card-img-top full-width">
|
||||
<div>
|
||||
<ds-grid-thumbnail [thumbnail]="getThumbnail() | async">
|
||||
<ds-grid-thumbnail [thumbnail]="getThumbnail()">
|
||||
</ds-grid-thumbnail>
|
||||
</div>
|
||||
</a>
|
||||
<span *ngIf="linkType == linkTypes.None" class="card-img-top full-width">
|
||||
<div>
|
||||
<ds-grid-thumbnail [thumbnail]="getThumbnail() | async">
|
||||
<ds-grid-thumbnail [thumbnail]="getThumbnail()">
|
||||
</ds-grid-thumbnail>
|
||||
</div>
|
||||
</span>
|
||||
|
@@ -6,10 +6,11 @@ import { BitstreamDataService } from '../../../core/data/bitstream-data.service'
|
||||
import { Bitstream } from '../../../core/shared/bitstream.model';
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { Metadata } from '../../../core/shared/metadata.utils';
|
||||
import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators';
|
||||
import { hasValue } from '../../empty.util';
|
||||
import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component';
|
||||
import { TruncatableService } from '../../truncatable/truncatable.service';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-search-result-grid-element',
|
||||
@@ -42,7 +43,9 @@ export class SearchResultGridElementComponent<T extends SearchResult<K>, K exten
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
if (hasValue(this.object)) {
|
||||
console.log(this.object)
|
||||
this.dso = this.object.indexableObject;
|
||||
console.log('this.dso',this.dso)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +74,7 @@ export class SearchResultGridElementComponent<T extends SearchResult<K>, K exten
|
||||
}
|
||||
|
||||
// TODO refactor to return RemoteData, and thumbnail template to deal with loading
|
||||
getThumbnail(): Observable<Bitstream> {
|
||||
return this.bitstreamDataService.getThumbnailFor(this.dso as any).pipe(
|
||||
getFirstSucceededRemoteDataPayload()
|
||||
);
|
||||
getThumbnail(): Observable<RemoteData<Bitstream>> {
|
||||
return this.bitstreamDataService.getThumbnailFor(this.dso as any);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user