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 { currentPath } from '../shared/utils/route.utils';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Context } from '../core/shared/context.model';
|
import { Context } from '../core/shared/context.model';
|
||||||
|
import { followLink } from '../shared/utils/follow-link-config.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search',
|
selector: 'ds-search',
|
||||||
@@ -122,8 +123,9 @@ export class SearchComponent implements OnInit {
|
|||||||
this.searchLink = this.getSearchLink();
|
this.searchLink = this.getSearchLink();
|
||||||
this.searchOptions$ = this.getSearchOptions();
|
this.searchOptions$ = this.getSearchOptions();
|
||||||
this.sub = this.searchOptions$.pipe(
|
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) => {
|
.subscribe((results) => {
|
||||||
|
console.log('result', results)
|
||||||
this.resultsRD$.next(results);
|
this.resultsRD$.next(results);
|
||||||
});
|
});
|
||||||
this.scopeListRD$ = this.searchConfigService.getCurrentScope('').pipe(
|
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
|
* @param linkToFollow the {@link FollowLinkConfig} to resolve
|
||||||
*/
|
*/
|
||||||
public resolveLink<T extends HALResource>(model, linkToFollow: FollowLinkConfig<T>): T {
|
public resolveLink<T extends HALResource>(model, linkToFollow: FollowLinkConfig<T>): T {
|
||||||
|
console.log('model', model, 'links', linkToFollow)
|
||||||
const matchingLinkDef = getLinkDefinition(model.constructor, linkToFollow.name);
|
const matchingLinkDef = getLinkDefinition(model.constructor, linkToFollow.name);
|
||||||
|
|
||||||
if (hasNoValue(matchingLinkDef)) {
|
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 {
|
} else {
|
||||||
const provider = getDataServiceFor(matchingLinkDef.resourceType);
|
const provider = getDataServiceFor(matchingLinkDef.resourceType);
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ export class GridThumbnailComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.src$ = new BehaviorSubject<string>(this.defaultImage);
|
this.src$ = new BehaviorSubject<string>(this.defaultImage);
|
||||||
console.log('this.thumbnail', this.thumbnail);
|
// console.log('this.thumbnail', this.thumbnail);
|
||||||
if (isObservable(this.thumbnail)) {
|
if (isObservable(this.thumbnail)) {
|
||||||
this.thumbnail.subscribe((thumbnailRD) => {
|
this.thumbnail.subscribe((thumbnailRD) => {
|
||||||
this.checkThumbnail(thumbnailRD.payload);
|
this.checkThumbnail(thumbnailRD.payload);
|
||||||
|
Reference in New Issue
Block a user