mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 04:53:06 +00:00
#674 fix community and collection thumblogo
This commit is contained in:
@@ -18,6 +18,7 @@ import { SearchService } from '../core/shared/search/search.service';
|
||||
import { currentPath } from '../shared/utils/route.utils';
|
||||
import { Router } from '@angular/router';
|
||||
import { Context } from '../core/shared/context.model';
|
||||
import { followLink } from '../shared/utils/follow-link-config.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-search',
|
||||
@@ -122,8 +123,9 @@ export class SearchComponent implements OnInit {
|
||||
this.searchLink = this.getSearchLink();
|
||||
this.searchOptions$ = this.getSearchOptions();
|
||||
this.sub = this.searchOptions$.pipe(
|
||||
switchMap((options) => this.service.search(options).pipe(getSucceededRemoteData(), startWith(undefined))))
|
||||
switchMap((options) => this.service.search(options, null, followLink('logo')).pipe(getSucceededRemoteData(), startWith(undefined))))
|
||||
.subscribe((results) => {
|
||||
console.log('result', results)
|
||||
this.resultsRD$.next(results);
|
||||
});
|
||||
this.scopeListRD$ = this.searchConfigService.getCurrentScope('').pipe(
|
||||
|
4
src/app/core/cache/builders/link.service.ts
vendored
4
src/app/core/cache/builders/link.service.ts
vendored
@@ -39,10 +39,12 @@ export class LinkService {
|
||||
* @param linkToFollow the {@link FollowLinkConfig} to resolve
|
||||
*/
|
||||
public resolveLink<T extends HALResource>(model, linkToFollow: FollowLinkConfig<T>): T {
|
||||
console.log('model', model, 'links', linkToFollow)
|
||||
const matchingLinkDef = getLinkDefinition(model.constructor, linkToFollow.name);
|
||||
|
||||
if (hasNoValue(matchingLinkDef)) {
|
||||
throw new Error(`followLink('${linkToFollow.name}') was used for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${linkToFollow.name}`);
|
||||
console.error(`followLink('${linkToFollow.name}') was used for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${linkToFollow.name}`);
|
||||
return model;
|
||||
} else {
|
||||
const provider = getDataServiceFor(matchingLinkDef.resourceType);
|
||||
|
||||
|
@@ -33,7 +33,7 @@ export class GridThumbnailComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.src$ = new BehaviorSubject<string>(this.defaultImage);
|
||||
console.log('this.thumbnail', this.thumbnail);
|
||||
// console.log('this.thumbnail', this.thumbnail);
|
||||
if (isObservable(this.thumbnail)) {
|
||||
this.thumbnail.subscribe((thumbnailRD) => {
|
||||
this.checkThumbnail(thumbnailRD.payload);
|
||||
|
Reference in New Issue
Block a user